org.jets3t.service
Class StorageService

java.lang.Object
  extended by org.jets3t.service.StorageService
Direct Known Subclasses:
RestStorageService

public abstract class StorageService
extends java.lang.Object

A service that handles communication with a storage service, offering all the operations that can be performed on generic storage services.

This class must be extended by implementation classes that perform the communication with a specific service using a specific interface, such as REST or SOAP.

Implementations of StorageService must be thread-safe as they will probably be used by the multi-threaded service class ThreadedStorageService.

This class uses properties obtained through Jets3tProperties. For more information on these properties please refer to JetS3t Configuration


Field Summary
static int BUCKET_STATUS__ALREADY_CLAIMED
          Status code returned by checkBucketStatus(String) for a bucket that exists but is not owned by the service user (i.e.
static int BUCKET_STATUS__DOES_NOT_EXIST
          Status code returned by checkBucketStatus(String) for a bucket that does not exist.
static int BUCKET_STATUS__MY_BUCKET
          Status code returned by checkBucketStatus(String) for a bucket that exists and is owned by the service user.
protected  ProviderCredentials credentials
           
protected  Jets3tProperties jets3tProperties
           
protected  long timeOffset
          The approximate difference in the current time between your computer and a target service, measured in milliseconds.
 
Constructor Summary
protected StorageService(ProviderCredentials credentials)
          Construct a StorageService identified by the given user credentials.
protected StorageService(ProviderCredentials credentials, java.lang.String invokingApplicationDescription)
          Construct a StorageService identified by the given user credentials.
protected StorageService(ProviderCredentials credentials, java.lang.String invokingApplicationDescription, Jets3tProperties jets3tProperties)
          Construct a StorageService identified by the given user credentials.
 
Method Summary
protected  void assertAuthenticatedConnection(java.lang.String action)
          Throws an exception if this service is anonymous (that is, it was created without an ProviderCredentials object representing a user account.
protected  void assertValidBucket(StorageBucket bucket, java.lang.String action)
          Throws an exception if a bucket is null or contains a null/empty name.
protected  void assertValidObject(StorageObject object, java.lang.String action)
          Throws an exception if an object is null or contains a null/empty key.
protected  void assertValidObject(java.lang.String key, java.lang.String action)
          Throws an exception if an object's key name is null or empty.
abstract  int checkBucketStatus(java.lang.String bucketName)
          Find out the status of a bucket with the given name.
 java.util.Map<java.lang.String,java.lang.Object> copyObject(java.lang.String sourceBucketName, java.lang.String sourceObjectKey, java.lang.String destinationBucketName, StorageObject destinationObject, boolean replaceMetadata)
          Copy an object.
 java.util.Map<java.lang.String,java.lang.Object> copyObject(java.lang.String sourceBucketName, java.lang.String sourceObjectKey, java.lang.String destinationBucketName, StorageObject destinationObject, boolean replaceMetadata, java.util.Calendar ifModifiedSince, java.util.Calendar ifUnmodifiedSince, java.lang.String[] ifMatchTags, java.lang.String[] ifNoneMatchTags)
          Copy an object.
protected abstract  java.util.Map<java.lang.String,java.lang.Object> copyObjectImpl(java.lang.String sourceBucketName, java.lang.String sourceObjectKey, java.lang.String destinationBucketName, java.lang.String destinationObjectKey, AccessControlList acl, java.util.Map<java.lang.String,java.lang.Object> destinationMetadata, java.util.Calendar ifModifiedSince, java.util.Calendar ifUnmodifiedSince, java.lang.String[] ifMatchTags, java.lang.String[] ifNoneMatchTags, java.lang.String versionId, java.lang.String destinationObjectStorageClass)
          Copy an object within your account.
 StorageBucket createBucket(StorageBucket bucket)
          Create a bucket with the Access Control List settings of the bucket object (if any).
 StorageBucket createBucket(java.lang.String bucketName)
          Creates a bucket.
protected abstract  StorageBucket createBucketImpl(java.lang.String bucketName, java.lang.String location, AccessControlList acl)
          Creates a bucket.
 void deleteBucket(StorageBucket bucket)
          Deletes a bucket.
 void deleteBucket(java.lang.String bucketName)
          Deletes a bucket.
protected abstract  void deleteBucketImpl(java.lang.String bucketName)
           
 void deleteObject(java.lang.String bucketName, java.lang.String objectKey)
          Deletes an object from a bucket.
protected abstract  void deleteObjectImpl(java.lang.String bucketName, java.lang.String objectKey, java.lang.String versionId, java.lang.String multiFactorSerialNumber, java.lang.String multiFactorAuthCode)
           
 StorageOwner getAccountOwner()
          Returns the owner of an account, using information available in the bucket listing response.
protected abstract  StorageOwner getAccountOwnerImpl()
           
 StorageBucket getBucket(java.lang.String bucketName)
          Returns a bucket in your account by listing all your buckets (using listAllBuckets()), and looking for the named bucket in this list.
 AccessControlList getBucketAcl(java.lang.String bucketName)
          Retrieves the access control settings of a bucket.
protected abstract  AccessControlList getBucketAclImpl(java.lang.String bucketName)
           
 java.util.Date getCurrentTimeWithOffset()
          Returns the current date and time, adjusted according to the time offset between your computer and an AWS server (as set by the RestUtils.getAWSTimeAdjustment() method).
protected abstract  boolean getDisableDnsBuckets()
           
protected abstract  boolean getEnableStorageClasses()
           
abstract  java.lang.String getEndpoint()
           
protected abstract  int getHttpPort()
           
protected abstract  boolean getHttpsOnly()
           
protected abstract  int getHttpsPort()
           
 int getInternalErrorRetryMax()
           
 java.lang.String getInvokingApplicationDescription()
           
 Jets3tProperties getJetS3tProperties()
           
 StorageObject getObject(java.lang.String bucketName, java.lang.String objectKey)
          Returns an object representing the details and data of an item in a service, without applying any preconditions.
 StorageObject getObject(java.lang.String bucketName, java.lang.String objectKey, java.util.Calendar ifModifiedSince, java.util.Calendar ifUnmodifiedSince, java.lang.String[] ifMatchTags, java.lang.String[] ifNoneMatchTags, java.lang.Long byteRangeStart, java.lang.Long byteRangeEnd)
          Returns an object representing the details and data of an item that meets any given preconditions.
 AccessControlList getObjectAcl(java.lang.String bucketName, java.lang.String objectKey)
          Retrieves the access control settings of an object.
protected abstract  AccessControlList getObjectAclImpl(java.lang.String bucketName, java.lang.String objectKey, java.lang.String versionId)
           
 StorageObject getObjectDetails(java.lang.String bucketName, java.lang.String objectKey)
          Returns an object representing the details of an item in without the object's data, and without applying any preconditions.
 StorageObject getObjectDetails(java.lang.String bucketName, java.lang.String objectKey, java.util.Calendar ifModifiedSince, java.util.Calendar ifUnmodifiedSince, java.lang.String[] ifMatchTags, java.lang.String[] ifNoneMatchTags)
          Returns an object representing the details of an item that meets any given preconditions.
protected abstract  StorageObject getObjectDetailsImpl(java.lang.String bucketName, java.lang.String objectKey, java.util.Calendar ifModifiedSince, java.util.Calendar ifUnmodifiedSince, java.lang.String[] ifMatchTags, java.lang.String[] ifNoneMatchTags, java.lang.String versionId)
           
protected abstract  StorageObject getObjectImpl(java.lang.String bucketName, java.lang.String objectKey, java.util.Calendar ifModifiedSince, java.util.Calendar ifUnmodifiedSince, java.lang.String[] ifMatchTags, java.lang.String[] ifNoneMatchTags, java.lang.Long byteRangeStart, java.lang.Long byteRangeEnd, java.lang.String versionId)
           
 StorageBucket getOrCreateBucket(java.lang.String bucketName)
          Returns a bucket in your account, and creates the bucket if it does not yet exist.
 ProviderCredentials getProviderCredentials()
           
abstract  java.util.List<java.lang.String> getResourceParameterNames()
           
abstract  java.lang.String getRestHeaderPrefix()
           
abstract  java.lang.String getRestMetadataPrefix()
           
protected abstract  java.lang.String getSignatureIdentifier()
           
protected abstract  java.lang.String getVirtualPath()
           
protected  XmlResponsesSaxParser getXmlResponseSaxParser()
           
 boolean isAuthenticatedConnection()
           
abstract  boolean isBucketAccessible(java.lang.String bucketName)
          Indicates whether a bucket exists and is accessible to a service user.
 boolean isHttpsOnly()
          Whether to use secure HTTPS or insecure HTTP for communicating with a service, as configured in the Jets3tProperties.
 boolean isObjectInBucket(java.lang.String bucketName, java.lang.String objectKey)
          Convenience method to check whether an object exists in a bucket.
 boolean isShutdown()
           
 StorageBucket[] listAllBuckets()
          Lists the buckets belonging to the service user.
protected abstract  StorageBucket[] listAllBucketsImpl()
           
 StorageObject[] listObjects(java.lang.String bucketName)
          Lists the objects in a bucket.
 StorageObject[] listObjects(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter)
          Lists the objects in a bucket matching a prefix and delimiter.
 StorageObject[] listObjects(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength)
          Lists the objects in a bucket matching a prefix, while instructing the service to send response messages containing no more than a given number of object results.
 StorageObjectsChunk listObjectsChunked(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength, java.lang.String priorLastKey)
          Lists the objects in a bucket matching a prefix, chunking the results into batches of a given size, and returning each chunk separately.
 StorageObjectsChunk listObjectsChunked(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength, java.lang.String priorLastKey, boolean completeListing)
          Lists the objects in a bucket matching a prefix and also returns the common prefixes.
protected abstract  StorageObjectsChunk listObjectsChunkedImpl(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength, java.lang.String priorLastKey, boolean completeListing)
          Lists objects in a bucket up to the maximum listing length specified.
protected abstract  StorageObject[] listObjectsImpl(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength)
          Lists objects in a bucket.
 java.util.Map<java.lang.String,java.lang.Object> moveObject(java.lang.String sourceBucketName, java.lang.String sourceObjectKey, java.lang.String destinationBucketName, StorageObject destinationObject, boolean replaceMetadata)
          Move an object.
protected  StorageBucket newBucket()
           
protected  StorageObject newObject()
           
 void putBucketAcl(StorageBucket bucket)
          Applies access control settings to a bucket.
 void putBucketAcl(java.lang.String bucketName, AccessControlList acl)
          Applies access control settings to a bucket.
protected abstract  void putBucketAclImpl(java.lang.String bucketName, AccessControlList acl)
           
 StorageObject putObject(java.lang.String bucketName, StorageObject object)
          Puts an object inside an existing bucket, creating a new object or overwriting an existing one with the same key.
 void putObjectAcl(java.lang.String bucketName, StorageObject object)
          Applies access control settings to an object.
 void putObjectAcl(java.lang.String bucketName, java.lang.String objectKey, AccessControlList acl)
          Applies access control settings to an object.
protected abstract  void putObjectAclImpl(java.lang.String bucketName, java.lang.String objectKey, AccessControlList acl, java.lang.String versionId)
           
protected abstract  StorageObject putObjectImpl(java.lang.String bucketName, StorageObject object)
           
 java.util.Map<java.lang.String,java.lang.Object> renameMetadataKeys(java.util.Map<java.lang.String,java.lang.Object> metadata)
          Renames metadata property names to be suitable for use as HTTP Headers.
 java.util.Map<java.lang.String,java.lang.Object> renameObject(java.lang.String bucketName, java.lang.String sourceObjectKey, StorageObject destinationObject)
          Rename an object.
 void shutdown()
          Make a best-possible effort to shutdown and clean up any resources used by this service such as HTTP connections, connection pools, threads etc, although there is no guarantee that all such resources will indeed be fully cleaned up.
protected abstract  void shutdownImpl()
           
protected  void sleepOnInternalError(int internalErrorCount)
          Sleeps for a period of time based on the number of Internal Server errors a request has encountered, provided the number of errors does not exceed the value set with the property storage-service.internal-error-retry-max.
 java.util.Map<java.lang.String,java.lang.Object> updateObjectMetadata(java.lang.String bucketName, StorageObject object)
          Update an object's metadata.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUCKET_STATUS__MY_BUCKET

public static final int BUCKET_STATUS__MY_BUCKET
Status code returned by checkBucketStatus(String) for a bucket that exists and is owned by the service user.

See Also:
Constant Field Values

BUCKET_STATUS__DOES_NOT_EXIST

public static final int BUCKET_STATUS__DOES_NOT_EXIST
Status code returned by checkBucketStatus(String) for a bucket that does not exist.

See Also:
Constant Field Values

BUCKET_STATUS__ALREADY_CLAIMED

public static final int BUCKET_STATUS__ALREADY_CLAIMED
Status code returned by checkBucketStatus(String) for a bucket that exists but is not owned by the service user (i.e. another user has already created this bucket in the service's namespace).

See Also:
Constant Field Values

jets3tProperties

protected Jets3tProperties jets3tProperties

credentials

protected ProviderCredentials credentials

timeOffset

protected long timeOffset
The approximate difference in the current time between your computer and a target service, measured in milliseconds. This value is 0 by default. Use the getCurrentTimeWithOffset() to obtain the current time with this offset factor included, and the RestUtils.getAWSTimeAdjustment() method to calculate an offset value for your computer based on a response from an AWS server.

Constructor Detail

StorageService

protected StorageService(ProviderCredentials credentials,
                         java.lang.String invokingApplicationDescription,
                         Jets3tProperties jets3tProperties)
Construct a StorageService identified by the given user credentials.

Parameters:
credentials - the user credentials, may be null in which case the communication is done as an anonymous user.
invokingApplicationDescription - a short description of the application using the service, suitable for inclusion in a user agent string for REST/HTTP requests. Ideally this would include the application's version number, for example: Cockpit/0.7.3 or My App Name/1.0
jets3tProperties - JetS3t properties that will be applied within this service.

StorageService

protected StorageService(ProviderCredentials credentials,
                         java.lang.String invokingApplicationDescription)
Construct a StorageService identified by the given user credentials.

Parameters:
credentials - the user credentials, may be null in which case the communication is done as an anonymous user.
invokingApplicationDescription - a short description of the application using the service, suitable for inclusion in a user agent string for REST/HTTP requests. Ideally this would include the application's version number, for example: Cockpit/0.7.3 or My App Name/1.0

StorageService

protected StorageService(ProviderCredentials credentials)
Construct a StorageService identified by the given user credentials.

Parameters:
credentials - the user credentials, may be null in which case the communication is done as an anonymous user.
Method Detail

shutdown

public void shutdown()
              throws ServiceException
Make a best-possible effort to shutdown and clean up any resources used by this service such as HTTP connections, connection pools, threads etc, although there is no guarantee that all such resources will indeed be fully cleaned up. After calling this method the service instance will no longer be usable -- a new instance must be created to do more work.

Throws:
ServiceException

isShutdown

public boolean isShutdown()
Returns:
true if the shutdown() method has been used to shut down and clean up this service. If this function returns true this service instance can no longer be used to do work.

isAuthenticatedConnection

public boolean isAuthenticatedConnection()
Returns:
true if this service has ProviderCredentials identifying a user, false if the service is acting as an anonymous user.

isHttpsOnly

public boolean isHttpsOnly()
Whether to use secure HTTPS or insecure HTTP for communicating with a service, as configured in the Jets3tProperties.

Returns:
true if this service should use only secure HTTPS communication channels. If false, the non-secure HTTP protocol will be used.

getInternalErrorRetryMax

public int getInternalErrorRetryMax()
Returns:
The maximum number of times to retry when Internal Error (500) errors are encountered, as configured by the Jets3tProperties.

getJetS3tProperties

public Jets3tProperties getJetS3tProperties()
Returns:
the JetS3t properties that will be used by this service.

getXmlResponseSaxParser

protected XmlResponsesSaxParser getXmlResponseSaxParser()
                                                 throws ServiceException
Throws:
ServiceException

newBucket

protected StorageBucket newBucket()

newObject

protected StorageObject newObject()

sleepOnInternalError

protected void sleepOnInternalError(int internalErrorCount)
                             throws ServiceException,
                                    java.lang.InterruptedException
Sleeps for a period of time based on the number of Internal Server errors a request has encountered, provided the number of errors does not exceed the value set with the property storage-service.internal-error-retry-max. If the maximum error count is exceeded, this method will throw an ServiceException. The millisecond delay grows rapidly according to the formula 50 * (internalErrorCount ^ 2).
Error countDelay in milliseconds
150
2200
3450
4800
51250

Parameters:
internalErrorCount - the number of Internal Server errors encountered by a request.
Throws:
ServiceException - thrown if the number of internal errors exceeds the value of internalErrorCount.
java.lang.InterruptedException - thrown if the thread sleep is interrupted.

getProviderCredentials

public ProviderCredentials getProviderCredentials()
Returns:
the credentials identifying the service user, or null for anonymous.

getInvokingApplicationDescription

public java.lang.String getInvokingApplicationDescription()
Returns:
a description of the application using this service, suitable for inclusion in the user agent string of REST/HTTP requests.

assertAuthenticatedConnection

protected void assertAuthenticatedConnection(java.lang.String action)
                                      throws ServiceException
Throws an exception if this service is anonymous (that is, it was created without an ProviderCredentials object representing a user account.

Parameters:
action - the action being attempted which this assertion is applied, for debugging purposes.
Throws:
ServiceException

assertValidBucket

protected void assertValidBucket(StorageBucket bucket,
                                 java.lang.String action)
                          throws ServiceException
Throws an exception if a bucket is null or contains a null/empty name.

Parameters:
bucket -
action - the action being attempted which this assertion is applied, for debugging purposes.
Throws:
ServiceException

assertValidObject

protected void assertValidObject(StorageObject object,
                                 java.lang.String action)
                          throws ServiceException
Throws an exception if an object is null or contains a null/empty key.

Parameters:
object -
action - the action being attempted which this assertion is applied, for debugging purposes.
Throws:
ServiceException

assertValidObject

protected void assertValidObject(java.lang.String key,
                                 java.lang.String action)
                          throws ServiceException
Throws an exception if an object's key name is null or empty.

Parameters:
key - An object's key name.
action - the action being attempted which this assertion is applied, for debugging purposes.
Throws:
ServiceException

listObjects

public StorageObject[] listObjects(java.lang.String bucketName)
                            throws ServiceException
Lists the objects in a bucket.

The objects returned by this method contain only minimal information such as the object's size, ETag, and LastModified timestamp. To retrieve the objects' metadata you must perform follow-up getObject or getObjectDetails operations.

This method can be performed by anonymous services. Anonymous services can only list the objects in a publicly-readable bucket.

Parameters:
bucketName - the name of the bucket whose contents will be listed.
Returns:
the set of objects contained in a bucket.
Throws:
ServiceException

listObjects

public StorageObject[] listObjects(java.lang.String bucketName,
                                   java.lang.String prefix,
                                   java.lang.String delimiter)
                            throws ServiceException
Lists the objects in a bucket matching a prefix and delimiter.

The objects returned by this method contain only minimal information such as the object's size, ETag, and LastModified timestamp. To retrieve the objects' metadata you must perform follow-up getObject or getObjectDetails operations.

This method can be performed by anonymous services. Anonymous services can only list the objects in a publicly-readable bucket.

NOTE: If you supply a delimiter value that could cause virtual path "subdirectories" to be included in the results from the service, use the listObjectsChunked(String, String, String, long, String, boolean) method instead of this one to obtain both object and path values.

Parameters:
bucketName - the name of the bucket whose contents will be listed.
prefix - only objects with a key that starts with this prefix will be listed
delimiter - only list objects with key names up to this delimiter, may be null. See note above. Note: If a non-null delimiter is specified, the prefix must include enough text to reach the first occurrence of the delimiter in the bucket's keys, or no results will be returned.
Returns:
the set of objects contained in a bucket whose keys start with the given prefix.
Throws:
ServiceException

createBucket

public StorageBucket createBucket(java.lang.String bucketName)
                           throws ServiceException
Creates a bucket. Caution: Performing this operation unnecessarily when a bucket already exists may cause OperationAborted errors with the message "A conflicting conditional operation is currently in progress against this resource.". To avoid this error, use the getOrCreateBucket(String) in situations where the bucket may already exist. This method cannot be performed by anonymous services.

Parameters:
bucketName - the name of the bucket to create.
Returns:
the created bucket object. Note: the object returned has minimal information about the bucket that was created, including only the bucket's name.
Throws:
ServiceException

createBucket

public StorageBucket createBucket(StorageBucket bucket)
                           throws ServiceException
Create a bucket with the Access Control List settings of the bucket object (if any).

Caution: Performing this operation unnecessarily when a bucket already exists may cause OperationAborted errors with the message "A conflicting conditional operation is currently in progress against this resource.". To avoid this error, use the getOrCreateBucket(String) in situations where the bucket may already exist.

This method cannot be performed by anonymous services.

Parameters:
bucket - the bucket to create, including optional ACL settings.
Returns:
the created bucket object. Note: the object returned has minimal information about the bucket that was created, including only the bucket's name.
Throws:
ServiceException

isObjectInBucket

public boolean isObjectInBucket(java.lang.String bucketName,
                                java.lang.String objectKey)
                         throws ServiceException
Convenience method to check whether an object exists in a bucket.

Parameters:
bucketName - the name of the bucket containing the object.
objectKey - the key identifying the object.
Returns:
false if the object is not found in the bucket, true if the object exists (although it may be inaccessible to you).
Throws:
ServiceException

getObject

public StorageObject getObject(java.lang.String bucketName,
                               java.lang.String objectKey)
                        throws ServiceException
Returns an object representing the details and data of an item in a service, without applying any preconditions.

This method can be performed by anonymous services. Anonymous services can get a publicly-readable object.

Important: It is the caller's responsibility to close the object's data input stream. The data stream should be consumed and closed as soon as is practical as network connections may be held open until the streams are closed. Excessive unclosed streams can lead to connection starvation.

Parameters:
bucketName - the name of the bucket containing the object.
objectKey - the key identifying the object.
Returns:
the object with the given key, including the object's data input stream.
Throws:
ServiceException

getObjectDetails

public StorageObject getObjectDetails(java.lang.String bucketName,
                                      java.lang.String objectKey)
                               throws ServiceException
Returns an object representing the details of an item in without the object's data, and without applying any preconditions.

This method can be performed by anonymous services. Anonymous services can get a publicly-readable object's details.

Parameters:
bucketName - the name of the bucket containing the object.
objectKey - the key identifying the object.
Returns:
the object with the given key, including only general details and metadata (not the data input stream)
Throws:
ServiceException

listAllBuckets

public StorageBucket[] listAllBuckets()
                               throws ServiceException
Lists the buckets belonging to the service user.

This method cannot be performed by anonymous services, and will fail with an exception if the service is not authenticated.

Returns:
the list of buckets owned by the service user.
Throws:
ServiceException

getAccountOwner

public StorageOwner getAccountOwner()
                             throws ServiceException
Returns the owner of an account, using information available in the bucket listing response.

This method cannot be performed by anonymous services, and will fail with an exception if the service is not authenticated.

Returns:
the owner of the account.
Throws:
ServiceException

listObjects

public StorageObject[] listObjects(java.lang.String bucketName,
                                   java.lang.String prefix,
                                   java.lang.String delimiter,
                                   long maxListingLength)
                            throws ServiceException
Lists the objects in a bucket matching a prefix, while instructing the service to send response messages containing no more than a given number of object results.

The objects returned by this method contain only minimal information such as the object's size, ETag, and LastModified timestamp. To retrieve the objects' metadata you must perform follow-up getObject or getObjectDetails operations.

This method can be performed by anonymous services. Anonymous services can list the contents of a publicly-readable bucket.

NOTE: If you supply a delimiter value that could cause virtual path "subdirectories" to be included in the results from the service, use the listObjectsChunked(String, String, String, long, String, boolean) method instead of this one to obtain both object and path values.

Parameters:
bucketName - the name of the the bucket whose contents will be listed.
prefix - only objects with a key that starts with this prefix will be listed
delimiter - only list objects with key names up to this delimiter, may be null. See note above.
maxListingLength - the maximum number of objects to include in each result message. This value has no effect on the number of objects that will be returned by this method, because it will always return all the objects in the bucket.
Returns:
the set of objects contained in a bucket whose keys start with the given prefix.
Throws:
ServiceException

listObjectsChunked

public StorageObjectsChunk listObjectsChunked(java.lang.String bucketName,
                                              java.lang.String prefix,
                                              java.lang.String delimiter,
                                              long maxListingLength,
                                              java.lang.String priorLastKey)
                                       throws ServiceException
Lists the objects in a bucket matching a prefix, chunking the results into batches of a given size, and returning each chunk separately. It is the responsibility of the caller to building a complete bucket object listing by performing follow-up requests if necessary.

The objects returned by this method contain only minimal information such as the object's size, ETag, and LastModified timestamp. To retrieve the objects' metadata you must perform follow-up getObject or getObjectDetails operations.

This method can be performed by anonymous services. Anonymous services can list the contents of a publicly-readable bucket.

Parameters:
bucketName - the name of the the bucket whose contents will be listed.
prefix - only objects with a key that starts with this prefix will be listed, may be null.
delimiter - only list objects with key names up to this delimiter, may be null.
maxListingLength - the maximum number of objects to include in each result chunk
priorLastKey - the last object key received in a prior call to this method. The next chunk of objects listed will start with the next object in the bucket after this key name. This parameter may be null, in which case the listing will start at the beginning of the bucket's object contents.
Returns:
the set of objects contained in a bucket whose keys start with the given prefix.
Throws:
ServiceException

listObjectsChunked

public StorageObjectsChunk listObjectsChunked(java.lang.String bucketName,
                                              java.lang.String prefix,
                                              java.lang.String delimiter,
                                              long maxListingLength,
                                              java.lang.String priorLastKey,
                                              boolean completeListing)
                                       throws ServiceException
Lists the objects in a bucket matching a prefix and also returns the common prefixes. Depending on the value of the completeListing variable, this method can be set to automatically perform follow-up requests to build a complete object listing, or to return only a partial listing.

The objects returned by this method contain only minimal information such as the object's size, ETag, and LastModified timestamp. To retrieve the objects' metadata you must perform follow-up getObject or getObjectDetails operations.

This method can be performed by anonymous services. Anonymous services can list the contents of a publicly-readable bucket.

Parameters:
bucketName - the name of the the bucket whose contents will be listed.
prefix - only objects with a key that starts with this prefix will be listed, may be null.
delimiter - only objects with a key that starts with this prefix will be listed, may be null.
maxListingLength - the maximum number of objects to include in each result chunk
priorLastKey - the last object key received in a prior call to this method. The next chunk of objects listed will start with the next object in the bucket after this key name. This parameter may be null, in which case the listing will start at the beginning of the bucket's object contents.
completeListing - if true, the service class will automatically perform follow-up requests to build a complete bucket object listing.
Returns:
the set of objects contained in a bucket whose keys start with the given prefix.
Throws:
ServiceException

getBucket

public StorageBucket getBucket(java.lang.String bucketName)
                        throws ServiceException
Returns a bucket in your account by listing all your buckets (using listAllBuckets()), and looking for the named bucket in this list.

This method cannot be performed by anonymous services.

Parameters:
bucketName -
Returns:
the bucket in your account, or null if you do not own the named bucket.
Throws:
ServiceException

getOrCreateBucket

public StorageBucket getOrCreateBucket(java.lang.String bucketName)
                                throws ServiceException
Returns a bucket in your account, and creates the bucket if it does not yet exist.

Parameters:
bucketName - the name of the bucket to retrieve or create.
Returns:
the bucket in your account.
Throws:
ServiceException

deleteBucket

public void deleteBucket(StorageBucket bucket)
                  throws ServiceException
Deletes a bucket. Only the owner of a bucket may delete it.

This method cannot be performed by anonymous services.

Parameters:
bucket - the bucket to delete.
Throws:
ServiceException

deleteBucket

public void deleteBucket(java.lang.String bucketName)
                  throws ServiceException
Deletes a bucket. Only the owner of a bucket may delete it.

This method cannot be performed by anonymous services.

Parameters:
bucketName - the name of the bucket to delete.
Throws:
ServiceException

putObject

public StorageObject putObject(java.lang.String bucketName,
                               StorageObject object)
                        throws ServiceException
Puts an object inside an existing bucket, creating a new object or overwriting an existing one with the same key. The Access Control List settings of the object (if any) will also be applied.

This method can be performed by anonymous services. Anonymous services can put objects into a publicly-writable bucket.

Parameters:
bucketName - the name of the bucket inside which the object will be put.
object - the object containing all information that will be written to the service. At very least this object must be valid. Beyond that it may contain: an input stream with the object's data content, metadata, and access control settings.

Note: It is very important to set the object's Content-Length to match the size of the data input stream when possible, as this can remove the need to read data into memory to determine its size.

Returns:
the object populated with any metadata.
Throws:
ServiceException

copyObject

public java.util.Map<java.lang.String,java.lang.Object> copyObject(java.lang.String sourceBucketName,
                                                                   java.lang.String sourceObjectKey,
                                                                   java.lang.String destinationBucketName,
                                                                   StorageObject destinationObject,
                                                                   boolean replaceMetadata,
                                                                   java.util.Calendar ifModifiedSince,
                                                                   java.util.Calendar ifUnmodifiedSince,
                                                                   java.lang.String[] ifMatchTags,
                                                                   java.lang.String[] ifNoneMatchTags)
                                                            throws ServiceException
Copy an object. You can copy an object within a single bucket or between buckets, and can optionally update the object's metadata at the same time.

This method cannot be performed by anonymous services. You must have read access to the source object and write access to the destination bucket.

An object can be copied over itself, in which case you can update its metadata without making any other changes.

Parameters:
sourceBucketName - the name of the bucket that contains the original object.
sourceObjectKey - the key name of the original object.
destinationBucketName - the name of the destination bucket to which the object will be copied.
destinationObject - the object that will be created by the copy operation. If this item includes an AccessControlList setting the copied object will be assigned that ACL, otherwise the copied object will be assigned the default private ACL setting.
replaceMetadata - If this parameter is true, the copied object will be assigned the metadata values present in the destinationObject. Otherwise, the copied object will have the same metadata as the original object.
ifModifiedSince - a precondition specifying a date after which the object must have been modified, ignored if null.
ifUnmodifiedSince - a precondition specifying a date after which the object must not have been modified, ignored if null.
ifMatchTags - a precondition specifying an MD5 hash the object must match, ignored if null.
ifNoneMatchTags - a precondition specifying an MD5 hash the object must not match, ignored if null.
Returns:
a map of the header and result information resulting from the object copy. The map includes the object's MD5 hash value (ETag), its size (Content-Length), and update timestamp (Last-Modified).
Throws:
ServiceException

copyObject

public java.util.Map<java.lang.String,java.lang.Object> copyObject(java.lang.String sourceBucketName,
                                                                   java.lang.String sourceObjectKey,
                                                                   java.lang.String destinationBucketName,
                                                                   StorageObject destinationObject,
                                                                   boolean replaceMetadata)
                                                            throws ServiceException
Copy an object. You can copy an object within a single bucket or between buckets, and can optionally update the object's metadata at the same time.

This method cannot be performed by anonymous services. You must have read access to the source object and write access to the destination bucket.

An object can be copied over itself, in which case you can update its metadata without making any other changes.

Parameters:
sourceBucketName - the name of the bucket that contains the original object.
sourceObjectKey - the key name of the original object.
destinationBucketName - the name of the destination bucket to which the object will be copied.
destinationObject - the object that will be created by the copy operation. If this item includes an AccessControlList setting the copied object will be assigned that ACL, otherwise the copied object will be assigned the default private ACL setting.
replaceMetadata - If this parameter is true, the copied object will be assigned the metadata values present in the destinationObject. Otherwise, the copied object will have the same metadata as the original object.
Returns:
a map of the header and result information after the object copy. The map includes the object's MD5 hash value (ETag), its size (Content-Length), and update timestamp (Last-Modified).
Throws:
ServiceException

moveObject

public java.util.Map<java.lang.String,java.lang.Object> moveObject(java.lang.String sourceBucketName,
                                                                   java.lang.String sourceObjectKey,
                                                                   java.lang.String destinationBucketName,
                                                                   StorageObject destinationObject,
                                                                   boolean replaceMetadata)
                                                            throws ServiceException
Move an object. This method works by invoking the copyObject(String, String, String, StorageObject, boolean) method to copy the original object, then deletes the original object once the copy has succeeded.

This method cannot be performed by anonymous services. You must have read access to the source object, write access to the destination bucket, and write access to the source bucket.

If the copy operation succeeds but the delete operation fails, this method will not throw an exception but the result map object will contain an item named "DeleteException" with the exception thrown by the delete operation.

Parameters:
sourceBucketName - the name of the bucket that contains the original object.
sourceObjectKey - the key name of the original object.
destinationBucketName - the name of the destination bucket to which the object will be copied.
destinationObject - the object that will be created by the move operation. If this item includes an AccessControlList setting the copied object will be assigned that ACL, otherwise the copied object will be assigned the default private ACL setting.
replaceMetadata - If this parameter is true, the copied object will be assigned the metadata values present in the destinationObject. Otherwise, the copied object will have the same metadata as the original object.
Returns:
a map of the header and result information after the object copy. The map includes the object's MD5 hash value (ETag), its size (Content-Length), and update timestamp (Last-Modified). If the object was successfully copied but the original could not be deleted, the map will also include an item named "DeleteException" with the exception thrown by the delete operation.
Throws:
ServiceException

renameObject

public java.util.Map<java.lang.String,java.lang.Object> renameObject(java.lang.String bucketName,
                                                                     java.lang.String sourceObjectKey,
                                                                     StorageObject destinationObject)
                                                              throws ServiceException
Rename an object. This method works by invoking the moveObject(String, String, String, StorageObject, boolean) method to move the original object to a new key name.

The original object's metadata is retained, but to apply an access control setting other than private you must specify an ACL in the destination object.

This method cannot be performed by anonymous services. You must have write access to the source object and write access to the bucket.

Parameters:
bucketName - the name of the bucket containing the original object that will be copied.
sourceObjectKey - the key name of the original object.
destinationObject - the object that will be created by the rename operation. If this item includes an AccessControlList setting the copied object will be assigned that ACL, otherwise the copied object will be assigned the default private ACL setting.
Returns:
a map of the header and result information after the object copy. The map includes the object's MD5 hash value (ETag), its size (Content-Length), and update timestamp (Last-Modified). If the object was successfully copied but the original could not be deleted, the map will also include an item named "DeleteException" with the exception thrown by the delete operation.
Throws:
ServiceException

updateObjectMetadata

public java.util.Map<java.lang.String,java.lang.Object> updateObjectMetadata(java.lang.String bucketName,
                                                                             StorageObject object)
                                                                      throws ServiceException
Update an object's metadata. This method works by invoking the copyObject(String, String, String, StorageObject, boolean) method to copy the original object over itself, applying the new metadata in the process.

Parameters:
bucketName - the name of the bucket containing the object that will be updated.
object - the object that will be updated. If this item includes an AccessControlList setting the copied object will be assigned that ACL, otherwise the copied object will be assigned the default private ACL setting.
Returns:
a map of the header and result information after the object copy. The map includes the object's MD5 hash value (ETag), its size (Content-Length), and update timestamp (Last-Modified).
Throws:
ServiceException

deleteObject

public void deleteObject(java.lang.String bucketName,
                         java.lang.String objectKey)
                  throws ServiceException
Deletes an object from a bucket.

This method can be performed by anonymous services. Anonymous services can delete objects from publicly-writable buckets.

Parameters:
bucketName - the name of the bucket containing the object to be deleted.
objectKey - the key representing the object
Throws:
ServiceException

getObjectDetails

public StorageObject getObjectDetails(java.lang.String bucketName,
                                      java.lang.String objectKey,
                                      java.util.Calendar ifModifiedSince,
                                      java.util.Calendar ifUnmodifiedSince,
                                      java.lang.String[] ifMatchTags,
                                      java.lang.String[] ifNoneMatchTags)
                               throws ServiceException
Returns an object representing the details of an item that meets any given preconditions. The object is returned without the object's data.

An exception is thrown if any of the preconditions fail. Preconditions are only applied if they are non-null.

This method can be performed by anonymous services. Anonymous services can get details of publicly-readable objects.

Parameters:
bucketName - the name of the bucket containing the object.
objectKey - the key identifying the object.
ifModifiedSince - a precondition specifying a date after which the object must have been modified, ignored if null.
ifUnmodifiedSince - a precondition specifying a date after which the object must not have been modified, ignored if null.
ifMatchTags - a precondition specifying an MD5 hash the object must match, ignored if null.
ifNoneMatchTags - a precondition specifying an MD5 hash the object must not match, ignored if null.
Returns:
the object with the given key, including only general details and metadata (not the data input stream)
Throws:
ServiceException

getObject

public StorageObject getObject(java.lang.String bucketName,
                               java.lang.String objectKey,
                               java.util.Calendar ifModifiedSince,
                               java.util.Calendar ifUnmodifiedSince,
                               java.lang.String[] ifMatchTags,
                               java.lang.String[] ifNoneMatchTags,
                               java.lang.Long byteRangeStart,
                               java.lang.Long byteRangeEnd)
                        throws ServiceException
Returns an object representing the details and data of an item that meets any given preconditions.

Important: It is the caller's responsibility to close the object's data input stream. The data stream should be consumed and closed as soon as is practical as network connections may be held open until the streams are closed. Excessive unclosed streams can lead to connection starvation.

An exception is thrown if any of the preconditions fail. Preconditions are only applied if they are non-null.

This method can be performed by anonymous services. Anonymous services can get a publicly-readable object.

Implementation notes

Implementations should use assertValidBucket(org.jets3t.service.model.StorageBucket, java.lang.String) assertion.

Parameters:
bucketName - the name of the bucket containing the object.
objectKey - the key identifying the object.
ifModifiedSince - a precondition specifying a date after which the object must have been modified, ignored if null.
ifUnmodifiedSince - a precondition specifying a date after which the object must not have been modified, ignored if null.
ifMatchTags - a precondition specifying an MD5 hash the object must match, ignored if null.
ifNoneMatchTags - a precondition specifying an MD5 hash the object must not match, ignored if null.
byteRangeStart - include only a portion of the object's data - starting at this point, ignored if null.
byteRangeEnd - include only a portion of the object's data - ending at this point, ignored if null.
Returns:
the object with the given key, including only general details and metadata (not the data input stream)
Throws:
ServiceException

putObjectAcl

public void putObjectAcl(java.lang.String bucketName,
                         StorageObject object)
                  throws ServiceException
Applies access control settings to an object. The ACL settings must be included with the object. This method can be performed by anonymous services, but can only succeed if the object's existing ACL already allows write access by the anonymous user. In general, you can only access the ACL of an object if the ACL already in place for that object allows you to do so.

Parameters:
bucketName - the name of the bucket containing the object to modify.
object - the object with ACL settings that will be applied.
Throws:
ServiceException

putObjectAcl

public void putObjectAcl(java.lang.String bucketName,
                         java.lang.String objectKey,
                         AccessControlList acl)
                  throws ServiceException
Applies access control settings to an object. The ACL settings must be included with the object. This method can be performed by anonymous services, but can only succeed if the object's existing ACL already allows write access by the anonymous user. In general, you can only access the ACL of an object if the ACL already in place for that object allows you to do so.

Parameters:
bucketName - the name of the bucket containing the object to modify.
objectKey - the key name of the object with ACL settings that will be applied.
acl - the ACL to apply.
Throws:
ServiceException

getObjectAcl

public AccessControlList getObjectAcl(java.lang.String bucketName,
                                      java.lang.String objectKey)
                               throws ServiceException
Retrieves the access control settings of an object. This method can be performed by anonymous services, but can only succeed if the object's existing ACL already allows write access by the anonymous user. In general, you can only access the ACL of an object if the ACL already in place for that object allows you to do so.

Parameters:
bucketName - the name of the bucket whose ACL settings will be retrieved (if objectKey is null) or the name of the bucket containing the object whose ACL settings will be retrieved (if objectKey is non-null).
objectKey - if non-null, the key of the object whose ACL settings will be retrieved. Ignored if null.
Returns:
the ACL settings of the bucket or object.
Throws:
ServiceException

putBucketAcl

public void putBucketAcl(java.lang.String bucketName,
                         AccessControlList acl)
                  throws ServiceException
Applies access control settings to a bucket. The ACL settings must be included inside the bucket. This method can be performed by anonymous services, but can only succeed if the bucket's existing ACL already allows write access by the anonymous user. In general, you can only access the ACL of a bucket if the ACL already in place for that bucket allows you to do so.

Parameters:
bucketName - a name of the bucket with ACL settings to apply.
acl - the ACL to apply.
Throws:
ServiceException

putBucketAcl

public void putBucketAcl(StorageBucket bucket)
                  throws ServiceException
Applies access control settings to a bucket. The ACL settings must be included inside the bucket. This method can be performed by anonymous services, but can only succeed if the bucket's existing ACL already allows write access by the anonymous user. In general, you can only access the ACL of a bucket if the ACL already in place for that bucket allows you to do so.

Parameters:
bucket - a bucket with ACL settings to apply.
Throws:
ServiceException

getBucketAcl

public AccessControlList getBucketAcl(java.lang.String bucketName)
                               throws ServiceException
Retrieves the access control settings of a bucket. This method can be performed by anonymous services, but can only succeed if the bucket's existing ACL already allows write access by the anonymous user. In general, you can only access the ACL of a bucket if the ACL already in place for that bucket allows you to do so.

Parameters:
bucketName - the name of the bucket whose access control settings will be returned.
Returns:
the ACL settings of the bucket.
Throws:
ServiceException

getCurrentTimeWithOffset

public java.util.Date getCurrentTimeWithOffset()
Returns the current date and time, adjusted according to the time offset between your computer and an AWS server (as set by the RestUtils.getAWSTimeAdjustment() method).

Returns:
the current time, or the current time adjusted to match the AWS time if the RestUtils.getAWSTimeAdjustment() method has been invoked.

renameMetadataKeys

public java.util.Map<java.lang.String,java.lang.Object> renameMetadataKeys(java.util.Map<java.lang.String,java.lang.Object> metadata)
Renames metadata property names to be suitable for use as HTTP Headers. This is done by renaming any non-HTTP headers to have the a service-specific prefix and leaving the HTTP header names unchanged. The HTTP header names left unchanged are those found in RestUtils.HTTP_HEADER_METADATA_NAMES

Parameters:
metadata -
Returns:
a map of metadata property name/value pairs renamed to be suitable for use as HTTP headers.

isBucketAccessible

public abstract boolean isBucketAccessible(java.lang.String bucketName)
                                    throws ServiceException
Indicates whether a bucket exists and is accessible to a service user.

Caution: This check started to cause issues in situations where you need to immediately create a bucket when it does not exist. To conditionally create a bucket, use the getOrCreateBucket(String) method instead.

This method can be performed by anonymous services.

Implementation notes

This method can be implemented by attempting to list the objects in a bucket. If the listing is successful return true, if the listing failed for any reason return false.

Parameters:
bucketName - the bucket to check.
Returns:
true if the bucket exists and is accessible to the service user, false otherwise.
Throws:
ServiceException

checkBucketStatus

public abstract int checkBucketStatus(java.lang.String bucketName)
                               throws ServiceException
Find out the status of a bucket with the given name.

Caveats:

Parameters:
bucketName -
Returns:
BUCKET_STATUS__MY_BUCKET if you already own the bucket, BUCKET_STATUS__DOES_NOT_EXIST if the bucket does not yet exist, or BUCKET_STATUS__ALREADY_CLAIMED if someone else has already created a bucket with the given name.
Throws:
ServiceException

listAllBucketsImpl

protected abstract StorageBucket[] listAllBucketsImpl()
                                               throws ServiceException
Returns:
the buckets in your account.
Throws:
ServiceException

getAccountOwnerImpl

protected abstract StorageOwner getAccountOwnerImpl()
                                             throws ServiceException
Returns:
the owner of an account.
Throws:
ServiceException

listObjectsImpl

protected abstract StorageObject[] listObjectsImpl(java.lang.String bucketName,
                                                   java.lang.String prefix,
                                                   java.lang.String delimiter,
                                                   long maxListingLength)
                                            throws ServiceException
Lists objects in a bucket. Implementation notes

The implementation of this method is expected to return all the objects in a bucket, not a subset. This may require repeating the list operation if the first one doesn't include all the available objects, such as when the number of objects is greater than maxListingLength.

Parameters:
bucketName -
prefix - only objects with a key that starts with this prefix will be listed, may be null.
delimiter - only list objects with key names up to this delimiter, may be null.
maxListingLength -
Returns:
the objects in a bucket.
Throws:
ServiceException

listObjectsChunkedImpl

protected abstract StorageObjectsChunk listObjectsChunkedImpl(java.lang.String bucketName,
                                                              java.lang.String prefix,
                                                              java.lang.String delimiter,
                                                              long maxListingLength,
                                                              java.lang.String priorLastKey,
                                                              boolean completeListing)
                                                       throws ServiceException
Lists objects in a bucket up to the maximum listing length specified.

Implementation notes The implementation of this method returns only as many objects as requested in the chunk size. It is the responsibility of the caller to build a complete object listing from multiple chunks, should this be necessary.

Parameters:
bucketName -
prefix - only objects with a key that starts with this prefix will be listed, may be null.
delimiter - only list objects with key names up to this delimiter, may be null.
maxListingLength -
priorLastKey -
completeListing -
Throws:
ServiceException

createBucketImpl

protected abstract StorageBucket createBucketImpl(java.lang.String bucketName,
                                                  java.lang.String location,
                                                  AccessControlList acl)
                                           throws ServiceException
Creates a bucket. Implementation notes

The implementing method must populate the bucket object's metadata with the results of the operation before returning the object. It must also apply any AccessControlList settings included with the bucket.

Parameters:
bucketName - the name of the bucket to create.
location - the geographical location where the bucket will be stored (if applicable for the target service). A null string value will cause the bucket to be stored in the default location.
acl - an access control object representing the initial acl values for the bucket. May be null, in which case the default permissions are applied.
Returns:
the created bucket object, populated with all metadata made available by the creation operation.
Throws:
ServiceException

deleteBucketImpl

protected abstract void deleteBucketImpl(java.lang.String bucketName)
                                  throws ServiceException
Throws:
ServiceException

putObjectImpl

protected abstract StorageObject putObjectImpl(java.lang.String bucketName,
                                               StorageObject object)
                                        throws ServiceException
Throws:
ServiceException

copyObjectImpl

protected abstract java.util.Map<java.lang.String,java.lang.Object> copyObjectImpl(java.lang.String sourceBucketName,
                                                                                   java.lang.String sourceObjectKey,
                                                                                   java.lang.String destinationBucketName,
                                                                                   java.lang.String destinationObjectKey,
                                                                                   AccessControlList acl,
                                                                                   java.util.Map<java.lang.String,java.lang.Object> destinationMetadata,
                                                                                   java.util.Calendar ifModifiedSince,
                                                                                   java.util.Calendar ifUnmodifiedSince,
                                                                                   java.lang.String[] ifMatchTags,
                                                                                   java.lang.String[] ifNoneMatchTags,
                                                                                   java.lang.String versionId,
                                                                                   java.lang.String destinationObjectStorageClass)
                                                                            throws ServiceException
Copy an object within your account. Copies within a single bucket or between buckets, and optionally updates the object's metadata at the same time. An object can be copied over itself, allowing you to update the metadata without making any other changes.

Parameters:
sourceBucketName - the name of the bucket that contains the original object.
sourceObjectKey - the key name of the original object.
destinationBucketName - the name of the destination bucket to which the object will be copied.
destinationObjectKey - the key name for the copied object.
acl - the access control settings that will be applied to the copied object. If this parameter is null, the default (private) ACL setting will be applied to the copied object.
destinationMetadata - metadata items to apply to the copied object. If this parameter is null, the metadata will be copied unchanged from the original object. If this parameter is not null, the copied object will have only the supplied metadata.
Returns:
a map of the header and result information returned after the object copy. The map includes the object's MD5 hash value (ETag), its size (Content-Length), and update timestamp (Last-Modified).
Throws:
ServiceException

deleteObjectImpl

protected abstract void deleteObjectImpl(java.lang.String bucketName,
                                         java.lang.String objectKey,
                                         java.lang.String versionId,
                                         java.lang.String multiFactorSerialNumber,
                                         java.lang.String multiFactorAuthCode)
                                  throws ServiceException
Throws:
ServiceException

getObjectDetailsImpl

protected abstract StorageObject getObjectDetailsImpl(java.lang.String bucketName,
                                                      java.lang.String objectKey,
                                                      java.util.Calendar ifModifiedSince,
                                                      java.util.Calendar ifUnmodifiedSince,
                                                      java.lang.String[] ifMatchTags,
                                                      java.lang.String[] ifNoneMatchTags,
                                                      java.lang.String versionId)
                                               throws ServiceException
Throws:
ServiceException

getObjectImpl

protected abstract StorageObject getObjectImpl(java.lang.String bucketName,
                                               java.lang.String objectKey,
                                               java.util.Calendar ifModifiedSince,
                                               java.util.Calendar ifUnmodifiedSince,
                                               java.lang.String[] ifMatchTags,
                                               java.lang.String[] ifNoneMatchTags,
                                               java.lang.Long byteRangeStart,
                                               java.lang.Long byteRangeEnd,
                                               java.lang.String versionId)
                                        throws ServiceException
Throws:
ServiceException

putBucketAclImpl

protected abstract void putBucketAclImpl(java.lang.String bucketName,
                                         AccessControlList acl)
                                  throws ServiceException
Throws:
ServiceException

putObjectAclImpl

protected abstract void putObjectAclImpl(java.lang.String bucketName,
                                         java.lang.String objectKey,
                                         AccessControlList acl,
                                         java.lang.String versionId)
                                  throws ServiceException
Throws:
ServiceException

getObjectAclImpl

protected abstract AccessControlList getObjectAclImpl(java.lang.String bucketName,
                                                      java.lang.String objectKey,
                                                      java.lang.String versionId)
                                               throws ServiceException
Throws:
ServiceException

getBucketAclImpl

protected abstract AccessControlList getBucketAclImpl(java.lang.String bucketName)
                                               throws ServiceException
Throws:
ServiceException

shutdownImpl

protected abstract void shutdownImpl()
                              throws ServiceException
Throws:
ServiceException

getEndpoint

public abstract java.lang.String getEndpoint()
Returns:
the URL end-point of the target service.

getVirtualPath

protected abstract java.lang.String getVirtualPath()

getSignatureIdentifier

protected abstract java.lang.String getSignatureIdentifier()

getRestHeaderPrefix

public abstract java.lang.String getRestHeaderPrefix()
Returns:
the REST header prefix used by the target service.

getResourceParameterNames

public abstract java.util.List<java.lang.String> getResourceParameterNames()
Returns:
GET parameter names that represent specific resources in the target service, as opposed to representing REST operation "plumbing". For example the "acl" parameter might be used to represent a resource's access control list settings.

getRestMetadataPrefix

public abstract java.lang.String getRestMetadataPrefix()
Returns:
the REST header prefix used by the target service to identify metadata information.

getHttpPort

protected abstract int getHttpPort()

getHttpsPort

protected abstract int getHttpsPort()

getHttpsOnly

protected abstract boolean getHttpsOnly()

getDisableDnsBuckets

protected abstract boolean getDisableDnsBuckets()

getEnableStorageClasses

protected abstract boolean getEnableStorageClasses()