|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jets3t.service.multi.SimpleThreadedStorageService
public class SimpleThreadedStorageService
S3 service wrapper that performs multiple S3 requests at a time using multi-threading and an
underlying thread-safe StorageService
implementation.
This class provides a simplified interface to the ThreadedStorageService
service.
It will block while doing its work, return the results of an operation when it is finished,
and throw an exception if anything goes wrong.
For a non-blocking multi-threading service that is more powerful, but also more complicated,
see ThreadedStorageService
.
Constructor Summary | |
---|---|
SimpleThreadedStorageService(StorageService service)
Construct a multi-threaded service based on a StorageService. |
Method Summary | |
---|---|
Map[] |
copyObjects(String sourceBucketName,
String destinationBucketName,
String[] sourceObjectKeys,
StorageObject[] destinationObjects,
boolean replaceMetadata)
Copies multiple objects within or between buckets. |
StorageBucket[] |
createBuckets(String[] bucketNames)
Creates multiple buckets. |
void |
deleteObjects(String bucketName,
StorageObject[] objects)
Deletes multiple objects |
void |
downloadObjects(String bucketName,
DownloadPackage[] downloadPackages)
A convenience method to download multiple objects from S3 to pre-existing output streams, which is particularly useful for downloading objects to files. |
StorageObject[] |
getObjectACLs(String bucketName,
StorageObject[] objects)
Retrieves Access Control List (ACL) settings for multiple objects. |
StorageObject[] |
getObjects(String bucketName,
StorageObject[] objects)
Retrieves multiple objects (including details and data). |
StorageObject[] |
getObjects(String bucketName,
String[] objectKeys)
Retrieves multiple objects (including details and data). |
StorageObject[] |
getObjectsHeads(String bucketName,
StorageObject[] objects)
Retrieves details of multiple objects (details only, no data) |
StorageObject[] |
getObjectsHeads(String bucketName,
String[] objectKeys)
Retrieves details of multiple objects (details only, no data) |
StorageObject[] |
putACLs(String bucketName,
StorageObject[] objects)
Updates/sets Access Control List (ACL) settings for multiple objects. |
StorageObject[] |
putObjects(String bucketName,
StorageObject[] objects)
Creates/uploads multiple objects. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleThreadedStorageService(StorageService service)
service
- a StorageService implementation that will be used to perform S3 requests.Method Detail |
---|
public StorageBucket[] createBuckets(String[] bucketNames) throws ServiceException
bucketNames
- name of the buckets to create.
ServiceException
public StorageObject[] putObjects(String bucketName, StorageObject[] objects) throws ServiceException
bucketName
- the bucket where objects will be stored.objects
- the objects to create/upload.
ServiceException
public Map[] copyObjects(String sourceBucketName, String destinationBucketName, String[] sourceObjectKeys, StorageObject[] destinationObjects, boolean replaceMetadata) throws ServiceException
sourceBucketName
- the name of the bucket containing the objects that will be copied.destinationBucketName
- the name of the bucket to which the objects will be copied. The destination
bucket may be the same as the source bucket.sourceObjectKeys
- the key names of the objects that will be copied.destinationObjects
- objects that will be created by the copy operation. The AccessControlList
setting of each object will determine the access permissions of the
resultant object, and if the replaceMetadata flag is true the metadata
items in each object will also be applied to the resultant object.replaceMetadata
- if true, the metadata items in the destination objects will be stored
in S3 by using the REPLACE metadata copying option. If false, the metadata
items will be copied unchanged from the original objects using the COPY
metadata copying option.s
ServiceException
public void deleteObjects(String bucketName, StorageObject[] objects) throws ServiceException
bucketName
- name of the bucket containing the objects to delete.objects
- the objects to delete.
ServiceException
public StorageObject[] getObjects(String bucketName, StorageObject[] objects) throws ServiceException
StorageObject.getDataInputStream()
.
bucketName
- name of the bucket containing the objects.objects
- the objects to retrieve.
ServiceException
public StorageObject[] getObjects(String bucketName, String[] objectKeys) throws ServiceException
StorageObject.getDataInputStream()
.
bucketName
- name of the bucket containing the objects.objectKeys
- the key names of the objects to retrieve.
ServiceException
public StorageObject[] getObjectsHeads(String bucketName, StorageObject[] objects) throws ServiceException
bucketName
- name of the bucket containing the objects.objects
- the objects to retrieve.
ServiceException
public StorageObject[] getObjectsHeads(String bucketName, String[] objectKeys) throws ServiceException
bucketName
- name of the bucket containing the objects.objectKeys
- the key names of the objects to retrieve.
ServiceException
public StorageObject[] getObjectACLs(String bucketName, StorageObject[] objects) throws ServiceException
bucketName
- name of the bucket containing the objects.objects
- the objects whose ACLs will be retrieved.
ServiceException
public StorageObject[] putACLs(String bucketName, StorageObject[] objects) throws ServiceException
bucketName
- name of the bucket containing the objects.objects
- objects containing ACL settings that will be updated/set.
ServiceException
public void downloadObjects(String bucketName, DownloadPackage[] downloadPackages) throws ServiceException
bucketName
- name of the bucket containing the objectsdownloadPackages
- an array of download package objects that manage the output of data for an object.
ServiceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |