Package org.cdlib.mrt.s3.service
Class NodeService
java.lang.Object
org.cdlib.mrt.s3.service.NodeService
Interface for Cloud Store
- Author:
- dloy
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNodeService
(String nodeName, long node, org.cdlib.mrt.utility.LoggerInf logger) NodeService
(NodeIO.AccessNode cloudNode, long node, org.cdlib.mrt.utility.LoggerInf logger) -
Method Summary
Modifier and TypeMethodDescriptiondeleteManifest
(org.cdlib.mrt.core.Identifier objectID) Delete cloud manifestdeleteObject
(String key) Delete objectdeleteObject
(org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID) Delete cloud objectorg.cdlib.mrt.utility.LoggerInf
getManifest
(org.cdlib.mrt.core.Identifier objectID) Retrieve cloud manifestgetManifest
(org.cdlib.mrt.core.Identifier objectID, CloudResponse response) Retrieve cloud manifestlong
getNode()
static NodeService
getNodeService
(String nodeName, long node, org.cdlib.mrt.utility.LoggerInf logger) static NodeService
getNodeService
(NodeIO nodes, long node, org.cdlib.mrt.utility.LoggerInf logger) static NodeService
getNodeServiceConfig
(String config, long node, org.cdlib.mrt.utility.LoggerInf logger) void
getObject
(String key, File outFile, CloudResponse response) Retrieve content into a filegetObject
(String key, CloudResponse response) Retrieve cloud objectgetObject
(org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID, CloudResponse response) Retrieve cloud ObjectgetObjectList
(String key) Return content that matches for the length of the keygetObjectList
(String key, int limit) Return a set number of entry metadata based on start keygetObjectMeta
(String key) Retrieve metadata for filegetPreSigned
(long expirationMinutes, String key, String contentType, String contentDisp) getState()
Run mini-regressionisAlive()
is service there - true=yes, false=noboolean
Because of earlier SDSC bug only alpha-numerics could be used in a key.putManifest
(org.cdlib.mrt.core.Identifier objectID, File inputFile) Upload cloud manifestUpload cloud objectUpload cloud objectvoid
restoreObject
(String key, File outFile, CloudResponse response) Retrieve nearline content into a filevoid
setNodeName
(String nodeName) validateDigest
(String key, org.cdlib.mrt.core.MessageDigest digest, long length) Generic validation of stored contentvalidateMd5
(String key, String inMd5) Validate that the md5 digest matches cloud object digest
-
Field Details
-
NAME
- See Also:
-
MESSAGE
- See Also:
-
cloudNode
-
service
-
nodeName
-
bucket
-
node
protected long node -
logger
protected org.cdlib.mrt.utility.LoggerInf logger
-
-
Constructor Details
-
NodeService
public NodeService(String nodeName, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
NodeService
public NodeService(NodeIO.AccessNode cloudNode, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
-
Method Details
-
getNodeServiceConfig
public static NodeService getNodeServiceConfig(String config, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
getNodeService
public static NodeService getNodeService(String nodeName, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
getNodeService
public static NodeService getNodeService(NodeIO nodes, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
getServiceProperties
-
putObject
Upload cloud object- Parameters:
key
- entry key to be addedinputFile
- file to be uploaded- Returns:
- information about upload
- Throws:
org.cdlib.mrt.utility.TException
-
putObject
public CloudResponse putObject(org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID, File inputFile) throws org.cdlib.mrt.utility.TException Upload cloud object- Parameters:
objectID
- 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
public CloudResponse putManifest(org.cdlib.mrt.core.Identifier objectID, File inputFile) throws org.cdlib.mrt.utility.TException Upload cloud manifest- Parameters:
objectID
- Object identifierinputFile
- manifest file to be uploaded- Returns:
- information about upload
- Throws:
org.cdlib.mrt.utility.TException
-
deleteObject
Delete object- Parameters:
key
- cloud object key- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
deleteObject
public CloudResponse deleteObject(org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID) throws org.cdlib.mrt.utility.TException Delete cloud object- Parameters:
objectID
- Object identifierversionID
- Version identifierfileID
- File/component identifier that may contain a directory element- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
deleteManifest
public CloudResponse deleteManifest(org.cdlib.mrt.core.Identifier objectID) throws org.cdlib.mrt.utility.TException Delete cloud manifest- Parameters:
objectID
- Object identifier- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
getObject
public InputStream getObject(org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve cloud Object- Parameters:
objectID
- 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
public InputStream getObject(String key, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve cloud object- Parameters:
key
- cloud object key for object to be returnedresponse
-- Returns:
- input stream of retrieved object
- Throws:
org.cdlib.mrt.utility.TException
-
getObject
public void getObject(String key, File outFile, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve content into a file- Parameters:
key
- cloud object key for object to be returnedoutFile
- file to receive contentresponse
-- Throws:
org.cdlib.mrt.utility.TException
-
restoreObject
public void restoreObject(String key, File outFile, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve nearline content into a file- Parameters:
key
- 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
-
getPreSigned
public CloudResponse getPreSigned(long expirationMinutes, String key, String contentType, String contentDisp) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
getManifest
public InputStream getManifest(org.cdlib.mrt.core.Identifier objectID, CloudResponse response) throws org.cdlib.mrt.utility.TException Retrieve cloud manifest- Parameters:
objectID
- Object identifierresponse
-- Returns:
- input stream of retrieved object
- Throws:
org.cdlib.mrt.utility.TException
-
getManifest
public InputStream getManifest(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
-
getState
Run mini-regression- Returns:
- completion state
- Throws:
org.cdlib.mrt.utility.TException
-
getObjectList
Return content that matches for the length of the key- Parameters:
key
- prefix of content to be returned- Returns:
- CloudResponse with list of matching entries
- Throws:
org.cdlib.mrt.utility.TException
-
getObjectList
Return a set number of entry metadata based on start key- Parameters:
key
- content key of the first outputlimit
- number of returned entries- Returns:
- CloudResponse with list of sequential entries
- Throws:
org.cdlib.mrt.utility.TException
-
validateMd5
Validate that the md5 digest matches cloud object digest- Parameters:
key
- cloud object keyinMd5
- md5 digest value- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
validateDigest
public CloudResponse validateDigest(String key, org.cdlib.mrt.core.MessageDigest digest, long length) throws org.cdlib.mrt.utility.TException Generic validation of stored content- Parameters:
key
- cloud keydigest
- expected Digest and Digest Typelength
- expected file length- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
isAlive
is service there - true=yes, false=no- Returns:
- Throws:
org.cdlib.mrt.utility.TException
-
isAlphaNumericKey
public 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:
-
getNodeName
-
setNodeName
-
getBucket
-
getNode
public long getNode() -
getCloudService
-
getServiceType
-
getLogger
public org.cdlib.mrt.utility.LoggerInf getLogger()
-