public interface StorageAdapter
| Modifier and Type | Method and Description |
|---|---|
void |
abortTransaction(java.lang.String transactionID)
Abort a transaction.
|
StorageMetadata |
commitTransaction(java.lang.String transactionID)
Commit a transaction.
|
void |
delete(org.opencadc.inventory.StorageLocation storageLocation)
Delete from storage the artifact identified by storageLocation.
|
void |
get(org.opencadc.inventory.StorageLocation storageLocation,
java.io.OutputStream dest)
Get from storage the artifact identified by storageLocation.
|
void |
get(org.opencadc.inventory.StorageLocation storageLocation,
java.io.OutputStream dest,
ByteRange byteRange)
Get parts of a stored object specified by one or more byte ranges.
|
PutTransaction |
getTransactionStatus(java.lang.String transactionID)
Get current transaction status.
|
java.util.Iterator<StorageMetadata> |
iterator()
Iterator of items ordered by StorageLocation.
|
java.util.Iterator<StorageMetadata> |
iterator(java.lang.String storageBucketPrefix)
Iterate over StorageMetadata ordered by their StorageLocation.
|
StorageMetadata |
put(NewArtifact newArtifact,
java.io.InputStream source,
java.lang.String transactionID)
Write an artifact to storage.
|
PutTransaction |
revertTransaction(java.lang.String transactionID)
Revert a transaction to a previous state.
|
PutTransaction |
startTransaction(java.net.URI artifactURI,
java.lang.Long contentLength)
Start a transaction for a PUT operation.
|
void get(org.opencadc.inventory.StorageLocation storageLocation,
java.io.OutputStream dest)
throws java.lang.InterruptedException,
ca.nrc.cadc.net.ResourceNotFoundException,
ca.nrc.cadc.io.ReadException,
ca.nrc.cadc.io.WriteException,
StorageEngageException,
ca.nrc.cadc.net.TransientException
storageLocation - the storage location containing storageID and storageBucketdest - the destination streamjava.lang.InterruptedException - if thread receives an interruptca.nrc.cadc.net.ResourceNotFoundException - if the artifact could not be foundca.nrc.cadc.io.ReadException - if the storage system failed to streamca.nrc.cadc.io.WriteException - if the client failed to streamStorageEngageException - if the adapter failed to interact with storageca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurredvoid get(org.opencadc.inventory.StorageLocation storageLocation,
java.io.OutputStream dest,
ByteRange byteRange)
throws java.lang.InterruptedException,
ca.nrc.cadc.net.ResourceNotFoundException,
ca.nrc.cadc.io.ReadException,
ca.nrc.cadc.io.WriteException,
StorageEngageException,
ca.nrc.cadc.net.TransientException
storageLocation - the object to readdest - the destination streambyteRange - a single byte range to retrievejava.lang.InterruptedException - if thread receives an interruptca.nrc.cadc.net.ResourceNotFoundException - if the artifact could not be foundca.nrc.cadc.io.ReadException - if the storage system failed to streamca.nrc.cadc.io.WriteException - if the client failed to streamStorageEngageException - if the adapter failed to interact with storageca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurredStorageMetadata put(NewArtifact newArtifact, java.io.InputStream source, java.lang.String transactionID) throws ca.nrc.cadc.io.ByteLimitExceededException, java.lang.IllegalArgumentException, ca.nrc.cadc.net.IncorrectContentChecksumException, ca.nrc.cadc.net.IncorrectContentLengthException, java.lang.InterruptedException, ca.nrc.cadc.io.ReadException, ca.nrc.cadc.io.WriteException, StorageEngageException, ca.nrc.cadc.net.TransientException
newArtifact - The holds information about the incoming artifact. if the contentChecksum
and contentLength are set, they will be used to validate the bytes received.source - The stream from which to read.transactionID - existing transactionID or null for auto-commitca.nrc.cadc.io.ByteLimitExceededException - if content length exceeds internal limitjava.lang.IllegalArgumentException - if the newArtifact is invalid or the transaction does not existca.nrc.cadc.net.IncorrectContentChecksumException - if the calculated checksum does not match the expected
checksum as described in newArtifact.ca.nrc.cadc.net.IncorrectContentLengthException - if the calculated length does not match the expected
length as described in newArtifact.java.lang.InterruptedException - if thread receives an interruptca.nrc.cadc.io.ReadException - if the client failed to stream.ca.nrc.cadc.io.WriteException - if the storage system failed to stream.StorageEngageException - if the adapter failed to interact with storage.ca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurred.void delete(org.opencadc.inventory.StorageLocation storageLocation)
throws ca.nrc.cadc.net.ResourceNotFoundException,
java.io.IOException,
java.lang.InterruptedException,
StorageEngageException,
ca.nrc.cadc.net.TransientException
storageLocation - Identifies the artifact to delete.ca.nrc.cadc.net.ResourceNotFoundException - if the artifact could not be found.java.io.IOException - if an unrecoverable error occurred.java.lang.InterruptedException - if thread receives an interruptStorageEngageException - if the adapter failed to interact with storage.ca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurred.PutTransaction startTransaction(java.net.URI artifactURI, java.lang.Long contentLength) throws StorageEngageException, ca.nrc.cadc.net.TransientException
artifactURI - artifact identifiercontentLength - complete length of the dataStorageEngageException - if the adapter failed to interact with storageca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurredPutTransaction revertTransaction(java.lang.String transactionID) throws java.lang.IllegalArgumentException, StorageEngageException, ca.nrc.cadc.net.TransientException, java.lang.UnsupportedOperationException
transactionID - existing transaction IDjava.lang.IllegalArgumentException - if the specified transaction does not existStorageEngageException - if the adapter failed to interact with storageca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurredjava.lang.UnsupportedOperationException - if the transaction cannot be revertedStorageMetadata commitTransaction(java.lang.String transactionID) throws java.lang.IllegalArgumentException, StorageEngageException, ca.nrc.cadc.net.TransientException
transactionID - existing transaction IDjava.lang.IllegalArgumentException - if the specified transaction does not existStorageEngageException - if the adapter failed to interact with storageca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurredvoid abortTransaction(java.lang.String transactionID)
throws java.lang.IllegalArgumentException,
StorageEngageException,
ca.nrc.cadc.net.TransientException
transactionID - existing transaction IDjava.lang.IllegalArgumentException - if the specified transaction does not existStorageEngageException - if the adapter failed to interact with storageca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurredPutTransaction getTransactionStatus(java.lang.String transactionID) throws java.lang.IllegalArgumentException, StorageEngageException, ca.nrc.cadc.net.TransientException
transactionID - existing transaction IDjava.lang.IllegalArgumentException - if the specified transaction does not existStorageEngageException - if the adapter failed to interact with storageca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurredjava.util.Iterator<StorageMetadata> iterator() throws StorageEngageException, ca.nrc.cadc.net.TransientException
StorageEngageException - if the adapter failed to interact with storage.ca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurred.java.util.Iterator<StorageMetadata> iterator(java.lang.String storageBucketPrefix) throws StorageEngageException, ca.nrc.cadc.net.TransientException
storageBucketPrefix - null, partial, or complete storageBucket stringStorageEngageException - if the adapter failed to interact with storage.ca.nrc.cadc.net.TransientException - if an unexpected, temporary exception occurred.