Package org.cdlib.mrt.s3.service
Interface CloudStoreInf
- All Known Implementing Classes:
AWSS3Cloud
,AWSS3V2Cloud
,CloudhostAPI
,OpenstackCloud
,PairtreeCloud
,StoreCloud
public interface CloudStoreInf
Interface for Cloud Store
- Author:
- dloy
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondeleteManifest
(String bucketName, org.cdlib.mrt.core.Identifier objectID) Delete cloud manifestdeleteObject
(String bucketName, String key) Delete objectdeleteObject
(String bucketName, org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID) Delete cloud objectRetrieve cloud properties for bucketgetManifest
(String bucketName, org.cdlib.mrt.core.Identifier objectID) Retrieve cloud manifestgetManifest
(String bucketName, org.cdlib.mrt.core.Identifier objectID, CloudResponse response) Retrieve cloud manifestvoid
getObject
(String bucketName, String key, File outFile, CloudResponse response) Retrieve content into a filegetObject
(String bucketName, String key, CloudResponse response) Retrieve cloud objectgetObject
(String bucketName, org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID, CloudResponse response) Retrieve cloud ObjectgetObjectList
(String bucketName) Return info on bucket/containergetObjectList
(String bucketName, String key) Return content that matches for the length of the keygetObjectList
(String bucketName, String key, int limit) Return a set number of entry metadata based on start keygetObjectListAfter
(String bucketName, String afterKey, int limit) Return list of S3 keys after a start keygetObjectMeta
(String bucketName, String fileKey) Retrieve metadata for filegetObjectStreaming
(String bucketName, String key, CloudResponse response) Retrieve cloud object in streaming modegetPreSigned
(long expirationMinutes, String bucketName, String key, String contentType, String contentDisp) Returns an S3 presigned URLgetRangeStream
(String bucketName, String key, long start, long stop, CloudResponse response) Return part of a cloud object as streamReturn state of cloud store managergetType()
Return the API typeDetermine if host:port is availableboolean
Because of earlier SDSC bug only alpha-numerics could be used in a key.putManifest
(String bucketName, org.cdlib.mrt.core.Identifier objectID, File inputFile) Upload cloud manifestUpload cloud objectputObject
(String bucketName, org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID, File inputFile) Upload cloud objectvoid
restoreObject
(String container, String key, File outFile, CloudResponse response) Restore nearline contentvalidateDigest
(String bucketName, String key, org.cdlib.mrt.core.MessageDigest digest, long length) Generic validation of stored contentvalidateMd5
(String bucketName, String key, String inMd5) Validate that the md5 digest matches cloud object digest
-
Method Details
-
putObject
CloudResponse putObject(String bucketName, String key, File inputFile) throws org.cdlib.mrt.utility.TException Upload cloud object- Parameters:
bucketName
- s3 bucket - rackspace containerkey
- entry key to be addedinputFile
- file to be uploaded- Returns:
- information about upload
- Throws:
org.cdlib.mrt.utility.TException
-
putObject
CloudResponse putObject(String bucketName, org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID, File inputFile) throws org.cdlib.mrt.utility.TException Upload cloud object- Parameters:
bucketName
- s3 bucket - rackspace containerobjectID
- Object identifierversionID
- Version identifierfileID
- File/component identifier that may contain a directory elementinputFile
- file to be uploaded- Returns:
- information about upload
- Throws:
org.cdlib.mrt.utility.TException
-
putManifest
CloudResponse putManifest(String bucketName, org.cdlib.mrt.core.Identifier objectID, File inputFile) throws org.cdlib.mrt.utility.TException Upload cloud manifest- Parameters:
bucketName
- s3 bucket - rackspace containerobjectID
- Object identifierinputFile
- manifest file to be uploaded- Returns:
- information about upload
- Throws:
org.cdlib.mrt.utility.TException
-
deleteObject
Delete object- Parameters:
bucketName
- s3 bucket - rackspace containerkey
- cloud object key- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
deleteObject
CloudResponse deleteObject(String bucketName, org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID) throws org.cdlib.mrt.utility.TException Delete cloud object- Parameters:
bucketName
- s3 bucket - rackspace containerobjectID
- Object identifierversionID
- Version identifierfileID
- File/component identifier that may contain a directory element- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
deleteManifest
CloudResponse deleteManifest(String bucketName, org.cdlib.mrt.core.Identifier objectID) throws org.cdlib.mrt.utility.TException Delete cloud manifest- Parameters:
bucketName
- s3 bucket - rackspace containerobjectID
- Object identifier- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
getObject
InputStream getObject(String bucketName, org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve cloud Object- Parameters:
bucketName
- s3 bucket - rackspace containerobjectID
- Object identifierversionID
- Version identifierfileID
- File/component identifier that may contain a directory elementresponse
- input stream of retrieved object- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
getObject
InputStream getObject(String bucketName, String key, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve cloud object- Parameters:
bucketName
- s3 bucket - rackspace containerkey
- cloud object key for object to be returnedresponse
-- Returns:
- input stream of retrieved object
- Throws:
org.cdlib.mrt.utility.TException
-
getObjectStreaming
InputStream getObjectStreaming(String bucketName, String key, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve cloud object in streaming mode- Parameters:
bucketName
- s3 bucket - rackspace containerkey
- cloud object key for object to be returnedresponse
-- Returns:
- input stream of retrieved object
- Throws:
org.cdlib.mrt.utility.TException
-
getObject
void getObject(String bucketName, String key, File outFile, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve content into a file- Parameters:
bucketName
- s3 bucket - rackspace containerkey
- cloud object key for object to be returnedoutFile
- file to receive contentresponse
-- Throws:
org.cdlib.mrt.utility.TException
-
getObjectMeta
Retrieve metadata for file- Parameters:
bucketName
- s3 bucket - rackspace containerfileKey
- cloud object key for object to be returned- Returns:
- exists: named properties; does not exist: null
- Throws:
org.cdlib.mrt.utility.TException
-
getManifest
InputStream getManifest(String bucketName, org.cdlib.mrt.core.Identifier objectID, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve cloud manifest- Parameters:
bucketName
- s3 bucket - rackspace containerobjectID
- Object identifierresponse
-- Returns:
- input stream of retrieved object
- Throws:
org.cdlib.mrt.utility.TException
-
getManifest
InputStream getManifest(String bucketName, org.cdlib.mrt.core.Identifier objectID) throws org.cdlib.mrt.utility.TException Retrieve cloud manifest- Parameters:
bucketName
- s3 bucket - rackspace containerobjectID
- Object identifier- Returns:
- input stream of retrieved manifest
- Throws:
org.cdlib.mrt.utility.TException
-
restoreObject
void restoreObject(String container, String key, File outFile, CloudResponse response) throws org.cdlib.mrt.utility.TException Restore nearline content- Parameters:
containers3
- bucket - rackspace containerkey
- cloud keyoutFile
- target file of responseresponse
-- Throws:
org.cdlib.mrt.utility.TException
-
getObjectList
Return content that matches for the length of the key- Parameters:
bucketName
- s3 bucket - rackspace containerkey
- prefix of content to be returned- Returns:
- CloudResponse with list of matching entries
- Throws:
org.cdlib.mrt.utility.TException
-
getObjectList
CloudResponse getObjectList(String bucketName, String key, int limit) throws org.cdlib.mrt.utility.TException Return a set number of entry metadata based on start key- Parameters:
bucketName
- s3 bucket - rackspace containerkey
- content key of the first outputlimit
- number of returned entries- Returns:
- CloudResponse with list of sequential entries
- Throws:
org.cdlib.mrt.utility.TException
-
getObjectList
Return info on bucket/container- Parameters:
bucketName
- s3 bucket - rackspace container- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
getObjectListAfter
CloudResponse getObjectListAfter(String bucketName, String afterKey, int limit) throws org.cdlib.mrt.utility.TException Return list of S3 keys after a start key- Parameters:
bucketName
- s3 bucketafterKey
- start return list after this valuelimit
- number of keys to return- Returns:
- cloud response with keys
- Throws:
org.cdlib.mrt.utility.TException
-
getState
Return state of cloud store manager- Parameters:
bucketName
- bucket container- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
getCloudProp
Properties getCloudProp()Retrieve cloud properties for bucket- Returns:
-
validateMd5
CloudResponse validateMd5(String bucketName, String key, String inMd5) throws org.cdlib.mrt.utility.TException Validate that the md5 digest matches cloud object digest- Parameters:
bucketName
- s3 bucket - rackspace containerkey
- cloud object keyinMd5
- md5 digest value- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
validateDigest
CloudResponse validateDigest(String bucketName, String key, org.cdlib.mrt.core.MessageDigest digest, long length) throws org.cdlib.mrt.utility.TException Generic validation of stored content- Parameters:
bucketName
- cloud containerkey
- cloud keydigest
- expected Digest and Digest Typelength
- expected file length- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
isAlive
Determine if host:port is available- Parameters:
testUrlS
- - base url for site to be tested- Returns:
- true=alive; false=not alive; null=test not performed
-
getPreSigned
CloudResponse getPreSigned(long expirationMinutes, String bucketName, String key, String contentType, String contentDisp) throws org.cdlib.mrt.utility.TException Returns an S3 presigned URL- Parameters:
expirationMinutes
- minutes for the signed URL to workbucketName
- cloud containerkey
- cloud keycontentType
- optional ContentType for this filecontentDisp
- optional ContentDisposition for this file- Returns:
- CloudResponse where response.getReturnURL returns the presigned URL
- Throws:
org.cdlib.mrt.utility.TException
-
getRangeStream
InputStream getRangeStream(String bucketName, String key, long start, long stop, CloudResponse response) throws org.cdlib.mrt.utility.TException Return part of a cloud object as stream- Parameters:
bucketName
- cloud containerkey
- cloud keystart
- byte location to start from zerostop
- byte location to stop from zeroresponse
- Res[pmse tp reqiest- Returns:
- input stream for segment
- Throws:
org.cdlib.mrt.utility.TException
-
getType
CloudStoreInf.CloudAPI getType()Return the API type- Returns:
- AWS-S3, SDSC-Swift, Cloudhost, Pairtree
-
isAlphaNumericKey
boolean isAlphaNumericKey()Because of earlier SDSC bug only alpha-numerics could be used in a key. true=alpha-numeric key, false=ASCII (current default)- Returns:
-