|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jets3t.service.StorageService
org.jets3t.service.impl.rest.httpclient.RestStorageService
org.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 |
---|
Nested classes/interfaces inherited from class org.jets3t.service.impl.rest.httpclient.RestStorageService |
---|
RestStorageService.HTTP_METHOD |
Field Summary |
---|
Fields inherited from class org.jets3t.service.impl.rest.httpclient.RestStorageService |
---|
connectionManager, credentialsProvider, defaultStorageClass, httpClient |
Fields inherited from class org.jets3t.service.StorageService |
---|
BUCKET_STATUS__ALREADY_CLAIMED, BUCKET_STATUS__DOES_NOT_EXIST, BUCKET_STATUS__MY_BUCKET, credentials, jets3tProperties, timeOffset |
Constructor Summary | |
---|---|
RestS3Service(ProviderCredentials credentials)
Constructs the service and initialises the properties. |
|
RestS3Service(ProviderCredentials credentials,
java.lang.String invokingApplicationDescription,
org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider)
Constructs the service and initialises the properties. |
|
RestS3Service(ProviderCredentials credentials,
java.lang.String invokingApplicationDescription,
org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider,
Jets3tProperties jets3tProperties)
Constructs the service and initialises the properties. |
|
RestS3Service(ProviderCredentials credentials,
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 |
deleteBucketPolicyImpl(java.lang.String bucketName)
|
protected void |
deleteWebsiteConfigImpl(java.lang.String bucketName)
|
protected java.lang.String |
getBucketLocationImpl(java.lang.String bucketName)
|
protected S3BucketLoggingStatus |
getBucketLoggingStatusImpl(java.lang.String bucketName)
|
protected java.lang.String |
getBucketPolicyImpl(java.lang.String bucketName)
|
protected S3BucketVersioningStatus |
getBucketVersioningStatusImpl(java.lang.String bucketName)
|
java.lang.String |
getDevPayProductToken()
|
java.lang.String |
getDevPayUserToken()
|
protected boolean |
getDisableDnsBuckets()
|
protected boolean |
getEnableStorageClasses()
|
java.lang.String |
getEndpoint()
|
protected int |
getHttpPort()
|
protected boolean |
getHttpsOnly()
|
protected int |
getHttpsPort()
|
protected NotificationConfig |
getNotificationConfigImpl(java.lang.String bucketName)
|
java.util.List<java.lang.String> |
getResourceParameterNames()
|
java.lang.String |
getRestHeaderPrefix()
|
java.lang.String |
getRestMetadataPrefix()
|
protected java.lang.String |
getSignatureIdentifier()
|
protected java.lang.String |
getVirtualPath()
|
protected WebsiteConfig |
getWebsiteConfigImpl(java.lang.String bucketName)
|
protected boolean |
isRequesterPaysBucketImpl(java.lang.String bucketName)
|
boolean |
isRequesterPaysEnabled()
Is this service configured to generate Requester Pays requests when uploading data to S3, or retrieving data from the service. |
protected boolean |
isTargettingGoogleStorageService()
|
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 |
multipartAbortUploadImpl(java.lang.String uploadId,
java.lang.String bucketName,
java.lang.String objectKey)
|
protected MultipartCompleted |
multipartCompleteUploadImpl(java.lang.String uploadId,
java.lang.String bucketName,
java.lang.String objectKey,
java.util.List<MultipartPart> parts)
|
protected java.util.List<MultipartPart> |
multipartListPartsImpl(java.lang.String uploadId,
java.lang.String bucketName,
java.lang.String objectKey)
|
protected java.util.List<MultipartUpload> |
multipartListUploadsImpl(java.lang.String bucketName,
java.lang.String nextKeyMarker,
java.lang.String nextUploadIdMarker,
java.lang.Integer maxUploads)
|
protected MultipartUpload |
multipartStartUploadImpl(java.lang.String bucketName,
java.lang.String objectKey,
java.util.Map<java.lang.String,java.lang.Object> metadataProvided,
AccessControlList acl,
java.lang.String storageClass)
|
protected MultipartPart |
multipartUploadPartImpl(java.lang.String uploadId,
java.lang.String bucketName,
java.lang.Integer partNumber,
S3Object object)
|
protected void |
setBucketLoggingStatusImpl(java.lang.String bucketName,
S3BucketLoggingStatus status)
|
protected void |
setBucketPolicyImpl(java.lang.String bucketName,
java.lang.String policyDocument)
|
void |
setDevPayProductToken(java.lang.String productToken)
Set the Product Token value to use for requests to a DevPay S3 account. |
void |
setDevPayUserToken(java.lang.String userToken)
Set the User Token value to use for requests to a DevPay S3 account. |
protected void |
setNotificationConfigImpl(java.lang.String bucketName,
NotificationConfig config)
|
protected void |
setRequesterPaysBucketImpl(java.lang.String bucketName,
boolean requesterPays)
|
void |
setRequesterPaysEnabled(boolean isRequesterPays)
Instruct the service whether to generate Requester Pays requests when uploading data to S3, or retrieving data from the service. |
protected org.apache.commons.httpclient.HttpMethodBase |
setupConnection(RestStorageService.HTTP_METHOD method,
java.lang.String bucketName,
java.lang.String objectKey,
java.util.Map<java.lang.String,java.lang.String> requestParameters)
Creates an HttpMethod object to handle a particular connection method. |
protected void |
setWebsiteConfigImpl(java.lang.String bucketName,
WebsiteConfig config)
|
protected void |
updateBucketVersioningStatusImpl(java.lang.String bucketName,
boolean enabled,
boolean multiFactorAuthDeleteEnabled,
java.lang.String multiFactorSerialNumber,
java.lang.String multiFactorAuthCode)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jets3t.service.utils.signedurl.SignedUrlHandler |
---|
deleteObjectWithSignedUrl, getObjectAclWithSignedUrl, getObjectDetailsWithSignedUrl, getObjectWithSignedUrl, putObjectAclWithSignedUrl, putObjectWithSignedUrl |
Constructor Detail |
---|
public RestS3Service(ProviderCredentials credentials) throws S3ServiceException
credentials
- the 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(ProviderCredentials credentials, java.lang.String invokingApplicationDescription, org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider) throws S3ServiceException
credentials
- 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(ProviderCredentials credentials, java.lang.String invokingApplicationDescription, org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider, Jets3tProperties jets3tProperties) throws S3ServiceException
credentials
- 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(ProviderCredentials credentials, java.lang.String invokingApplicationDescription, org.apache.commons.httpclient.auth.CredentialsProvider credentialsProvider, Jets3tProperties jets3tProperties, org.apache.commons.httpclient.HostConfiguration hostConfig) throws S3ServiceException
credentials
- 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 boolean isTargettingGoogleStorageService()
isTargettingGoogleStorageService
in class RestStorageService
public void setDevPayUserToken(java.lang.String userToken)
userToken
- the user token value provided by the AWS DevPay activation service.public java.lang.String getDevPayUserToken()
public void setDevPayProductToken(java.lang.String productToken)
productToken
- the token that identifies your DevPay product.public java.lang.String getDevPayProductToken()
public void setRequesterPaysEnabled(boolean isRequesterPays)
httpclient.requester-pays-buckets-enabled
.
isRequesterPays
- if true, all subsequent S3 service requests will include the Requester
Pays flag.public boolean isRequesterPaysEnabled()
httpclient.requester-pays-buckets-enabled
.
protected org.apache.commons.httpclient.HttpMethodBase setupConnection(RestStorageService.HTTP_METHOD method, java.lang.String bucketName, java.lang.String objectKey, java.util.Map<java.lang.String,java.lang.String> requestParameters) throws S3ServiceException
HttpMethod
object to handle a particular connection method.
setupConnection
in class RestStorageService
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 java.lang.String getEndpoint()
getEndpoint
in class StorageService
protected java.lang.String getVirtualPath()
getVirtualPath
in class StorageService
protected java.lang.String getSignatureIdentifier()
getSignatureIdentifier
in class StorageService
public java.lang.String getRestHeaderPrefix()
getRestHeaderPrefix
in class StorageService
public java.util.List<java.lang.String> getResourceParameterNames()
getResourceParameterNames
in class StorageService
public java.lang.String getRestMetadataPrefix()
getRestMetadataPrefix
in class StorageService
protected int getHttpPort()
getHttpPort
in class StorageService
protected int getHttpsPort()
getHttpsPort
in class StorageService
protected boolean getHttpsOnly()
getHttpsOnly
in class StorageService
protected boolean getDisableDnsBuckets()
getDisableDnsBuckets
in class StorageService
protected boolean getEnableStorageClasses()
getEnableStorageClasses
in class StorageService
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 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 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 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
delimiter
- only list objects with key names up to this delimiter, may be null.
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 java.lang.String getBucketPolicyImpl(java.lang.String bucketName) throws S3ServiceException
getBucketPolicyImpl
in class S3Service
S3ServiceException
protected void setBucketPolicyImpl(java.lang.String bucketName, java.lang.String policyDocument) throws S3ServiceException
setBucketPolicyImpl
in class S3Service
S3ServiceException
protected void deleteBucketPolicyImpl(java.lang.String bucketName) throws S3ServiceException
deleteBucketPolicyImpl
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
protected MultipartUpload multipartStartUploadImpl(java.lang.String bucketName, java.lang.String objectKey, java.util.Map<java.lang.String,java.lang.Object> metadataProvided, AccessControlList acl, java.lang.String storageClass) throws S3ServiceException
multipartStartUploadImpl
in class S3Service
S3ServiceException
protected MultipartPart multipartUploadPartImpl(java.lang.String uploadId, java.lang.String bucketName, java.lang.Integer partNumber, S3Object object) throws S3ServiceException
multipartUploadPartImpl
in class S3Service
S3ServiceException
protected void multipartAbortUploadImpl(java.lang.String uploadId, java.lang.String bucketName, java.lang.String objectKey) throws S3ServiceException
multipartAbortUploadImpl
in class S3Service
S3ServiceException
protected MultipartCompleted multipartCompleteUploadImpl(java.lang.String uploadId, java.lang.String bucketName, java.lang.String objectKey, java.util.List<MultipartPart> parts) throws S3ServiceException
multipartCompleteUploadImpl
in class S3Service
S3ServiceException
protected java.util.List<MultipartUpload> multipartListUploadsImpl(java.lang.String bucketName, java.lang.String nextKeyMarker, java.lang.String nextUploadIdMarker, java.lang.Integer maxUploads) throws S3ServiceException
multipartListUploadsImpl
in class S3Service
S3ServiceException
protected java.util.List<MultipartPart> multipartListPartsImpl(java.lang.String uploadId, java.lang.String bucketName, java.lang.String objectKey) throws S3ServiceException
multipartListPartsImpl
in class S3Service
S3ServiceException
protected WebsiteConfig getWebsiteConfigImpl(java.lang.String bucketName) throws S3ServiceException
getWebsiteConfigImpl
in class S3Service
S3ServiceException
protected void setWebsiteConfigImpl(java.lang.String bucketName, WebsiteConfig config) throws S3ServiceException
setWebsiteConfigImpl
in class S3Service
S3ServiceException
protected void deleteWebsiteConfigImpl(java.lang.String bucketName) throws S3ServiceException
deleteWebsiteConfigImpl
in class S3Service
S3ServiceException
protected NotificationConfig getNotificationConfigImpl(java.lang.String bucketName) throws S3ServiceException
getNotificationConfigImpl
in class S3Service
S3ServiceException
protected void setNotificationConfigImpl(java.lang.String bucketName, NotificationConfig config) throws S3ServiceException
setNotificationConfigImpl
in class S3Service
S3ServiceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |