public class AmazonS3V1 extends ContentAddressableStorageAbstract
LISTING_MAX_RESULTS| Constructor and Description |
|---|
AmazonS3V1(StorageConfiguration configuration)
Constructor
TODO gafou define exceptions + tu
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
createContainer(String containerName)
Creates a container
|
String |
createReadOrderRequest(String containerName,
List<String> objectsIds)
Create read order (asynchronous read from tape to local FS) for the given objects representing the data at location containerName/objectId.
|
void |
deleteObject(String containerName,
String objectName)
Deletes a object representing the data at location containerName/objectName
|
String |
generateBucketName(String containerName)
Generate a valid bucket name from the container name : replace non
alphanumeric values by '.', lowercase every alphabetic value and remove '.
|
ContainerInformation |
getContainerInformation(String containerName)
Get container information like capacity
|
ObjectContent |
getObject(String containerName,
String objectName)
Retrieves an object representing the data at location containerName/objectName
|
String |
getObjectDigest(String containerName,
String objectName,
DigestType digestType,
boolean noCache)
compute Object Digest using a defined algorithm
|
MetadatasObject |
getObjectMetadata(String containerName,
String objectId,
boolean noCache)
get metadata of the object
|
boolean |
isExistingContainer(String containerName)
Determines if a container exists
|
boolean |
isExistingObject(String containerName,
String objectName)
Determines if an object exists
|
VitamPageSet<? extends VitamStorageMetadata> |
listContainer(String containerName)
List container (create cursor)
|
VitamPageSet<? extends VitamStorageMetadata> |
listContainerNext(String containerName,
String nextMarker)
List container (next on cursor)
|
String |
putObject(String containerName,
String objectName,
InputStream stream,
DigestType digestType,
Long size)
Adds an object representing the data at location containerName/objectName
|
void |
removeReadOrderRequest(String readRequestID)
Purge all read request id to cleanup local FS
|
cacheExistsContainer, computeObjectDigest, disableContainerCaching, getConfiguration, isExistingContainerInCachepublic AmazonS3V1(StorageConfiguration configuration) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException
public void createContainer(String containerName) throws ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - name of container to createContentAddressableStorageServerException - Thrown when internal server error happenspublic boolean isExistingContainer(String containerName) throws ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - name of containerContentAddressableStorageServerException - Thrown when internal server error happenspublic String putObject(String containerName, String objectName, InputStream stream, DigestType digestType, Long size) throws ContentAddressableStorageException
ContentAddressableStoragecontainerName - container to place the object.objectName - fully qualified object name relative to the container.stream - the datadigestType - parameter to compute an hash.size - size off the input streamContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageException - Thrown when put action failed due some other failureContentAddressableStorageAlreadyExistException - Thrown when object creating existspublic ObjectContent getObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
ContentAddressableStoragecontainerName - container where this exists.objectName - fully qualified name relative to the container.ContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageException - Thrown when get action failed due some other failureContentAddressableStorageAlreadyExistException - Thrown when object creating existspublic String createReadOrderRequest(String containerName, List<String> objectsIds)
ContentAddressableStoragecontainerName - container where this exists.objectsIds - list of the fully qualified name relative to the container.public void removeReadOrderRequest(String readRequestID)
ContentAddressableStoragereadRequestID - the read request ID.public void deleteObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
ContentAddressableStoragecontainerName - container where this exists.objectName - fully qualified name relative to the container.ContentAddressableStorageNotFoundException - Thrown when the container cannot be located or the blob cannot
be located in the container.ContentAddressableStorageException - Thrown when delete action failed due some other failurepublic boolean isExistingObject(String containerName, String objectName) throws ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - container where the object residesobjectName - fully qualified name relative to the container.ContentAddressableStorageServerException - Thrown when internal server error happenspublic String getObjectDigest(String containerName, String objectName, DigestType digestType, boolean noCache) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException, ContentAddressableStorageException
ContentAddressableStoragecontainerName - container where this exists.objectName - fully qualified name relative to the container.digestType - Digest algonoCache - forces full digest computationContentAddressableStorageNotFoundException - Thrown when the container or the object cannot be locatedContentAddressableStorageServerException - Thrown when internal server error happensContentAddressableStorageException - Thrown when put action failed due some other failurepublic ContainerInformation getContainerInformation(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - the container nameContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerException - Thrown when internal server error happenspublic MetadatasObject getObjectMetadata(String containerName, String objectId, boolean noCache) throws ContentAddressableStorageException, IOException
ContentAddressableStoragecontainerName - the container nameobjectId - the objectId to checkContentAddressableStorageException - Thrown when get action failed due some other failureIOException - if an IOException is encountered with filespublic VitamPageSet<? extends VitamStorageMetadata> listContainer(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - the container nameContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerException - Thrown when internal server error happenspublic VitamPageSet<? extends VitamStorageMetadata> listContainerNext(String containerName, String nextMarker) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
ContentAddressableStoragecontainerName - the container namenextMarker - the last id of the list to get nextContentAddressableStorageNotFoundException - Thrown when the container cannot be located.ContentAddressableStorageServerException - Thrown when internal server error happenspublic void close()
public String generateBucketName(String containerName)
containerName - vitam container namehttps://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.htmlCopyright © 2019 Vitam. All rights reserved.