public interface AtmosApi
Modifier and Type | Method and Description |
---|---|
long |
calculateServerClockSkew()
Calculates rough clock skew.
|
CreateAccessTokenResponse |
createAccessToken(CreateAccessTokenRequest request)
Creates an anonymous access token using all of the options provided in the request object.
|
ObjectId |
createDirectory(ObjectPath path)
Creates a directory in the subtenant namespace using the specified path.
|
ObjectId |
createDirectory(ObjectPath path,
Acl acl,
Metadata... metadata)
Creates a directory in the subtenant namespace using the specified path, acl and metadata.
|
CreateObjectResponse |
createObject(CreateObjectRequest request)
Creates a new object in the cloud using all of the options provided in the request object.
|
ObjectId |
createObject(ObjectIdentifier identifier,
java.lang.Object content,
java.lang.String contentType)
Creates a new object in the cloud with the specified identifier.
|
ObjectId |
createObject(java.lang.Object content,
java.lang.String contentType)
Creates a new object in the cloud.
|
java.lang.String |
createSubtenant(CreateSubtenantRequest request)
Creates a new Atmos Subtenant in EMC ViPR.
|
ObjectId |
createVersion(ObjectIdentifier identifier)
Creates a new immutable version (snapshot) of the specified object from its current state.
|
void |
delete(ObjectIdentifier identifier)
Deletes an object from the cloud
|
void |
deleteAccessToken(java.lang.String accessTokenId)
Deletes the specified access token.
|
void |
deleteAccessToken(java.net.URL url)
Deletes the specified access token.
|
void |
deleteUserMetadata(ObjectIdentifier identifier,
java.lang.String... names)
Deletes metadata associated with the specified object.
|
void |
deleteVersion(ObjectId versionId)
Deletes the specified object version.
|
<T> GenericResponse<T> |
execute(PreSignedRequest request,
java.lang.Class<T> resultType,
java.lang.Object content)
Executes a pre-signed request, sending the specified content as a body (if provided) and returning the specified
resultType (if provided).
|
GetAccessTokenResponse |
getAccessToken(java.lang.String accessTokenId)
Retrieves details about the specified access token.
|
GetAccessTokenResponse |
getAccessToken(java.net.URL url)
Retrieves details about the specified access token.
|
Acl |
getAcl(ObjectIdentifier identifier)
Gets the ACL for the specified object.
|
ObjectInfo |
getObjectInfo(ObjectIdentifier identifier)
Gets storage information for the specified object.
|
ObjectMetadata |
getObjectMetadata(ObjectIdentifier identifier)
Gets an object's metadata, ACL and content-type all in one call.
|
ServiceInformation |
getServiceInformation() |
java.net.URL |
getShareableUrl(ObjectIdentifier identifier,
java.util.Date expirationDate)
Constructs a pre-signed URL to an object, which anyone can then use to retrieve the object.
|
java.net.URL |
getShareableUrl(ObjectIdentifier identifier,
java.util.Date expirationDate,
java.lang.String disposition)
Constructs a shareable URL with a specific content-disposition.
|
java.util.Map<java.lang.String,Metadata> |
getSystemMetadata(ObjectIdentifier identifier,
java.lang.String... metadataNames)
Gets the system metadata associated with the specified object.
|
java.util.Map<java.lang.String,Metadata> |
getUserMetadata(ObjectIdentifier identifier,
java.lang.String... metadataNames)
Gets the user metadata associated with the specified object.
|
java.util.Map<java.lang.String,java.lang.Boolean> |
getUserMetadataNames(ObjectIdentifier identifier)
Lists the names of all metadata associated with the specified object.
|
ListAccessTokensResponse |
listAccessTokens(ListAccessTokensRequest request)
Lists all access tokens owned by the user using all of the options provided in the request object.
|
ListDirectoryResponse |
listDirectory(ListDirectoryRequest request)
Lists the contents of a directory in the namespace.
|
java.util.Set<java.lang.String> |
listMetadata(java.lang.String metadataName)
Lists the children of the specified metadata path in the hierarchy of listable metadata for the subtenant.
|
ListObjectsResponse |
listObjects(ListObjectsRequest request)
Lists all objects that are assigned the specified listable metadata using all of the options provided in the
request object.
|
ListVersionsResponse |
listVersions(ListVersionsRequest request)
Lists all versions (snapshots) of the specified object using all of the options provided in the request object.
|
void |
move(ObjectPath oldPath,
ObjectPath newPath,
boolean overwrite)
Moves an object in the namespace to a new location.
|
PreSignedRequest |
preSignRequest(Request request,
java.util.Date expiration)
Pre-signs a request with a specified expiration time.
|
<T> T |
readObject(ObjectIdentifier identifier,
java.lang.Class<T> objectType)
Reads an object's entire content from the cloud.
|
<T> T |
readObject(ObjectIdentifier identifier,
Range range,
java.lang.Class<T> objectType)
Reads an object's content from the cloud.
|
<T> ReadObjectResponse<T> |
readObject(ReadObjectRequest request,
java.lang.Class<T> objectType)
Reads an object's content from the cloud using all of the options provided in the request object.
|
ReadObjectResponse<java.io.InputStream> |
readObjectStream(ObjectIdentifier identifier,
Range range)
Provides an InputStream to read an object's content from the cloud.
|
void |
restoreVersion(ObjectId objectId,
ObjectId versionId)
Restores the specified version (snapshot) of the specified object so that the object's current state reflects
that of the version.
|
void |
setAcl(ObjectIdentifier identifier,
Acl acl)
Sets the ACL for the specified object.
|
void |
setUserMetadata(ObjectIdentifier identifier,
Metadata... metadata)
Adds or replaces user metadata associated with the specified object.
|
void |
updateObject(ObjectIdentifier identifier,
java.lang.Object content)
Updates an object's content in the cloud.
|
void |
updateObject(ObjectIdentifier identifier,
java.lang.Object content,
Range range)
Updates an object's content in the cloud.
|
BasicResponse |
updateObject(UpdateObjectRequest request)
Updates an object's content in the cloud using all of the options provided in the request object.
|
ServiceInformation getServiceInformation()
long calculateServerClockSkew()
ObjectId createObject(java.lang.Object content, java.lang.String contentType)
content
- The initial content of the object. May be appended to later. May be null to create an
object with no content. The content object can be any object type that is supported by the
implementation.contentType
- the MIME type of the content. Optional, may be null. If null, defaults to
application/octet-stream.ObjectId createObject(ObjectIdentifier identifier, java.lang.Object content, java.lang.String contentType)
identifier
- The identifier to use for the new object. This may be an ObjectPath or an ObjectKey.content
- The initial content of the object. May be appended to later. May be null to create an
object with no content. The content object can be any object type that is supported by the
implementation.contentType
- the MIME type of the content. Optional, may be null. If null, defaults to
application/octet-stream.CreateObjectResponse createObject(CreateObjectRequest request)
request
- The request object (click on the class name to get more information).<T> T readObject(ObjectIdentifier identifier, java.lang.Class<T> objectType) throws java.io.IOException
identifier
- The identifier of the object to read. May be any ObjectIdentifier.objectType
- The type of object to return. This can be any object type supported by the implementation.java.io.IOException
- if an exception occurs while reading the object. Note that IOExceptions are generally
retried automatically (configured in AtmosConfig
).<T> T readObject(ObjectIdentifier identifier, Range range, java.lang.Class<T> objectType) throws java.io.IOException
identifier
- The identifier of the object to read. May be any ObjectIdentifier.range
- (optional) The range of bytes to read from the object. A null value will read the entire
object.objectType
- The type of object to return. This can be any object type supported by the implementation.java.io.IOException
- if an exception occurs while reading the object. Note that IOExceptions are generally
retried automatically (configured in AtmosConfig
).<T> ReadObjectResponse<T> readObject(ReadObjectRequest request, java.lang.Class<T> objectType) throws java.io.IOException
request
- The request object (click on the class name to get more information)objectType
- The type of object to return. This can be any object type supported by the implementation.java.io.IOException
- if an exception occurs while reading the object. Note that IOExceptions are generally
retried automatically (configured in AtmosConfig
).ReadObjectResponse<java.io.InputStream> readObjectStream(ObjectIdentifier identifier, Range range)
identifier
- The identifier of the object to read. May be any ObjectIdentifier.range
- (optional) The range of bytes to read from the object. A null value will read the entire
object.void updateObject(ObjectIdentifier identifier, java.lang.Object content)
identifier
- The identifier of the object to update. May be any ObjectIdentifier.content
- The new content of the object. The content object can be any object type that is supported by
the implementation.void updateObject(ObjectIdentifier identifier, java.lang.Object content, Range range)
identifier
- The identifier of the object to update. May be any ObjectIdentifier.content
- The new content of the object. The content object can be any object type that is supported by
the implementation.range
- (optional) The portion of the object to update (expressed as a range of bytes). A null value
will overwrite the entire object.BasicResponse updateObject(UpdateObjectRequest request)
request
- The request object (click on the class name to get more information)void delete(ObjectIdentifier identifier)
identifier
- The identifier of the object to delete. May be any ObjectIdentifier.ObjectId createDirectory(ObjectPath path)
path
- The path of the directory to create.ObjectId createDirectory(ObjectPath path, Acl acl, Metadata... metadata)
path
- The path of the directory to create.acl
- The ACL to assign to the new directory.metadata
- The metadata to associate with the new directory.ListDirectoryResponse listDirectory(ListDirectoryRequest request)
request
- The request object (click on the class name to get more information)void move(ObjectPath oldPath, ObjectPath newPath, boolean overwrite)
oldPath
- The existing path of the object.newPath
- The new path that the object should have.overwrite
- If true and an object already exists at newPath, this call will overwrite that object.java.util.Map<java.lang.String,java.lang.Boolean> getUserMetadataNames(ObjectIdentifier identifier)
identifier
- The identifier of the object. Can be any ObjectIdentifier.java.util.Map<java.lang.String,Metadata> getUserMetadata(ObjectIdentifier identifier, java.lang.String... metadataNames)
identifier
- The identifier of the object. Can be any ObjectIdentifier.metadataNames
- (optional) Constrains the result to include only the metadata named in this list.java.util.Map<java.lang.String,Metadata> getSystemMetadata(ObjectIdentifier identifier, java.lang.String... metadataNames)
identifier
- The identifier of the object. Can be any ObjectIdentifier.metadataNames
- (optional) Constrains the result to include only the metadata named in this list.ObjectMetadata getObjectMetadata(ObjectIdentifier identifier)
identifier
- The identifier of the object. Can be any ObjectIdentifier.void setUserMetadata(ObjectIdentifier identifier, Metadata... metadata)
deleteUserMetadata(ObjectIdentifier, String...)
.identifier
- The identifier of the object. Can be any ObjectIdentifier.metadata
- The metadata to add to or replace on the object.void deleteUserMetadata(ObjectIdentifier identifier, java.lang.String... names)
identifier
- The identifier of the object. Can be any ObjectIdentifier.names
- The names of the metadata to delete/remove from the object.java.util.Set<java.lang.String> listMetadata(java.lang.String metadataName)
metadataName
- The metadata name (sometime called a "tag") whose children should be returned. If null, all
root-level names will be returned (i.e. "ford", "chevy", "chrysler").ListObjectsResponse listObjects(ListObjectsRequest request)
request
- The request object (click on the class name to get more information)Acl getAcl(ObjectIdentifier identifier)
identifier
- The identifier of the object. Can be any ObjectIdentifier.void setAcl(ObjectIdentifier identifier, Acl acl)
identifier
- The identifier of the object. Can be any ObjectIdentifier.acl
- The new ACL for the specified object.ObjectInfo getObjectInfo(ObjectIdentifier identifier)
identifier
- The identifier of the object. Can be any ObjectIdentifier.ObjectId createVersion(ObjectIdentifier identifier)
identifier
- The identifier of the object. Can be any ObjectIdentifier.ListVersionsResponse listVersions(ListVersionsRequest request)
request
- The request object (click on the class name to get more information)void restoreVersion(ObjectId objectId, ObjectId versionId)
objectId
- The ObjectId of the object.versionId
- The ObjectId of the version (must be a version of the specified object).void deleteVersion(ObjectId versionId)
versionId
- The ObjectId of the version to delete (must point to a version and not an object).java.net.URL getShareableUrl(ObjectIdentifier identifier, java.util.Date expirationDate) throws java.net.MalformedURLException
createAccessToken(com.emc.atmos.api.request.CreateAccessTokenRequest)
.identifier
- The identifier of the object. Can be any ObjectIdentifier.expirationDate
- The date at which the generated URL will no longer be valid.java.net.MalformedURLException
- if the configured Atmos endpoint is syntactically invalid.java.net.URL getShareableUrl(ObjectIdentifier identifier, java.util.Date expirationDate, java.lang.String disposition) throws java.net.MalformedURLException
identifier
- The identifier of the object. Can be any ObjectIdentifier.expirationDate
- The date at which the generated URL will no longer be valid.disposition
- the value of the Content-Disposition header, e.g.
"attachment; filename=\"filename.txt\""java.net.MalformedURLException
- if the configured Atmos endpoint is syntactically invalid.CreateAccessTokenResponse createAccessToken(CreateAccessTokenRequest request) throws java.net.MalformedURLException
request
- The request object (click on the class name to get more information)java.net.MalformedURLException
- if the configured Atmos endpoint is syntactically invalid.GetAccessTokenResponse getAccessToken(java.net.URL url)
getAccessToken(String)
.url
- The URL of the access token.GetAccessTokenResponse getAccessToken(java.lang.String accessTokenId)
accessTokenId
- The ID of the access token.void deleteAccessToken(java.net.URL url)
deleteAccessToken(String)
.url
- The URL of the access token.void deleteAccessToken(java.lang.String accessTokenId)
accessTokenId
- The ID of the access token.ListAccessTokensResponse listAccessTokens(ListAccessTokensRequest request)
request
- The request object (click on the class name to get more information)PreSignedRequest preSignRequest(Request request, java.util.Date expiration) throws java.net.MalformedURLException
execute(com.emc.atmos.api.request.PreSignedRequest, Class, Object)
method. This feature is useful
if you intend to serialize the pre-signed request to some other system which does not have access to Atmos
credentials.request
- the request to pre-sign (can be executed at a later time)expiration
- the date at which the pre-signed request becomes invalid and will no longer be acceptedexpiration
java.net.MalformedURLException
- if the configured Atmos endpoint is syntactically invalid.<T> GenericResponse<T> execute(PreSignedRequest request, java.lang.Class<T> resultType, java.lang.Object content) throws java.net.URISyntaxException
request
- A pre-signed request generated by calling
preSignRequest(com.emc.atmos.api.request.Request, java.util.Date)
.resultType
- (optional) The type of object to return. This can be any object type supported by the
implementation.content
- (optional) The body content to send in the request (i.e. the object content for a
create-object request). Can be any object type supported by the implementation.java.net.URISyntaxException
- if the URL in the pre-signed request is syntactically invalid.java.lang.String createSubtenant(CreateSubtenantRequest request)
request
- The CreateSubtenantRequest
containing the parameters for
the new subtenant.