|
|||||||||
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.soap.axis.SoapS3Service
public class SoapS3Service
SOAP implementation of an S3Service based on the Apache Axis 1.4 library.
Note: This SOAP implementation does not support IO streaming uploads to S3. Any documents uploaded by this implementation must fit inside memory allocated to the Java program running this class if OutOfMemory errors are to be avoided.
Note 2: The SOAP implementation does not perform retries when communication with s3 fails.
The preferred S3Service implementation in JetS3t is
RestS3Service
. This SOAP
implementation class is provided with JetS3t as a proof-of-concept, showing that alternative
service implementations are possible and what a SOAP service might look like. We do not
recommend that this service be used to perform any real work.
Field Summary |
---|
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 | |
---|---|
SoapS3Service(AWSCredentials awsCredentials)
Constructs the SOAP service implementation and, based on the value of S3Service.isHttpsOnly
sets the SOAP endpoint to use HTTP or HTTPS protocols. |
|
SoapS3Service(AWSCredentials awsCredentials,
java.lang.String invokingApplicationDescription)
Constructs the SOAP service implementation and, based on the value of S3Service.isHttpsOnly
sets the SOAP endpoint to use HTTP or HTTPS protocols. |
|
SoapS3Service(AWSCredentials awsCredentials,
java.lang.String invokingApplicationDescription,
Jets3tProperties jets3tProperties)
Constructs the SOAP service implementation and, based on the value of S3Service.isHttpsOnly
sets the SOAP endpoint to use HTTP or HTTPS protocols. |
Method Summary | |
---|---|
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 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)
|
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)
|
protected AccessControlList |
getObjectAclImpl(java.lang.String bucketName,
java.lang.String objectKey,
java.lang.String versionId)
|
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)
|
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)
|
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 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 |
listObjectsInternalImpl(java.lang.String bucketName,
java.lang.String prefix,
java.lang.String delimiter,
long maxListingLength,
boolean automaticallyMergeChunks,
java.lang.String priorLastKey)
|
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 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)
|
protected S3Object |
putObjectImpl(java.lang.String bucketName,
S3Object object)
|
protected void |
setBucketLoggingStatusImpl(java.lang.String bucketName,
S3BucketLoggingStatus status)
|
protected void |
setRequesterPaysBucketImpl(java.lang.String bucketName,
boolean requesterPays)
|
protected void |
shutdownImpl()
|
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 |
Constructor Detail |
---|
public SoapS3Service(AWSCredentials awsCredentials, java.lang.String invokingApplicationDescription, Jets3tProperties jets3tProperties) throws S3ServiceException
S3Service.isHttpsOnly
sets the SOAP endpoint to use HTTP or HTTPS protocols.
awsCredentials
- 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.
S3ServiceException
public SoapS3Service(AWSCredentials awsCredentials, java.lang.String invokingApplicationDescription) throws S3ServiceException
S3Service.isHttpsOnly
sets the SOAP endpoint to use HTTP or HTTPS protocols.
awsCredentials
- 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
S3ServiceException
public SoapS3Service(AWSCredentials awsCredentials) throws S3ServiceException
S3Service.isHttpsOnly
sets the SOAP endpoint to use HTTP or HTTPS protocols.
awsCredentials
-
S3ServiceException
Method Detail |
---|
protected void shutdownImpl() throws S3ServiceException
shutdownImpl
in class S3Service
S3ServiceException
protected S3Bucket[] listAllBucketsImpl() throws S3ServiceException
listAllBucketsImpl
in class S3Service
S3ServiceException
protected S3Owner getAccountOwnerImpl() throws S3ServiceException
getAccountOwnerImpl
in class S3Service
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 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 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 S3ObjectsChunk listObjectsInternalImpl(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter, long maxListingLength, boolean automaticallyMergeChunks, java.lang.String priorLastKey) 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 java.lang.String getBucketLocationImpl(java.lang.String bucketName) throws S3ServiceException
getBucketLocationImpl
in class S3Service
S3ServiceException
protected void deleteBucketImpl(java.lang.String bucketName) throws S3ServiceException
deleteBucketImpl
in class S3Service
S3ServiceException
protected S3Object putObjectImpl(java.lang.String bucketName, S3Object object) throws S3ServiceException
putObjectImpl
in class S3Service
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 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 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 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 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
protected S3BucketVersioningStatus getBucketVersioningStatusImpl(java.lang.String bucketName) throws S3ServiceException
getBucketVersioningStatusImpl
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 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |