public abstract class AbstractEsuRestApi extends java.lang.Object implements EsuApi
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
context |
protected java.lang.String |
host |
protected int |
port |
protected java.lang.String |
proto |
protected boolean |
readChecksum |
protected byte[] |
secret |
protected java.lang.String |
uid |
protected boolean |
unicodeEnabled |
Constructor and Description |
---|
AbstractEsuRestApi(java.lang.String host,
int port,
java.lang.String uid,
java.lang.String sharedSecret)
Creates a new AbstractEsuRestApi
|
Modifier and Type | Method and Description |
---|---|
protected java.net.URL |
buildUrl(java.lang.String resource,
java.lang.String query)
Builds a new URL to the given resource
|
abstract long |
calculateServerOffset()
Makes a request to the server to get the value of the response Date
header.
|
ObjectId |
createObject(Acl acl,
MetadataList metadata,
byte[] data,
java.lang.String mimeType)
Creates a new object in the cloud.
|
ObjectId |
createObject(Acl acl,
MetadataList metadata,
byte[] data,
java.lang.String mimeType,
Checksum checksum)
Creates a new object in the cloud.
|
ObjectId |
createObjectFromSegment(Acl acl,
MetadataList metadata,
BufferSegment data,
java.lang.String mimeType)
Creates a new object in the cloud using a BufferSegment.
|
ObjectId |
createObjectFromSegmentOnPath(ObjectPath path,
Acl acl,
MetadataList metadata,
BufferSegment data,
java.lang.String mimeType)
Creates a new object in the cloud using a BufferSegment on the given
path.
|
ObjectId |
createObjectOnPath(ObjectPath path,
Acl acl,
MetadataList metadata,
byte[] data,
java.lang.String mimeType)
Creates a new object in the cloud on the specified path.
|
ObjectId |
createObjectOnPath(ObjectPath path,
Acl acl,
MetadataList metadata,
byte[] data,
java.lang.String mimeType,
Checksum checksum)
Creates a new object in the cloud on the specified path.
|
ObjectId |
createObjectWithKey(java.lang.String keyPool,
java.lang.String key,
Acl acl,
MetadataList metadata,
byte[] data,
long length,
java.lang.String mimeType)
Creates a new object in the cloud.
|
ObjectId |
createObjectWithKey(java.lang.String keyPool,
java.lang.String key,
Acl acl,
MetadataList metadata,
byte[] data,
long length,
java.lang.String mimeType,
Checksum checksum)
Creates a new object in the cloud.
|
ObjectId |
createObjectWithKeyFromSegment(java.lang.String keyPool,
java.lang.String key,
Acl acl,
MetadataList metadata,
BufferSegment data,
java.lang.String mimeType)
Creates a new object in the cloud using a BufferSegment.
|
protected java.lang.String |
decodeUtf8(java.lang.String value) |
protected java.lang.String |
encodeUtf8(java.lang.String value) |
protected java.lang.String |
formatTag(Metadata meta)
Formats a tag value for passing in the header.
|
java.lang.String |
getContext()
Gets the context root of the REST api.
|
protected java.lang.String |
getDateHeader()
Gets the current time formatted for HTTP headers
|
protected ObjectId |
getObjectId(java.lang.String location) |
java.lang.String |
getProtocol()
Returns the protocol being used (http or https).
|
protected java.lang.String |
getResourcePath(java.lang.String ctx,
Identifier id)
Gets the appropriate resource path depending on identifier
type.
|
long |
getServerOffset()
Gets the current server offset in milliseconds.
|
java.net.URL |
getShareableUrl(Identifier id,
java.util.Date expiration)
An Atmos user (UID) can construct a pre-authenticated URL to an
object, which may then be used by anyone to retrieve the
object (e.g., through a browser).
|
java.net.URL |
getShareableUrl(Identifier id,
java.util.Date expiration,
java.lang.String disposition)
An Atmos user (UID) can construct a pre-authenticated URL to an
object, which may then be used by anyone to retrieve the
object (e.g., through a browser).
|
boolean |
isReadChecksum() |
boolean |
isUnicodeEnabled()
Returns true if unicode metadata processing is enabled.
|
protected java.lang.String |
join(java.util.List<java.lang.String> list,
java.lang.String delimiter)
Joins a list of Strings using a delimiter (similar to PERL, PHP, etc)
|
java.util.List<DirectoryEntry> |
listDirectory(ObjectPath path)
Deprecated.
Use the version with ListOptions to control the result
count and handle large result sets.
|
java.util.List<Identifier> |
listObjects(MetadataTag tag)
Lists all objects with the given tag.
|
java.util.List<ObjectResult> |
listObjects(MetadataTag tag,
ListOptions options)
Lists all objects with the given tag.
|
java.util.List<Identifier> |
listObjects(java.lang.String tag)
Lists all objects with the given tag.
|
java.util.List<ObjectResult> |
listObjectsWithMetadata(MetadataTag tag)
Lists all objects with the given tag and returns both their IDs and their
metadata.
|
java.util.List<ObjectResult> |
listObjectsWithMetadata(java.lang.String tag)
Lists all objects with the given tag and returns both their IDs and their
metadata.
|
protected java.lang.String |
normalizeSpace(java.lang.String str)
Condenses consecutive spaces into one.
|
protected java.util.List<DirectoryEntry> |
parseDirectoryListing(byte[] data,
ObjectPath basePath) |
protected java.util.List<ObjectId> |
parseObjectList(byte[] response)
Parses an XML response and extracts the list of ObjectIDs.
|
protected java.util.List<ObjectResult> |
parseObjectListWithMetadata(byte[] response)
Parses an XML response and extracts the list of ObjectIDs
and metadata.
|
protected ServiceInformation |
parseServiceInformation(byte[] response,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> map) |
protected java.util.List<Identifier> |
parseVersionList(byte[] response) |
protected java.util.List<Version> |
parseVersionListLong(byte[] response) |
protected void |
processAcl(Acl acl,
java.util.Map<java.lang.String,java.lang.String> headers)
Enumerates the given ACL and creates the appropriate request headers.
|
protected void |
processMetadata(MetadataList metadata,
java.util.Map<java.lang.String,java.lang.String> headers)
Iterates through the given metadata and adds the appropriate metadata
headers to the request.
|
protected void |
processTags(MetadataTags tags,
java.util.Map<java.lang.String,java.lang.String> headers)
Enumerates the given list of metadata tags and sets the x-emc-tags
header.
|
protected void |
readAcl(Acl acl,
java.lang.String header,
Grantee.GRANT_TYPE type)
Parses the value of an ACL response header and builds an ACL
|
protected void |
readMetadata(MetadataList meta,
java.lang.String header,
boolean listable)
Parses the given header text and appends to the metadata list
|
byte[] |
readObject(Identifier id,
Extent extent,
byte[] buffer)
Reads an object's content.
|
byte[] |
readObjectWithKey(java.lang.String keyPool,
java.lang.String key,
Extent extent,
byte[] buffer)
Reads an object's content.
|
protected byte[] |
readStream(java.io.InputStream in,
int contentLength) |
protected void |
readTags(MetadataTags tags,
java.lang.String header,
boolean listable)
Parses the given header and appends to the list of metadata tags.
|
void |
setContext(java.lang.String context)
Overrides the default context root of the REST api.
|
void |
setProtocol(java.lang.String proto)
Overrides the protocol selection.
|
void |
setReadChecksum(boolean readChecksum)
Turns read checksum verification on or off.
|
void |
setServerOffset(long serverOffset)
Sets the server offset in millesconds.
|
void |
setUnicodeEnabled(boolean unicodeEnabled)
Set to true to enable Unicode metadata processing.
|
java.lang.String |
sign(byte[] input) |
java.lang.String |
sign(java.lang.String input)
Generates an HMAC-SHA1 signature of the given input string using the
shared secret key.
|
protected void |
silentClose(java.io.OutputStream out)
Helper method that closes a stream ignoring errors.
|
void |
updateObject(Identifier id,
Acl acl,
MetadataList metadata,
Extent extent,
byte[] data,
java.lang.String mimeType)
Updates an object in the cloud and optionally its metadata and ACL.
|
void |
updateObject(Identifier id,
Acl acl,
MetadataList metadata,
Extent extent,
byte[] data,
java.lang.String mimeType,
Checksum checksum)
Updates an object in the cloud and optionally its metadata and ACL.
|
void |
updateObjectFromSegment(Identifier id,
Acl acl,
MetadataList metadata,
Extent extent,
BufferSegment data,
java.lang.String mimeType)
Updates an object in the cloud and optionally its metadata and ACL.
|
void |
updateObjectWithKey(java.lang.String keyPool,
java.lang.String key,
Acl acl,
MetadataList metadata,
Extent extent,
byte[] data,
java.lang.String mimeType)
Updates an object in the cloud.
|
void |
updateObjectWithKey(java.lang.String keyPool,
java.lang.String key,
Acl acl,
MetadataList metadata,
Extent extent,
byte[] data,
java.lang.String mimeType,
Checksum checksum)
Updates an object in the cloud.
|
void |
updateObjectWithKeyFromSegment(java.lang.String keyPool,
java.lang.String key,
Acl acl,
MetadataList metadata,
Extent extent,
BufferSegment data,
java.lang.String mimeType)
Updates an object in the cloud using a portion of a buffer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createObjectFromSegment, createObjectFromSegmentOnPath, createObjectFromStream, createObjectFromStreamOnPath, createObjectWithKeyFromSegment, createObjectWithKeyFromStream, deleteObject, deleteObjectWithKey, deleteUserMetadata, deleteVersion, getAcl, getAllMetadata, getAllMetadata, getListableTags, getListableTags, getObjectInfo, getServiceInformation, getSystemMetadata, getSystemMetadata, getUserMetadata, hardLink, listDirectory, listObjects, listUserMetadataTags, listVersions, listVersions, queryObjects, readObject, readObjectStream, readObjectStreamWithKey, readObjectWithKey, rename, restoreVersion, setAcl, setUserMetadata, updateObjectFromSegment, updateObjectFromStream, updateObjectWithKeyFromSegment, updateObjectWithKeyFromStream, versionObject
protected java.lang.String host
protected int port
protected java.lang.String uid
protected byte[] secret
protected java.lang.String context
protected java.lang.String proto
protected boolean unicodeEnabled
protected boolean readChecksum
public AbstractEsuRestApi(java.lang.String host, int port, java.lang.String uid, java.lang.String sharedSecret)
host
- the host running the web servicesport
- the port number, e.g. 80 or 443uid
- the web service UIDsharedSecret
- the UID's shared secret keypublic java.lang.String getContext()
public void setContext(java.lang.String context)
context
- the context to setpublic java.lang.String getProtocol()
public void setProtocol(java.lang.String proto)
proto
- the proto to setpublic ObjectId createObject(Acl acl, MetadataList metadata, byte[] data, java.lang.String mimeType)
createObject
in interface EsuApi
acl
- Access control list for the new object. May be null to use a
default ACLmetadata
- Metadata for the new object. May be null for no metadata.data
- The initial contents of the object. May be appended to later.
May be null to create an object with no content.mimeType
- the MIME type of the content. Optional, may be null. If
data is non-null and mimeType is null, the MIME type will
default to application/octet-stream.EsuException
- if the request fails.public ObjectId createObject(Acl acl, MetadataList metadata, byte[] data, java.lang.String mimeType, Checksum checksum)
createObject
in interface EsuApi
acl
- Access control list for the new object. May be null to use a
default ACLmetadata
- Metadata for the new object. May be null for no metadata.data
- The initial contents of the object. May be appended to later.
May be null to create an object with no content.mimeType
- the MIME type of the content. Optional, may be null. If
data is non-null and mimeType is null, the MIME type will
default to application/octet-stream.checksum
- if not null, use the Checksum object to compute
the checksum for the create object request. If appending
to the object with subsequent requests, use the same
checksum object for each request.EsuException
- if the request fails.public ObjectId createObjectFromSegment(Acl acl, MetadataList metadata, BufferSegment data, java.lang.String mimeType)
createObjectFromSegment
in interface EsuApi
acl
- Access control list for the new object. May be null to use a
default ACLmetadata
- Metadata for the new object. May be null for no metadata.data
- The initial contents of the object. May be appended to later.
May be null to create an object with no content.mimeType
- the MIME type of the content. Optional, may be null. If
data is non-null and mimeType is null, the MIME type will
default to application/octet-stream.EsuException
- if the request fails.public ObjectId createObjectOnPath(ObjectPath path, Acl acl, MetadataList metadata, byte[] data, java.lang.String mimeType)
createObjectOnPath
in interface EsuApi
path
- The path to create the object on.acl
- Access control list for the new object. May be null to use a
default ACLmetadata
- Metadata for the new object. May be null for no metadata.data
- The initial contents of the object. May be appended to later.
May be null to create an object with no content.mimeType
- the MIME type of the content. Optional, may be null. If
data is non-null and mimeType is null, the MIME type will
default to application/octet-stream.EsuException
- if the request fails.public ObjectId createObjectOnPath(ObjectPath path, Acl acl, MetadataList metadata, byte[] data, java.lang.String mimeType, Checksum checksum)
createObjectOnPath
in interface EsuApi
path
- The path to create the object on.acl
- Access control list for the new object. May be null to use a
default ACLmetadata
- Metadata for the new object. May be null for no metadata.data
- The initial contents of the object. May be appended to later.
May be null to create an object with no content.mimeType
- the MIME type of the content. Optional, may be null. If
data is non-null and mimeType is null, the MIME type will
default to application/octet-stream.checksum
- if not null, use the Checksum object to compute
the checksum for the create object request. If appending
to the object with subsequent requests, use the same
checksum object for each request.EsuException
- if the request fails.public ObjectId createObjectFromSegmentOnPath(ObjectPath path, Acl acl, MetadataList metadata, BufferSegment data, java.lang.String mimeType)
createObjectFromSegmentOnPath
in interface EsuApi
path
- the path to create the object on.acl
- Access control list for the new object. May be null to use a
default ACLmetadata
- Metadata for the new object. May be null for no metadata.data
- The initial contents of the object. May be appended to later.
May be null to create an object with no content.mimeType
- the MIME type of the content. Optional, may be null. If
data is non-null and mimeType is null, the MIME type will
default to application/octet-stream.EsuException
- if the request fails.public void updateObject(Identifier id, Acl acl, MetadataList metadata, Extent extent, byte[] data, java.lang.String mimeType)
updateObject
in interface EsuApi
id
- The ID of the object to updateacl
- Access control list for the new object. Optional, default is
NULL to leave the ACL unchanged.metadata
- Metadata list for the new object. Optional, default is
NULL for no changes to the metadata.data
- The new contents of the object. May be appended to later.
Optional, default is NULL (no content changes).extent
- portion of the object to update. May be null to indicate
the whole object is to be replaced. If not null, the extent
size must match the data size.mimeType
- the MIME type of the content. Optional, may be null. If
data is non-null and mimeType is null, the MIME type will
default to application/octet-stream.EsuException
- if the request fails.public void updateObject(Identifier id, Acl acl, MetadataList metadata, Extent extent, byte[] data, java.lang.String mimeType, Checksum checksum)
updateObject
in interface EsuApi
id
- The ID of the object to updateacl
- Access control list for the new object. Optional, default is
NULL to leave the ACL unchanged.metadata
- Metadata list for the new object. Optional, default is
NULL for no changes to the metadata.data
- The new contents of the object. May be appended to later.
Optional, default is NULL (no content changes).extent
- portion of the object to update. May be null to indicate
the whole object is to be replaced. If not null, the extent
size must match the data size.mimeType
- the MIME type of the content. Optional, may be null. If
data is non-null and mimeType is null, the MIME type will
default to application/octet-stream.checksum
- if not null, use the Checksum object to compute
the checksum for the update object request. If appending
to the object with subsequent requests, use the same
checksum object for each request.EsuException
- if the request fails.public void updateObjectFromSegment(Identifier id, Acl acl, MetadataList metadata, Extent extent, BufferSegment data, java.lang.String mimeType)
updateObjectFromSegment
in interface EsuApi
id
- The ID of the object to updateacl
- Access control list for the new object. Optional, default is
NULL to leave the ACL unchanged.metadata
- Metadata list for the new object. Optional, default is
NULL for no changes to the metadata.data
- The new contents of the object. May be appended to later.
Optional, default is NULL (no content changes).extent
- portion of the object to update. May be null to indicate
the whole object is to be replaced. If not null, the extent
size must match the data size.mimeType
- the MIME type of the content. Optional, may be null. If
data is non-null and mimeType is null, the MIME type will
default to application/octet-stream.EsuException
- if the request fails.public byte[] readObject(Identifier id, Extent extent, byte[] buffer)
readObject
in interface EsuApi
id
- the identifier of the object whose content to read.extent
- the portion of the object data to read. Optional. Default
is null to read the entire object.buffer
- the buffer to use to read the extent. Must be large enough
to read the response or an error will be thrown. If null, a
buffer will be allocated to hold the response data. If you
pass a buffer that is larger than the extent, only
extent.getSize() bytes will be valid.public java.util.List<Identifier> listObjects(MetadataTag tag)
listObjects
in interface EsuApi
tag
- the tag to search forEsuException
- if no objects are found (code 1003)public java.util.List<ObjectResult> listObjects(MetadataTag tag, ListOptions options)
listObjects
in interface EsuApi
tag
- the tag to search foroptions
- the options for listing the objectsEsuException
- if no objects are found (code 1003)public java.util.List<Identifier> listObjects(java.lang.String tag)
listObjects
in interface EsuApi
tag
- the tag to search forEsuException
- if no objects are found (code 1003)public java.util.List<ObjectResult> listObjectsWithMetadata(MetadataTag tag)
listObjectsWithMetadata
in interface EsuApi
tag
- the tag to search forpublic java.util.List<ObjectResult> listObjectsWithMetadata(java.lang.String tag)
listObjectsWithMetadata
in interface EsuApi
tag
- the tag to search forpublic java.util.List<DirectoryEntry> listDirectory(ObjectPath path)
listDirectory
in interface EsuApi
path
- the path to list. Must be a directory.public java.lang.String sign(java.lang.String input) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.lang.IllegalStateException, java.io.UnsupportedEncodingException
input
- the string to signjava.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.lang.IllegalStateException
java.io.UnsupportedEncodingException
public java.lang.String sign(byte[] input) throws java.io.UnsupportedEncodingException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
public java.net.URL getShareableUrl(Identifier id, java.util.Date expiration, java.lang.String disposition)
getShareableUrl
in interface EsuApi
id
- the object to generate the URL forexpiration
- the expiration date of the URLdisposition
- the value of the Content-Disposition header, e.g.
"attachment; filename=\"filename.txt\""public java.net.URL getShareableUrl(Identifier id, java.util.Date expiration)
getShareableUrl
in interface EsuApi
id
- the object to generate the URL forexpiration
- the expiration date of the URLprotected java.lang.String getResourcePath(java.lang.String ctx, Identifier id)
protected java.net.URL buildUrl(java.lang.String resource, java.lang.String query) throws java.net.URISyntaxException, java.net.MalformedURLException
java.net.URISyntaxException
java.net.MalformedURLException
protected void silentClose(java.io.OutputStream out)
out
- the OutputStream to closeprotected void readMetadata(MetadataList meta, java.lang.String header, boolean listable) throws java.io.UnsupportedEncodingException
meta
- the metadata list to append toheader
- the metadata header to parselistable
- true if the header being parsed contains listable metadata.java.io.UnsupportedEncodingException
protected void processTags(MetadataTags tags, java.util.Map<java.lang.String,java.lang.String> headers) throws java.io.UnsupportedEncodingException
tags
- the tag list to enumerateheaders
- the HTTP request headersjava.io.UnsupportedEncodingException
protected void readAcl(Acl acl, java.lang.String header, Grantee.GRANT_TYPE type)
acl
- a reference to the ACL to append toheader
- the acl response headertype
- the type of Grantees in the header (user or group)protected java.util.List<ObjectId> parseObjectList(byte[] response)
response
- the response byte array to parse as XMLprotected java.util.List<Identifier> parseVersionList(byte[] response)
protected java.util.List<Version> parseVersionListLong(byte[] response)
protected java.util.List<ObjectResult> parseObjectListWithMetadata(byte[] response)
response
- the response byte array to parse as XMLprotected java.util.List<DirectoryEntry> parseDirectoryListing(byte[] data, ObjectPath basePath)
protected void readTags(MetadataTags tags, java.lang.String header, boolean listable) throws java.io.UnsupportedEncodingException
tags
- the list of metadata tags to append toheader
- the header to parselistable
- true if the metadata tags in the header are listablejava.io.UnsupportedEncodingException
protected void processMetadata(MetadataList metadata, java.util.Map<java.lang.String,java.lang.String> headers) throws java.io.UnsupportedEncodingException
metadata
- the metadata to addheaders
- the map of request headers.java.io.UnsupportedEncodingException
protected java.lang.String formatTag(Metadata meta) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
protected java.lang.String encodeUtf8(java.lang.String value) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
protected java.lang.String decodeUtf8(java.lang.String value) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
protected void processAcl(Acl acl, java.util.Map<java.lang.String,java.lang.String> headers)
acl
- the ACL to enumerateheaders
- the set of request headers.protected java.lang.String normalizeSpace(java.lang.String str)
protected java.lang.String getDateHeader()
protected ObjectId getObjectId(java.lang.String location)
protected byte[] readStream(java.io.InputStream in, int contentLength) throws java.io.IOException
java.io.IOException
protected ServiceInformation parseServiceInformation(byte[] response, java.util.Map<java.lang.String,java.util.List<java.lang.String>> map)
protected java.lang.String join(java.util.List<java.lang.String> list, java.lang.String delimiter)
list
- the list of Stringsdelimiter
- the string to join the list withpublic boolean isReadChecksum()
public void setReadChecksum(boolean readChecksum)
readChecksum
- the readChecksum to setpublic boolean isUnicodeEnabled()
isUnicodeEnabled
in interface EsuApi
public void setUnicodeEnabled(boolean unicodeEnabled)
setUnicodeEnabled
in interface EsuApi
public long getServerOffset()
public void setServerOffset(long serverOffset)
serverOffset
- the serverOffset to setpublic abstract long calculateServerOffset()
public ObjectId createObjectWithKey(java.lang.String keyPool, java.lang.String key, Acl acl, MetadataList metadata, byte[] data, long length, java.lang.String mimeType)
EsuApi
createObjectWithKey
in interface EsuApi
keyPool
- A name which represents the keyspace for this key. A pool is analogous
to an S3 bucket and two objects with the same name can exist in different pools.key
- The key that uniquely identifies this object within its keyPool.acl
- Access control list for the new object. May be null
to use a default ACLmetadata
- Metadata for the new object. May be null for
no metadata.data
- The initial contents of the object. May be appended
to later. May be null to create an object with no content.length
- The length of the stream in bytes. If the stream
is longer than the length, only length bytes will be written. If
the stream is shorter than the length, an error will occur.mimeType
- the MIME type of the content. Optional,
may be null. If data is non-null and mimeType is null, the MIME
type will default to application/octet-stream.public ObjectId createObjectWithKey(java.lang.String keyPool, java.lang.String key, Acl acl, MetadataList metadata, byte[] data, long length, java.lang.String mimeType, Checksum checksum)
EsuApi
createObjectWithKey
in interface EsuApi
keyPool
- A name which represents the keyspace for this key. A pool is analogous
to an S3 bucket and two objects with the same name can exist in different pools.key
- The key that uniquely identifies this object within its keyPool.acl
- Access control list for the new object. May be null
to use a default ACLmetadata
- Metadata for the new object. May be null for
no metadata.data
- The initial contents of the object. May be appended
to later. May be null to create an object with no content.length
- The length of the stream in bytes. If the stream
is longer than the length, only length bytes will be written. If
the stream is shorter than the length, an error will occur.mimeType
- the MIME type of the content. Optional,
may be null. If data is non-null and mimeType is null, the MIME
type will default to application/octet-stream.checksum
- if not null, use the Checksum object to compute
the checksum for the create object request. If appending
to the object with subsequent requests, use the same
checksum object for each request.public ObjectId createObjectWithKeyFromSegment(java.lang.String keyPool, java.lang.String key, Acl acl, MetadataList metadata, BufferSegment data, java.lang.String mimeType)
EsuApi
createObjectWithKeyFromSegment
in interface EsuApi
keyPool
- A name which represents the keyspace for this key. A pool is analogous
to an S3 bucket and two objects with the same name can exist in different pools.key
- The key that uniquely identifies this object within its keyPool.acl
- Access control list for the new object. May be null
to use a default ACLmetadata
- Metadata for the new object. May be null for
no metadata.data
- The initial contents of the object. May be appended
to later. May be null to create an object with no content.mimeType
- the MIME type of the content. Optional,
may be null. If data is non-null and mimeType is null, the MIME
type will default to application/octet-stream.public byte[] readObjectWithKey(java.lang.String keyPool, java.lang.String key, Extent extent, byte[] buffer)
EsuApi
readObjectWithKey
in interface EsuApi
keyPool
- A name which represents the keyspace for this key. A pool is analogous
to an S3 bucket and two objects with the same name can exist in different pools.key
- The key that uniquely identifies this object within its keyPool.extent
- the portion of the object data to read. Optional.
Default is null to read the entire object.buffer
- the buffer to use to read the extent. Must be large
enough to read the response or an error will be thrown. If null,
a buffer will be allocated to hold the response data. If you pass
a buffer that is larger than the extent, only extent.getSize() bytes
will be valid.public void updateObjectWithKey(java.lang.String keyPool, java.lang.String key, Acl acl, MetadataList metadata, Extent extent, byte[] data, java.lang.String mimeType)
EsuApi
updateObjectWithKey
in interface EsuApi
keyPool
- A name which represents the keyspace for this key. A pool is analogous
to an S3 bucket and two objects with the same name can exist in different pools.key
- The key that uniquely identifies this object within its keyPool.acl
- Access control list for the new object. Optional, default
is NULL to leave the ACL unchanged.metadata
- Metadata list for the new object. Optional,
default is NULL for no changes to the metadata.extent
- portion of the object to update. May be null to indicate
the whole object is to be replaced. If not null, the extent size must
match the data size.data
- The new contents of the object. May be appended
to later. Optional, default is NULL (no content changes).mimeType
- the MIME type of the content. Optional,
may be null. If data is non-null and mimeType is null, the MIME
type will default to application/octet-stream.public void updateObjectWithKey(java.lang.String keyPool, java.lang.String key, Acl acl, MetadataList metadata, Extent extent, byte[] data, java.lang.String mimeType, Checksum checksum)
EsuApi
updateObjectWithKey
in interface EsuApi
keyPool
- A name which represents the keyspace for this key. A pool is analogous
to an S3 bucket and two objects with the same name can exist in different pools.key
- The key that uniquely identifies this object within its keyPool.acl
- Access control list for the new object. Optional, default
is NULL to leave the ACL unchanged.metadata
- Metadata list for the new object. Optional,
default is NULL for no changes to the metadata.extent
- portion of the object to update. May be null to indicate
the whole object is to be replaced. If not null, the extent size must
match the data size.data
- The new contents of the object. May be appended
to later. Optional, default is NULL (no content changes).mimeType
- the MIME type of the content. Optional,
may be null. If data is non-null and mimeType is null, the MIME
type will default to application/octet-stream.checksum
- if not null, use the Checksum object to compute
the checksum for the update object request. If appending
to the object with subsequent requests, use the same
checksum object for each request.public void updateObjectWithKeyFromSegment(java.lang.String keyPool, java.lang.String key, Acl acl, MetadataList metadata, Extent extent, BufferSegment data, java.lang.String mimeType)
EsuApi
updateObjectWithKeyFromSegment
in interface EsuApi
keyPool
- A name which represents the keyspace for this key. A pool is analogous
to an S3 bucket and two objects with the same name can exist in different pools.key
- The key that uniquely identifies this object within its keyPool.acl
- Access control list for the new object. Optional, default
is NULL to leave the ACL unchanged.metadata
- Metadata list for the new object. Optional,
default is NULL for no changes to the metadata.extent
- portion of the object to update. May be null to indicate
the whole object is to be replaced. If not null, the extent size must
match the data size.data
- The new contents of the object. May be appended
to later. Optional, default is NULL (no content changes).mimeType
- the MIME type of the content. Optional,
may be null. If data is non-null and mimeType is null, the MIME
type will default to application/octet-stream.