Package fr.gouv.vitam.common.storage.cas.container.api

# Class ContentAddressableStorageJcloudsAbstract

java.lang.Object
fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorageAbstract
fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorageJcloudsAbstract

All Implemented Interfaces:
  `VitamAutoCloseable`, `ContentAddressableStorage`, `AutoCloseable`

Direct Known Subclasses:
  `FileSystem`, `OpenstackSwift`

public abstract class ContentAddressableStorageJcloudsAbstract extends ContentAddressableStorageAbstract
Abstract class of CAS that contains common methods for a Jclouds backend

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final org.jclouds.blobstore.BlobStoreContext`
  `context`

  ### Fields inherited from class fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorageAbstract

  `LISTING_MAX_RESULTS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContentAddressableStorageJcloudsAbstract(StorageConfiguration configuration)`
  creates a new ContentAddressableStorageImpl with a storage configuration param

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkObjectDigestAndStoreDigest(String containerName, String objectName, String objectDigest, DigestType digestType, long size)`
  Checks objet digest invalid input: '&' update persist its digest in object metadata
  `abstract void`
  `closeContext()`
  Close context according to implementation (http client not closed)
  `void`
  `createContainer(String containerName)`
  Creates a container
  `void`
  `deleteObject(String containerName, String objectName)`
  Deletes a object representing the data at location containerName/objectName
  `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
  `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
  `boolean`
  `isExistingContainer(String containerName)`
  Determines if a container exists
  `boolean`
  `isExistingObject(String containerName, String objectName)`
  Determines if an object exists
  `void`
  `listContainer(String containerName, ObjectListingListener objectListingListener)`
  List container objects
  `void`
  `writeObject(String containerName, String objectName, InputStream inputStream, DigestType digestType, long size)`
  Adds an object representing the data at location containerName/objectName

  ### Methods inherited from class fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorageAbstract

  `cacheExistsContainer, computeObjectDigest, computeObjectDigestAndSize, disableContainerCaching, getConfiguration, isExistingContainerInCache`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface fr.gouv.vitam.common.storage.cas.container.api.ContentAddressableStorage

  `checkAccessRequestStatuses, checkObjectAvailability, createAccessRequest, getObjectMetadata, putObject, removeAccessRequest`

  ### Methods inherited from interface fr.gouv.vitam.common.model.VitamAutoCloseable

  `close`

- ## Field Details

  - ### context

    protected final org.jclouds.blobstore.BlobStoreContext context

- ## Constructor Details

  - ### ContentAddressableStorageJcloudsAbstract

    public ContentAddressableStorageJcloudsAbstract(StorageConfiguration configuration)
    creates a new ContentAddressableStorageImpl with a storage configuration param
    Parameters:
      `configuration` - `StorageConfiguration`

- ## Method Details

  - ### getContext

    public abstract org.jclouds.blobstore.BlobStoreContext getContext(StorageConfiguration configuration)
    enables the connection to a storage service with the param provided
    Parameters:
      `configuration` - the storage configuration
    Returns:
      BlobStoreContext

  - ### closeContext

    public abstract void closeContext()
    Close context according to implementation (http client not closed)

  - ### createContainer

    public void createContainer(String containerName)
    Description copied from interface: `ContentAddressableStorage`
    Creates a container
    Parameters:
      `containerName` - name of container to create

  - ### isExistingContainer

    public boolean isExistingContainer(String containerName)
    Description copied from interface: `ContentAddressableStorage`
    Determines if a container exists
    Parameters:
      `containerName` - name of container
    Returns:
      boolean type

  - ### writeObject

    public void writeObject(String containerName, String objectName, InputStream inputStream, DigestType digestType, long size) throws ContentAddressableStorageException
    Description copied from interface: `ContentAddressableStorage`
    Adds an object representing the data at location containerName/objectName
    Parameters:
      `containerName` - container to place the object.
      `objectName` - fully qualified object name relative to the container.
      `inputStream` - the data
      `digestType` - parameter to compute an hash.
      `size` - size off the input stream
    Throws:
      `ContentAddressableStorageException` - Thrown when put action failed due some other failure

  - ### checkObjectDigestAndStoreDigest

    public void checkObjectDigestAndStoreDigest(String containerName, String objectName, String objectDigest, DigestType digestType, long size) throws ContentAddressableStorageException
    Description copied from interface: `ContentAddressableStorage`
    Checks objet digest invalid input: '&' update persist its digest in object metadata
    Parameters:
      `containerName` - container to place the object.
      `objectName` - fully qualified object name relative to the container.
      `objectDigest` - object digest value
      `digestType` - object digest type
      `size` - size off the input stream
    Throws:
      `ContentAddressableStorageException`

  - ### getObjectDigest

    public String getObjectDigest(String containerName, String objectName, DigestType digestType, boolean noCache) throws ContentAddressableStorageException
    Description copied from interface: `ContentAddressableStorage`
    compute Object Digest using a defined algorithm
    Parameters:
      `containerName` - container where this exists.
      `objectName` - fully qualified name relative to the container.
      `digestType` - Digest algo
      `noCache` - forces full digest computation
    Returns:
      the digest object as String
    Throws:
      `ContentAddressableStorageException` - Thrown when put action failed due some other failure

  - ### getObject

    public ObjectContent getObject(String containerName, String objectName) throws ContentAddressableStorageException
    Description copied from interface: `ContentAddressableStorage`
    Retrieves an object representing the data at location containerName/objectName

    Parameters:
      `containerName` - container where this exists.
      `objectName` - fully qualified name relative to the container.
    Returns:
      the object you intended to receive
    Throws:
      `ContentAddressableStorageException` - Thrown when get action failed due some other failure

  - ### deleteObject

    public void deleteObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException
    Description copied from interface: `ContentAddressableStorage`
    Deletes a object representing the data at location containerName/objectName
    Parameters:
      `containerName` - container where this exists.
      `objectName` - fully qualified name relative to the container.
    Throws:
      `ContentAddressableStorageNotFoundException` - Thrown when the container cannot be located or the blob cannot be located in the container.

  - ### isExistingObject

    public boolean isExistingObject(String containerName, String objectName)
    Description copied from interface: `ContentAddressableStorage`
    Determines if an object exists
    Parameters:
      `containerName` - container where the object resides
      `objectName` - fully qualified name relative to the container.
    Returns:
      boolean type

  - ### getContainerInformation

    public abstract ContainerInformation getContainerInformation(String containerName) throws ContentAddressableStorageNotFoundException
    Description copied from interface: `ContentAddressableStorage`
    Get container information like capacity
    Parameters:
      `containerName` - the container name
    Returns:
      container information like usableSpace
    Throws:
      `ContentAddressableStorageNotFoundException` - Thrown when the container cannot be located.

  - ### listContainer

    public void listContainer(String containerName, ObjectListingListener objectListingListener) throws ContentAddressableStorageNotFoundException, IOException
    Description copied from interface: `ContentAddressableStorage`
    List container objects
    Parameters:
      `containerName` - the container name
    Throws:
      `ContentAddressableStorageNotFoundException` - Thrown when the container cannot be located.
      `IOException`