public class Swift extends ContentAddressableStorageAbstract
LISTING_MAX_RESULTS
Constructor and Description |
---|
Swift(Supplier<org.openstack4j.api.OSClient> osClient,
StorageConfiguration configuration)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
createContainer(String containerName)
Abstract method to get authenticated openstack client, allow to switch between Keystone V2 and Keystone V3
|
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
|
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, isExistingContainerInCache
public Swift(Supplier<org.openstack4j.api.OSClient> osClient, StorageConfiguration configuration)
osClient
- the given type of osClient can be OSClientV2, OSClientV3configuration
- StorageConfigurationpublic void createContainer(String containerName) throws ContentAddressableStorageServerException
containerName
- name of container to createContentAddressableStorageServerException
- Thrown when internal server error happenspublic boolean isExistingContainer(String containerName)
ContentAddressableStorage
containerName
- name of containerpublic String 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 String getObjectDigest(String containerName, String objectName, DigestType digestType, boolean noCache) throws ContentAddressableStorageException
ContentAddressableStorage
containerName
- 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 ObjectContent getObject(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 String createReadOrderRequest(String containerName, List<String> objectsIds)
ContentAddressableStorage
containerName
- container where this exists.objectsIds
- list of the fully qualified name relative to the container.public void removeReadOrderRequest(String readRequestID)
ContentAddressableStorage
readRequestID
- the read request ID.public void deleteObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
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.ContentAddressableStorageServerException
public boolean isExistingObject(String containerName, String objectName)
ContentAddressableStorage
containerName
- container where the object residesobjectName
- fully qualified name relative to the container.public ContainerInformation getContainerInformation(String containerName) throws ContentAddressableStorageNotFoundException
ContentAddressableStorage
containerName
- the container nameContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.public MetadatasObject getObjectMetadata(String containerName, String objectId, boolean noCache)
ContentAddressableStorage
containerName
- the container nameobjectId
- the objectId to checkpublic 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 void close()
Copyright © 2019 Vitam. All rights reserved.