public abstract class Ds3ClientHelpers
extends java.lang.Object
Ds3Client
which automates common tasks.Modifier and Type | Class and Description |
---|---|
static interface |
Ds3ClientHelpers.Job
Represents a bulk job operation.
|
static interface |
Ds3ClientHelpers.MetadataAccess |
static interface |
Ds3ClientHelpers.ObjectChannelBuilder |
Constructor and Description |
---|
Ds3ClientHelpers() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Iterable<Ds3Object> |
addPrefixToDs3ObjectsList(java.lang.Iterable<Ds3Object> objectsList,
java.lang.String prefix) |
abstract void |
ensureBucketExists(java.lang.String bucket)
Ensures that a bucket exists.
|
abstract java.lang.Iterable<Contents> |
listObjects(java.lang.String bucket)
Returns information about all of the objects in the bucket, regardless of how many objects the bucket contains.
|
abstract java.lang.Iterable<Contents> |
listObjects(java.lang.String bucket,
java.lang.String keyPrefix)
Returns information about objects in the bucket, filtered by names that start with keyPrefix.
|
abstract java.lang.Iterable<Contents> |
listObjects(java.lang.String bucket,
java.lang.String keyPrefix,
java.lang.String nextMarker)
Returns information about objects in the bucket in alphabetical order, starting with key after the next_marker in order,
regardless of how many objects the bucket contains.
|
abstract java.lang.Iterable<Contents> |
listObjects(java.lang.String bucket,
java.lang.String keyPrefix,
java.lang.String nextMarker,
int maxKeys)
Returns information about objects in the bucket in alphabetical order, starting with key after the next_marker in order,
regardless of how many objects the bucket contains.
|
abstract java.lang.Iterable<Ds3Object> |
listObjectsForDirectory(java.nio.file.Path directory)
Returns an object list with which you can call
startWriteJob based on the files in a directory . |
abstract Ds3ClientHelpers.Job |
recoverReadJob(java.util.UUID jobId)
Queries job information based on job id and returns a
WriteJob that can resume the job. |
abstract Ds3ClientHelpers.Job |
recoverWriteJob(java.util.UUID jobId)
Queries job information based on job id and returns a
ReadJob that can resume the job. |
abstract java.lang.Iterable<Ds3Object> |
removePrefixFromDs3ObjectsList(java.lang.Iterable<Ds3Object> objectsList,
java.lang.String prefix) |
abstract Ds3ClientHelpers.Job |
startReadAllJob(java.lang.String bucket)
Performs a bulk get job creation request for all of the objects in the given bucket and returns an
ReadJob . |
abstract Ds3ClientHelpers.Job |
startReadAllJob(java.lang.String bucket,
ReadJobOptions options)
Performs a bulk get job creation request for all of the objects in the given bucket and returns an
ReadJob . |
abstract Ds3ClientHelpers.Job |
startReadJob(java.lang.String bucket,
java.lang.Iterable<Ds3Object> objectsToRead)
Performs a bulk get job creation request and returns an
ReadJob . |
abstract Ds3ClientHelpers.Job |
startReadJob(java.lang.String bucket,
java.lang.Iterable<Ds3Object> objectsToRead,
ReadJobOptions options)
Performs a bulk get job creation request and returns an
ReadJob . |
abstract Ds3ClientHelpers.Job |
startWriteJob(java.lang.String bucket,
java.lang.Iterable<Ds3Object> objectsToWrite)
Performs a bulk put job creation request and returns an
WriteJob . |
abstract Ds3ClientHelpers.Job |
startWriteJob(java.lang.String bucket,
java.lang.Iterable<Ds3Object> objectsToWrite,
WriteJobOptions options)
Performs a bulk put job creation request and returns an
WriteJob . |
static java.lang.String |
stripLeadingPath(java.lang.String objectName,
java.lang.String prefix)
Strip prefix from the beginning of objectName.
|
static Ds3ClientHelpers |
wrap(Ds3Client client)
Wraps the given
Ds3ClientImpl with helper methods. |
static Ds3ClientHelpers |
wrap(Ds3Client client,
int retryAfter) |
public static Ds3ClientHelpers wrap(Ds3Client client)
Ds3ClientImpl
with helper methods.public static Ds3ClientHelpers wrap(Ds3Client client, int retryAfter)
public abstract Ds3ClientHelpers.Job startWriteJob(java.lang.String bucket, java.lang.Iterable<Ds3Object> objectsToWrite) throws java.security.SignatureException, java.io.IOException, XmlProcessingException
WriteJob
.
See WriteJob
for information on how to write the objects for the job.java.security.SignatureException
java.io.IOException
XmlProcessingException
public abstract Ds3ClientHelpers.Job startWriteJob(java.lang.String bucket, java.lang.Iterable<Ds3Object> objectsToWrite, WriteJobOptions options) throws java.security.SignatureException, java.io.IOException, XmlProcessingException
WriteJob
.
See WriteJob
for information on how to write the objects for the job.java.security.SignatureException
java.io.IOException
XmlProcessingException
public abstract Ds3ClientHelpers.Job startReadJob(java.lang.String bucket, java.lang.Iterable<Ds3Object> objectsToRead) throws java.security.SignatureException, java.io.IOException, XmlProcessingException
ReadJob
.
See ReadJob
for information on how to read the objects for the job.java.security.SignatureException
java.io.IOException
XmlProcessingException
public abstract Ds3ClientHelpers.Job startReadJob(java.lang.String bucket, java.lang.Iterable<Ds3Object> objectsToRead, ReadJobOptions options) throws java.security.SignatureException, java.io.IOException, XmlProcessingException
ReadJob
.
See ReadJob
for information on how to read the objects for the job.java.security.SignatureException
java.io.IOException
XmlProcessingException
public abstract Ds3ClientHelpers.Job startReadAllJob(java.lang.String bucket) throws java.security.SignatureException, java.io.IOException, XmlProcessingException
ReadJob
.java.security.SignatureException
java.io.IOException
XmlProcessingException
public abstract Ds3ClientHelpers.Job startReadAllJob(java.lang.String bucket, ReadJobOptions options) throws java.security.SignatureException, java.io.IOException, XmlProcessingException
ReadJob
.java.security.SignatureException
java.io.IOException
XmlProcessingException
public abstract Ds3ClientHelpers.Job recoverWriteJob(java.util.UUID jobId) throws java.security.SignatureException, java.io.IOException, XmlProcessingException, JobRecoveryException
ReadJob
that can resume the job.java.security.SignatureException
java.io.IOException
XmlProcessingException
JobRecoveryException
public abstract Ds3ClientHelpers.Job recoverReadJob(java.util.UUID jobId) throws java.security.SignatureException, java.io.IOException, XmlProcessingException, JobRecoveryException
WriteJob
that can resume the job.java.security.SignatureException
java.io.IOException
XmlProcessingException
JobRecoveryException
public abstract void ensureBucketExists(java.lang.String bucket) throws java.io.IOException, java.security.SignatureException
bucket
- The name of the bucket to check that it exists.java.io.IOException
java.security.SignatureException
public abstract java.lang.Iterable<Contents> listObjects(java.lang.String bucket) throws java.security.SignatureException, java.io.IOException
java.security.SignatureException
java.io.IOException
public abstract java.lang.Iterable<Contents> listObjects(java.lang.String bucket, java.lang.String keyPrefix) throws java.security.SignatureException, java.io.IOException
keyPrefix
- Limits the response to keys that begin with the specified prefix. You can use prefixes to separate a
bucket into different groupings of keys. (You can think of using prefix to make groups in the same
way you'd use a folder in a file system.)java.security.SignatureException
java.io.IOException
public abstract java.lang.Iterable<Contents> listObjects(java.lang.String bucket, java.lang.String keyPrefix, java.lang.String nextMarker) throws java.security.SignatureException, java.io.IOException
keyPrefix
- Limits the response to keys that begin with the specified prefix. You can use prefixes to separate a
bucket into different groupings of keys. (You can think of using prefix to make groups in the same
way you'd use a folder in a file system.)
Set to null if unused but need to specify nextMarker.nextMarker
- Specifies the key to start with when listing objects in a bucket. Returns object keys in alphabetical
order, starting with key after the nextMarker in order.java.security.SignatureException
java.io.IOException
public abstract java.lang.Iterable<Contents> listObjects(java.lang.String bucket, java.lang.String keyPrefix, java.lang.String nextMarker, int maxKeys) throws java.security.SignatureException, java.io.IOException
keyPrefix
- Limits the response to keys that begin with the specified prefix. You can use prefixes to separate a
bucket into different groupings of keys. (You can think of using prefix to make groups in the same
way you'd use a folder in a file system.)
Set to null if unused but need to specify nextMarker or maxKeys.nextMarker
- Specifies the key to start with when listing objects in a bucket. Returns object keys in
alphabetical order, starting with key after the nextMarker in order.
Set to null if unused but need to specify maxKeys.maxKeys
- Sets the maximum number of keys returned in the response body. You can add this to your request
if you want to retrieve fewer than the default 1000 keys.
The response might contain fewer keys but will never contain more. If there are additional keys
that satisfy the search criteria but were not returned because max-keys was exceeded, the
response.isTruncated() is true. To return the additional keys, see nextMarker.java.security.SignatureException
java.io.IOException
public abstract java.lang.Iterable<Ds3Object> listObjectsForDirectory(java.nio.file.Path directory) throws java.io.IOException
startWriteJob
based on the files in a directory
.
This method traverses the directory
recursively.java.io.IOException
public abstract java.lang.Iterable<Ds3Object> addPrefixToDs3ObjectsList(java.lang.Iterable<Ds3Object> objectsList, java.lang.String prefix)
objectsList
- prefix
- public abstract java.lang.Iterable<Ds3Object> removePrefixFromDs3ObjectsList(java.lang.Iterable<Ds3Object> objectsList, java.lang.String prefix)
objectsList
- prefix
- public static java.lang.String stripLeadingPath(java.lang.String objectName, java.lang.String prefix)
objectName
- prefix
-