|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jets3t.service.S3Service
org.jets3t.service.impl.rest.httpclient.RestS3Service
public class RestS3Service
REST/HTTP implementation of an S3Service based on the HttpClient library.
This class uses properties obtained through Jets3tProperties
. For more information on
these properties please refer to
JetS3t Configuration
Nested Class Summary | |
---|---|
class |
RestS3Service.HttpMethodAndByteCount
Simple container object to store an HttpMethod object representing a request connection, and a count of the byte size of the S3 object associated with the request. |
Field Summary | |
---|---|
protected org.apache.commons.httpclient.HttpConnectionManager |
connectionManager
|
protected org.apache.commons.httpclient.auth.CredentialsProvider |
credentialsProvider
|
protected org.apache.commons.httpclient.HttpClient |
httpClient
|
static java.lang.String |
VERSION
|
static java.lang.String |
XML_NAMESPACE
|
Fields inherited from class org.jets3t.service.S3Service |
---|
BUCKET_STATUS__ALREADY_CLAIMED, BUCKET_STATUS__DOES_NOT_EXIST, BUCKET_STATUS__MY_BUCKET, jets3tProperties, timeOffset, VERSION_NO__JETS3T_TOOLKIT |
Constructor Summary | |
---|---|
RestS3Service(AWSCredentials awsCredentials)
Constructs the service and initialises the properties. |
|
RestS3Service(AWSCredentials awsCredentials,
java.lang.String invokingApplicationDescription,
org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider)
Constructs the service and initialises the properties. |
|
RestS3Service(AWSCredentials awsCredentials,
java.lang.String invokingApplicationDescription,
org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider,
Jets3tProperties jets3tProperties)
Constructs the service and initialises the properties. |
|
RestS3Service(AWSCredentials awsCredentials,
java.lang.String invokingApplicationDescription,
org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider,
Jets3tProperties jets3tProperties,
org.apache.commons.httpclient.HostConfiguration hostConfig)
Constructs the service and initialises the properties. |
Method Summary | |
---|---|
protected void |
addMetadataToHeaders(org.apache.commons.httpclient.HttpMethodBase httpMethod,
java.util.Map metadata)
Adds all valid metadata name and value pairs as HTTP headers to the given HTTP method. |
protected void |
addRequestHeadersToConnection(org.apache.commons.httpclient.HttpMethodBase httpMethod,
java.util.Map requestHeaders)
Adds the provided request headers to the connection. |
protected java.lang.String |
addRequestParametersToUrlPath(java.lang.String urlPath,
java.util.Map requestParameters)
Adds all the provided request parameters to a URL in GET request format. |
void |
authorizeHttpRequest(org.apache.commons.httpclient.HttpMethod httpMethod)
Authorizes an HTTP request by signing it. |
int |
checkBucketStatus(java.lang.String bucketName)
Find out the status of an S3 bucket with the given name. |
protected java.util.Map |
copyObjectImpl(java.lang.String sourceBucketName,
java.lang.String sourceObjectKey,
java.lang.String destinationBucketName,
java.lang.String destinationObjectKey,
AccessControlList acl,
java.util.Map destinationMetadata,
java.util.Calendar ifModifiedSince,
java.util.Calendar ifUnmodifiedSince,
java.lang.String[] ifMatchTags,
java.lang.String[] ifNoneMatchTags,
java.lang.String versionId)
Copy an object within your S3 account. |
protected S3Bucket |
createBucketImpl(java.lang.String bucketName,
java.lang.String location,
AccessControlList acl)
Creates a bucket. |
protected java.util.Map |
createObjectImpl(java.lang.String bucketName,
java.lang.String objectKey,
java.lang.String contentType,
org.apache.commons.httpclient.methods.RequestEntity requestEntity,
java.util.Map metadata,
AccessControlList acl)
|
protected void |
deleteBucketImpl(java.lang.String bucketName)
|
protected void |
deleteObjectImpl(java.lang.String bucketName,
java.lang.String objectKey,
java.lang.String versionId,
java.lang.String multiFactorSerialNumber,
java.lang.String multiFactorAuthCode)
|
void |
deleteObjectWithSignedUrl(java.lang.String signedDeleteUrl)
Deletes an object using a pre-signed DELETE URL generated for that object. |
protected S3Owner |
getAccountOwnerImpl()
|
protected AccessControlList |
getBucketAclImpl(java.lang.String bucketName)
|
protected java.lang.String |
getBucketLocationImpl(java.lang.String bucketName)
|
protected S3BucketLoggingStatus |
getBucketLoggingStatusImpl(java.lang.String bucketName)
|
protected S3BucketVersioningStatus |
getBucketVersioningStatusImpl(java.lang.String bucketName)
|
org.apache.commons.httpclient.auth.CredentialsProvider |
getCredentialsProvider()
|
org.apache.commons.httpclient.HttpClient |
getHttpClient()
|
org.apache.commons.httpclient.HttpConnectionManager |
getHttpConnectionManager()
|
protected AccessControlList |
getObjectAclImpl(java.lang.String bucketName,
java.lang.String objectKey)
|
protected AccessControlList |
getObjectAclImpl(java.lang.String bucketName,
java.lang.String objectKey,
java.lang.String versionId)
|
AccessControlList |
getObjectAclWithSignedUrl(java.lang.String signedAclUrl)
Gets an object's ACL details using a pre-signed GET URL generated for that object. |
protected S3Object |
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)
|
S3Object |
getObjectDetailsWithSignedUrl(java.lang.String signedHeadUrl)
Gets an object's details using a pre-signed HEAD URL generated for that object. |
protected S3Object |
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)
|
S3Object |
getObjectWithSignedUrl(java.lang.String signedGetUrl)
Gets an object using a pre-signed GET URL generated for that object. |
protected HttpClientAndConnectionManager |
initHttpConnection(org.apache.commons.httpclient.HostConfiguration hostConfig)
Initialise HttpClient and HttpConnectionManager objects with the configuration settings appropriate for communicating with S3. |
boolean |
isBucketAccessible(java.lang.String bucketName)
Indicates whether a bucket exists and is accessible to a service user. |
protected boolean |
isRequesterPaysBucketImpl(java.lang.String bucketName)
|
protected boolean |
isXmlContentType(java.lang.String contentType)
|
protected S3Bucket[] |
listAllBucketsImpl()
|
protected S3ObjectsChunk |
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 S3Object[] |
listObjectsImpl(java.lang.String bucketName,
java.lang.String prefix,
java.lang.String delimiter,
long maxListingLength)
Lists objects in a bucket. |
protected S3ObjectsChunk |
listObjectsInternal(java.lang.String bucketName,
java.lang.String prefix,
java.lang.String delimiter,
long maxListingLength,
boolean automaticallyMergeChunks,
java.lang.String priorLastKey,
java.lang.String priorLastVersion)
|
protected VersionOrDeleteMarkersChunk |
listVersionedObjectsChunkedImpl(java.lang.String bucketName,
java.lang.String prefix,
java.lang.String delimiter,
long maxListingLength,
java.lang.String priorLastKey,
java.lang.String priorLastVersion,
boolean completeListing)
Lists version or delete markers in a versioned bucket, up to the maximum listing length specified. |
protected BaseVersionOrDeleteMarker[] |
listVersionedObjectsImpl(java.lang.String bucketName,
java.lang.String prefix,
java.lang.String delimiter,
java.lang.String keyMarker,
java.lang.String versionMarker,
long maxListingLength)
|
protected VersionOrDeleteMarkersChunk |
listVersionedObjectsInternal(java.lang.String bucketName,
java.lang.String prefix,
java.lang.String delimiter,
long maxListingLength,
boolean automaticallyMergeChunks,
java.lang.String nextKeyMarker,
java.lang.String nextVersionIdMarker)
|
protected void |
performRequest(org.apache.commons.httpclient.HttpMethodBase httpMethod,
int[] expectedResponseCodes)
Performs an HTTP/S request by invoking the provided HttpMethod object. |
protected org.apache.commons.httpclient.HttpMethodBase |
performRestDelete(java.lang.String bucketName,
java.lang.String objectKey,
java.util.Map requestParameters,
java.lang.String multiFactorSerialNumber,
java.lang.String multiFactorAuthCode)
Performs an HTTP DELETE request using the performRequest(org.apache.commons.httpclient.HttpMethodBase, int[]) method. |
protected org.apache.commons.httpclient.HttpMethodBase |
performRestGet(java.lang.String bucketName,
java.lang.String objectKey,
java.util.Map requestParameters,
java.util.Map requestHeaders)
Performs an HTTP GET request using the performRequest(org.apache.commons.httpclient.HttpMethodBase, int[]) method. |
protected org.apache.commons.httpclient.HttpMethodBase |
performRestHead(java.lang.String bucketName,
java.lang.String objectKey,
java.util.Map requestParameters,
java.util.Map requestHeaders)
Performs an HTTP HEAD request using the performRequest(org.apache.commons.httpclient.HttpMethodBase, int[]) method. |
protected RestS3Service.HttpMethodAndByteCount |
performRestPut(java.lang.String bucketName,
java.lang.String objectKey,
java.util.Map metadata,
java.util.Map requestParameters,
org.apache.commons.httpclient.methods.RequestEntity requestEntity,
boolean autoRelease)
Performs an HTTP PUT request using the performRequest(org.apache.commons.httpclient.HttpMethodBase, int[]) method. |
protected RestS3Service.HttpMethodAndByteCount |
performRestPutWithXmlBuilder(java.lang.String bucketName,
java.lang.String objectKey,
java.util.Map metadata,
java.util.Map requestParameters,
com.jamesmurty.utils.XMLBuilder builder)
|
protected void |
putAclImpl(java.lang.String bucketName,
java.lang.String objectKey,
AccessControlList acl,
java.lang.String versionId)
|
protected void |
putBucketAclImpl(java.lang.String bucketName,
AccessControlList acl)
|
protected void |
putObjectAclImpl(java.lang.String bucketName,
java.lang.String objectKey,
AccessControlList acl,
java.lang.String versionId)
|
void |
putObjectAclWithSignedUrl(java.lang.String signedAclUrl,
AccessControlList acl)
Sets an object's ACL details using a pre-signed PUT URL generated for that object. |
protected S3Object |
putObjectImpl(java.lang.String bucketName,
S3Object object)
Beware of high memory requirements when creating large S3 objects when the Content-Length is not set in the object. |
S3Object |
putObjectWithSignedUrl(java.lang.String signedPutUrl,
S3Object object)
Puts an object using a pre-signed PUT URL generated for that object. |
protected void |
setBucketLoggingStatusImpl(java.lang.String bucketName,
S3BucketLoggingStatus status)
|
void |
setCredentialsProvider(org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider)
Sets the credentials provider this service will use to authenticate itself. |
void |
setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
Replaces the service's default HTTP client. |
void |
setHttpConnectionManager(org.apache.commons.httpclient.HttpConnectionManager httpConnectionManager)
Replaces the service's default HTTP connection manager. |
protected void |
setRequesterPaysBucketImpl(java.lang.String bucketName,
boolean requesterPays)
|
protected org.apache.commons.httpclient.HttpMethodBase |
setupConnection(java.lang.String method,
java.lang.String bucketName,
java.lang.String objectKey,
java.util.Map requestParameters)
Creates an HttpMethod object to handle a particular connection method. |
protected void |
shutdownImpl()
Shut down all connections managed by the underlying HttpConnectionManager. |
protected void |
updateBucketVersioningStatusImpl(java.lang.String bucketName,
boolean enabled,
boolean multiFactorAuthDeleteEnabled,
java.lang.String multiFactorSerialNumber,
java.lang.String multiFactorAuthCode)
|
protected void |
verifyExpectedAndActualETagValues(java.lang.String expectedETag,
S3Object uploadedObject)
Compares the expected and actual ETag value for an uploaded object, and throws an S3ServiceException if these values do not match. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION
public static final java.lang.String XML_NAMESPACE
protected org.apache.commons.httpclient.HttpClient httpClient
protected org.apache.commons.httpclient.HttpConnectionManager connectionManager
protected org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider
Constructor Detail |
---|
public RestS3Service(AWSCredentials awsCredentials) throws S3ServiceException
awsCredentials
- the S3 user credentials to use when communicating with S3, may be null in which case the
communication is done as an anonymous user.
S3ServiceException
public RestS3Service(AWSCredentials awsCredentials, java.lang.String invokingApplicationDescription, org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider) throws S3ServiceException
awsCredentials
- the S3 user credentials to use when communicating with S3, 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
credentialsProvider
- an implementation of the HttpClient CredentialsProvider interface, to provide a means for
prompting for credentials when necessary.
S3ServiceException
public RestS3Service(AWSCredentials awsCredentials, java.lang.String invokingApplicationDescription, org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider, Jets3tProperties jets3tProperties) throws S3ServiceException
awsCredentials
- the S3 user credentials to use when communicating with S3, 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
credentialsProvider
- an implementation of the HttpClient CredentialsProvider interface, to provide a means for
prompting for credentials when necessary.jets3tProperties
- JetS3t properties that will be applied within this service.
S3ServiceException
public RestS3Service(AWSCredentials awsCredentials, java.lang.String invokingApplicationDescription, org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider, Jets3tProperties jets3tProperties, org.apache.commons.httpclient.HostConfiguration hostConfig) throws S3ServiceException
awsCredentials
- the S3 user credentials to use when communicating with S3, 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
credentialsProvider
- an implementation of the HttpClient CredentialsProvider interface, to provide a means for
prompting for credentials when necessary.jets3tProperties
- JetS3t properties that will be applied within this service.hostConfig
- Custom HTTP host configuration; e.g to register a custom Protocol Socket Factory
S3ServiceException
Method Detail |
---|
protected void shutdownImpl() throws S3ServiceException
shutdownImpl
in class S3Service
S3ServiceException
protected HttpClientAndConnectionManager initHttpConnection(org.apache.commons.httpclient.HostConfiguration hostConfig)
RestUtils.initHttpConnection(AWSRequestAuthorizer,
HostConfiguration, Jets3tProperties, String, CredentialsProvider)
.
To alter the low-level behaviour of the HttpClient library, override this method in a subclass and apply your own settings before returning the objects.
hostConfig
- Custom HTTP host configuration; e.g to register a custom Protocol Socket Factory
public org.apache.commons.httpclient.HttpConnectionManager getHttpConnectionManager()
public void setHttpConnectionManager(org.apache.commons.httpclient.HttpConnectionManager httpConnectionManager)
httpConnectionManager
- the connection manager that will replace the default manager created by
the class constructor.public org.apache.commons.httpclient.HttpClient getHttpClient()
public void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
httpClient
- the client that will replace the default client created by
the class constructor.public org.apache.commons.httpclient.auth.CredentialsProvider getCredentialsProvider()
public void setCredentialsProvider(org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider)
initHttpConnection(HostConfiguration)
method
is called.
credentialsProvider
- protected boolean isXmlContentType(java.lang.String contentType)
contentType
-
protected void performRequest(org.apache.commons.httpclient.HttpMethodBase httpMethod, int[] expectedResponseCodes) throws S3ServiceException
httpMethod
- the object containing a request target and all other information necessary to perform the
requestexpectedResponseCodes
- the HTTP response code(s) that indicates a successful request. If the response code received
does not match this value an error must have occurred, so an exception is thrown.
S3ServiceException
- all exceptions are wrapped in an S3ServiceException. Depending on the kind of error that
occurred, this exception may contain additional error information available from an XML
error response document.public void authorizeHttpRequest(org.apache.commons.httpclient.HttpMethod httpMethod) throws java.lang.Exception
HttpMethod
object as an Authorization header.
authorizeHttpRequest
in interface AWSRequestAuthorizer
httpMethod
- the request object
S3ServiceException
java.lang.Exception
protected java.lang.String addRequestParametersToUrlPath(java.lang.String urlPath, java.util.Map requestParameters) throws S3ServiceException
urlPath
- the target URLrequestParameters
- the parameters to add to the URL as GET request params.
S3ServiceException
protected void addRequestHeadersToConnection(org.apache.commons.httpclient.HttpMethodBase httpMethod, java.util.Map requestHeaders)
httpMethod
- the connection objectrequestHeaders
- the request headers to add as name/value pairs.protected void addMetadataToHeaders(org.apache.commons.httpclient.HttpMethodBase httpMethod, java.util.Map metadata) throws S3ServiceException
The metadata values are verified to ensure that keys contain only ASCII characters,
and that items are not accidentally duplicated due to use of different capitalization.
If either of these verification tests fails, an S3ServiceException
is thrown.
httpMethod
- metadata
-
S3ServiceException
protected void verifyExpectedAndActualETagValues(java.lang.String expectedETag, S3Object uploadedObject) throws S3ServiceException
expectedETag
- uploadedObject
-
S3ServiceException
protected org.apache.commons.httpclient.HttpMethodBase performRestHead(java.lang.String bucketName, java.lang.String objectKey, java.util.Map requestParameters, java.util.Map requestHeaders) throws S3ServiceException
performRequest(org.apache.commons.httpclient.HttpMethodBase, int[])
method.
bucketName
- the bucket's nameobjectKey
- the object's key name, may be null if the operation is on a bucket only.requestParameters
- parameters to add to the request URL as GET paramsrequestHeaders
- headers to add to the request
S3ServiceException
protected org.apache.commons.httpclient.HttpMethodBase performRestGet(java.lang.String bucketName, java.lang.String objectKey, java.util.Map requestParameters, java.util.Map requestHeaders) throws S3ServiceException
performRequest(org.apache.commons.httpclient.HttpMethodBase, int[])
method.
bucketName
- the bucket's nameobjectKey
- the object's key name, may be null if the operation is on a bucket only.requestParameters
- parameters to add to the request URL as GET paramsrequestHeaders
- headers to add to the request
S3ServiceException
protected RestS3Service.HttpMethodAndByteCount performRestPut(java.lang.String bucketName, java.lang.String objectKey, java.util.Map metadata, java.util.Map requestParameters, org.apache.commons.httpclient.methods.RequestEntity requestEntity, boolean autoRelease) throws S3ServiceException
performRequest(org.apache.commons.httpclient.HttpMethodBase, int[])
method.
bucketName
- the name of the bucket the object will be stored in.objectKey
- the key (name) of the object to be stored.metadata
- map of name/value pairs to add as metadata to any S3 objects created.requestParameters
- parameters to add to the request URL as GET paramsrequestEntity
- an HttpClient object that encapsulates the object and data contents that will be
uploaded. This object supports the resending of object data, when possible.autoRelease
- if true, the HTTP Method object will be released after the request has
completed and the connection will be closed. If false, the object will
not be released and the caller must take responsibility for doing this.
S3ServiceException
protected org.apache.commons.httpclient.HttpMethodBase performRestDelete(java.lang.String bucketName, java.lang.String objectKey, java.util.Map requestParameters, java.lang.String multiFactorSerialNumber, java.lang.String multiFactorAuthCode) throws S3ServiceException
performRequest(org.apache.commons.httpclient.HttpMethodBase, int[])
method.
bucketName
- the bucket's nameobjectKey
- the object's key name, may be null if the operation is on a bucket only.
S3ServiceException
protected RestS3Service.HttpMethodAndByteCount performRestPutWithXmlBuilder(java.lang.String bucketName, java.lang.String objectKey, java.util.Map metadata, java.util.Map requestParameters, com.jamesmurty.utils.XMLBuilder builder) throws S3ServiceException
S3ServiceException
protected org.apache.commons.httpclient.HttpMethodBase setupConnection(java.lang.String method, java.lang.String bucketName, java.lang.String objectKey, java.util.Map requestParameters) throws S3ServiceException
HttpMethod
object to handle a particular connection method.
method
- the HTTP method/connection-type to use, must be one of: PUT, HEAD, GET, DELETEbucketName
- the bucket's nameobjectKey
- the object's key name, may be null if the operation is on a bucket only.
S3ServiceException
public boolean isBucketAccessible(java.lang.String bucketName) throws S3ServiceException
S3Service
S3Service.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.
isBucketAccessible
in class S3Service
S3ServiceException
public int checkBucketStatus(java.lang.String bucketName) throws S3ServiceException
S3Service
RestS3Service
client.
Warning! S3 can act strangely when you use this method in some circumstances. If you check the status of a bucket and find that it does not exist, then create the bucket, S3 will continue to tell you the bucket does not exists for up to 30 seconds. This problem has something to do with connection caching (I think).
This S3 quirk makes it a bad idea to use this method to check for a bucket's
existence before creating that bucket. Use the S3Service.getOrCreateBucket(String)
method for this purpose instead.
checkBucketStatus
in class S3Service
S3Service.BUCKET_STATUS__MY_BUCKET
if you already own the bucket,
S3Service.BUCKET_STATUS__DOES_NOT_EXIST
if the bucket does not yet exist
in S3, or S3Service.BUCKET_STATUS__ALREADY_CLAIMED
if someone else has
already created a bucket with the given name.
S3ServiceException
protected S3Bucket[] listAllBucketsImpl() throws S3ServiceException
listAllBucketsImpl
in class S3Service
S3ServiceException
protected S3Owner getAccountOwnerImpl() throws S3ServiceException
getAccountOwnerImpl
in class S3Service
S3ServiceException
protected S3Object[] listObjectsImpl(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength) throws S3ServiceException
S3Service
The implementation of this method is expected to return all the objects
in a bucket, not a subset. This may require repeating the S3 list operation if the
first one doesn't include all the available objects, such as when the number of objects
is greater than maxListingLength
.
listObjectsImpl
in class S3Service
S3ServiceException
protected BaseVersionOrDeleteMarker[] listVersionedObjectsImpl(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, java.lang.String keyMarker, java.lang.String versionMarker, long maxListingLength) throws S3ServiceException
listVersionedObjectsImpl
in class S3Service
S3ServiceException
protected S3ObjectsChunk listObjectsChunkedImpl(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength, java.lang.String priorLastKey, boolean completeListing) throws S3ServiceException
S3Service
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.
listObjectsChunkedImpl
in class S3Service
S3ServiceException
protected VersionOrDeleteMarkersChunk listVersionedObjectsChunkedImpl(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength, java.lang.String priorLastKey, java.lang.String priorLastVersion, boolean completeListing) throws S3ServiceException
S3Service
Implementation notes The implementation of this method returns only as many items 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.
listVersionedObjectsChunkedImpl
in class S3Service
S3ServiceException
protected S3ObjectsChunk listObjectsInternal(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength, boolean automaticallyMergeChunks, java.lang.String priorLastKey, java.lang.String priorLastVersion) throws S3ServiceException
S3ServiceException
protected VersionOrDeleteMarkersChunk listVersionedObjectsInternal(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength, boolean automaticallyMergeChunks, java.lang.String nextKeyMarker, java.lang.String nextVersionIdMarker) throws S3ServiceException
S3ServiceException
protected void deleteObjectImpl(java.lang.String bucketName, java.lang.String objectKey, java.lang.String versionId, java.lang.String multiFactorSerialNumber, java.lang.String multiFactorAuthCode) throws S3ServiceException
deleteObjectImpl
in class S3Service
S3ServiceException
protected AccessControlList getObjectAclImpl(java.lang.String bucketName, java.lang.String objectKey) throws S3ServiceException
S3ServiceException
protected AccessControlList getObjectAclImpl(java.lang.String bucketName, java.lang.String objectKey, java.lang.String versionId) throws S3ServiceException
getObjectAclImpl
in class S3Service
S3ServiceException
protected AccessControlList getBucketAclImpl(java.lang.String bucketName) throws S3ServiceException
getBucketAclImpl
in class S3Service
S3ServiceException
protected void putObjectAclImpl(java.lang.String bucketName, java.lang.String objectKey, AccessControlList acl, java.lang.String versionId) throws S3ServiceException
putObjectAclImpl
in class S3Service
S3ServiceException
protected void putBucketAclImpl(java.lang.String bucketName, AccessControlList acl) throws S3ServiceException
putBucketAclImpl
in class S3Service
S3ServiceException
protected void putAclImpl(java.lang.String bucketName, java.lang.String objectKey, AccessControlList acl, java.lang.String versionId) throws S3ServiceException
S3ServiceException
protected S3Bucket createBucketImpl(java.lang.String bucketName, java.lang.String location, AccessControlList acl) throws S3ServiceException
S3Service
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.
createBucketImpl
in class S3Service
bucketName
- the name of the bucket to create.location
- the geographical location where the bucket will be stored (see S3Bucket.getLocation()
.
A null string value will cause the bucket to be stored in the default S3 location: US.acl
- an access control object representing the initial acl values for the bucket.
May be null, in which case the default permissions are applied.
S3ServiceException
protected void deleteBucketImpl(java.lang.String bucketName) throws S3ServiceException
deleteBucketImpl
in class S3Service
S3ServiceException
protected void updateBucketVersioningStatusImpl(java.lang.String bucketName, boolean enabled, boolean multiFactorAuthDeleteEnabled, java.lang.String multiFactorSerialNumber, java.lang.String multiFactorAuthCode) throws S3ServiceException
updateBucketVersioningStatusImpl
in class S3Service
S3ServiceException
protected S3BucketVersioningStatus getBucketVersioningStatusImpl(java.lang.String bucketName) throws S3ServiceException
getBucketVersioningStatusImpl
in class S3Service
S3ServiceException
protected S3Object putObjectImpl(java.lang.String bucketName, S3Object object) throws S3ServiceException
putObjectImpl
in class S3Service
S3ServiceException
protected java.util.Map createObjectImpl(java.lang.String bucketName, java.lang.String objectKey, java.lang.String contentType, org.apache.commons.httpclient.methods.RequestEntity requestEntity, java.util.Map metadata, AccessControlList acl) throws S3ServiceException
S3ServiceException
protected java.util.Map copyObjectImpl(java.lang.String sourceBucketName, java.lang.String sourceObjectKey, java.lang.String destinationBucketName, java.lang.String destinationObjectKey, AccessControlList acl, java.util.Map destinationMetadata, java.util.Calendar ifModifiedSince, java.util.Calendar ifUnmodifiedSince, java.lang.String[] ifMatchTags, java.lang.String[] ifNoneMatchTags, java.lang.String versionId) throws S3ServiceException
S3Service
copyObjectImpl
in class S3Service
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.
S3ServiceException
protected S3Object 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 S3ServiceException
getObjectDetailsImpl
in class S3Service
S3ServiceException
protected S3Object 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 S3ServiceException
getObjectImpl
in class S3Service
S3ServiceException
protected java.lang.String getBucketLocationImpl(java.lang.String bucketName) throws S3ServiceException
getBucketLocationImpl
in class S3Service
S3ServiceException
protected S3BucketLoggingStatus getBucketLoggingStatusImpl(java.lang.String bucketName) throws S3ServiceException
getBucketLoggingStatusImpl
in class S3Service
S3ServiceException
protected void setBucketLoggingStatusImpl(java.lang.String bucketName, S3BucketLoggingStatus status) throws S3ServiceException
setBucketLoggingStatusImpl
in class S3Service
S3ServiceException
protected boolean isRequesterPaysBucketImpl(java.lang.String bucketName) throws S3ServiceException
isRequesterPaysBucketImpl
in class S3Service
S3ServiceException
protected void setRequesterPaysBucketImpl(java.lang.String bucketName, boolean requesterPays) throws S3ServiceException
setRequesterPaysBucketImpl
in class S3Service
S3ServiceException
public S3Object putObjectWithSignedUrl(java.lang.String signedPutUrl, S3Object object) throws S3ServiceException
SignedUrlHandler
.
This operation does not required any S3 functionality as it merely uploads the object by performing a standard HTTP PUT using the signed URL.
putObjectWithSignedUrl
in interface SignedUrlHandler
signedPutUrl
- a signed PUT URL generated with
S3Service.createSignedPutUrl(String, String, Map, AWSCredentials, Date)
.object
- the object to upload, which must correspond to the object for which the URL was signed.
The object must have the correct content length set, and to apply a non-standard
ACL policy only the REST canned ACLs can be used
(eg AccessControlList.REST_CANNED_PUBLIC_READ_WRITE
).
S3ServiceException
public void deleteObjectWithSignedUrl(java.lang.String signedDeleteUrl) throws S3ServiceException
SignedUrlHandler
.
This operation does not required any S3 functionality as it merely deletes the object by performing a standard HTTP DELETE using the signed URL.
deleteObjectWithSignedUrl
in interface SignedUrlHandler
signedDeleteUrl
- a signed DELETE URL generated with S3Service.createSignedDeleteUrl(java.lang.String, java.lang.String, org.jets3t.service.security.AWSCredentials, java.util.Date, boolean)
.
S3ServiceException
public S3Object getObjectWithSignedUrl(java.lang.String signedGetUrl) throws S3ServiceException
SignedUrlHandler
.
This operation does not required any S3 functionality as it merely uploads the object by performing a standard HTTP GET using the signed URL.
getObjectWithSignedUrl
in interface SignedUrlHandler
signedGetUrl
- a signed GET URL generated with
S3Service.createSignedGetUrl(String, String, AWSCredentials, Date)
.
S3ServiceException
public S3Object getObjectDetailsWithSignedUrl(java.lang.String signedHeadUrl) throws S3ServiceException
SignedUrlHandler
.
This operation does not required any S3 functionality as it merely uploads the object by performing a standard HTTP HEAD using the signed URL.
getObjectDetailsWithSignedUrl
in interface SignedUrlHandler
signedHeadUrl
- a signed HEAD URL generated with
S3Service.createSignedHeadUrl(String, String, AWSCredentials, Date)
.
S3ServiceException
public AccessControlList getObjectAclWithSignedUrl(java.lang.String signedAclUrl) throws S3ServiceException
SignedUrlHandler
.
getObjectAclWithSignedUrl
in interface SignedUrlHandler
signedAclUrl
- a signed URL generated with S3Service.createSignedUrl(String, String, String, String, Map, AWSCredentials, long, boolean)
.
S3ServiceException
public void putObjectAclWithSignedUrl(java.lang.String signedAclUrl, AccessControlList acl) throws S3ServiceException
SignedUrlHandler
.
putObjectAclWithSignedUrl
in interface SignedUrlHandler
signedAclUrl
- a signed URL generated with S3Service.createSignedUrl(String, String, String, String, Map, AWSCredentials, long, boolean)
.acl
- the ACL settings to apply to the object represented by the signed URL.
S3ServiceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |