public abstract class ContentAddressableStorageJcloudsAbstract extends ContentAddressableStorageAbstract
Modifier and Type | Field and Description |
---|---|
protected org.jclouds.blobstore.BlobStoreContext |
context |
LISTING_MAX_RESULTS
Constructor and Description |
---|
ContentAddressableStorageJcloudsAbstract(StorageConfiguration configuration)
creates a new ContentAddressableStorageImpl with a storage configuration
param
|
Modifier and Type | Method and Description |
---|---|
abstract void |
closeContext()
Close context according to implementation (http client not closed)
|
long |
countObjects(String containerName)
Determines if a container exists
|
void |
createContainer(String containerName)
Creates a container
|
void |
deleteObject(String containerName,
String objectName)
Deletes a object representing the data at location containerName/objectName
|
StorageConfiguration |
getConfiguration() |
abstract ContainerInformation |
getContainerInformation(String containerName)
Get container information like capacity
|
abstract org.jclouds.blobstore.BlobStoreContext |
getContext(StorageConfiguration configuration)
enables the connection to a storage service with the param provided
|
int |
getMaxResults() |
javax.ws.rs.core.Response |
getObject(String containerName,
String objectName)
Retrieves an object representing the data at location containerName/objectName
|
javax.ws.rs.core.Response |
getObjectAsync(String containerName,
String objectName)
Retrieves an object representing the data at location containerName/objectName
|
com.fasterxml.jackson.databind.JsonNode |
getObjectInformation(String containerName,
String objectName)
Retrieves information about an object at location containerName/objectName
|
abstract MetadatasObject |
getObjectMetadatas(String containerName,
String objectId)
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)
|
void |
putObject(String containerName,
String objectName,
InputStream stream,
DigestType digestType,
Long size)
Adds an object representing the data at location containerName/objectName
|
ContentAddressableStorageJcloudsAbstract |
setConfiguration(StorageConfiguration configuration) |
checkObject, computeObjectDigest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public ContentAddressableStorageJcloudsAbstract(StorageConfiguration configuration)
configuration
- StorageConfiguration
public abstract org.jclouds.blobstore.BlobStoreContext getContext(StorageConfiguration configuration)
configuration
- the storage configurationpublic abstract void closeContext()
public void createContainer(String containerName) throws ContentAddressableStorageAlreadyExistException
ContentAddressableStorage
containerName
- name of container to createContentAddressableStorageAlreadyExistException
- Thrown when creating a container while it (containerName)
already existspublic boolean isExistingContainer(String containerName)
ContentAddressableStorage
containerName
- name of containerpublic long countObjects(String containerName) throws ContentAddressableStorageNotFoundException
ContentAddressableStorage
containerName
- name of containerContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.public void putObject(String containerName, String objectName, InputStream stream, DigestType digestType, Long size) throws ContentAddressableStorageException
ContentAddressableStorage
containerName
- 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 javax.ws.rs.core.Response getObject(String containerName, String objectName) throws ContentAddressableStorageException
ContentAddressableStorage
WARNING : use this method only if the response has to be consumed right away. If the response has to be
forwarded, you should use the method getObjectAsync
instead
containerName
- 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 javax.ws.rs.core.Response getObjectAsync(String containerName, String objectName) throws ContentAddressableStorageException
ContentAddressableStorage
containerName
- 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 void deleteObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException
ContentAddressableStorage
containerName
- 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.public boolean isExistingObject(String containerName, String objectName)
ContentAddressableStorage
containerName
- container where the object residesobjectName
- fully qualified name relative to the container.public abstract ContainerInformation getContainerInformation(String containerName) throws ContentAddressableStorageNotFoundException
ContentAddressableStorage
containerName
- the container nameContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.public com.fasterxml.jackson.databind.JsonNode getObjectInformation(String containerName, String objectName) throws ContentAddressableStorageException
ContentAddressableStorage
containerName
- container where the object is.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 failurepublic StorageConfiguration getConfiguration()
public ContentAddressableStorageJcloudsAbstract setConfiguration(StorageConfiguration configuration)
configuration
- the configuration to setpublic int getMaxResults()
public VitamPageSet<? extends VitamStorageMetadata> listContainer(String containerName) throws ContentAddressableStorageNotFoundException
ContentAddressableStorage
containerName
- the container nameContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.public VitamPageSet<? extends VitamStorageMetadata> listContainerNext(String containerName, String nextMarker) throws ContentAddressableStorageNotFoundException
ContentAddressableStorage
containerName
- the container namenextMarker
- the last id of the list to get nextContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.public abstract MetadatasObject getObjectMetadatas(String containerName, String objectId) throws ContentAddressableStorageException, IOException
ContentAddressableStorage
containerName
- the container nameobjectId
- the objectId to checkContentAddressableStorageException
- Thrown when get action failed due some other failureIOException
- if an IOException is encountered with filesCopyright © 2018 Vitam. All rights reserved.