Package fr.gouv.vitam.storage.offers.core

# Interface DefaultOfferService

All Known Implementing Classes:
  `DefaultOfferServiceImpl`, `SanityCheckOfferServiceDecorator`

public interface DefaultOfferService
Default offer service interface define offer methods

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `STORAGE_CONF_FILE_NAME`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `StorageBulkPutResult`
  `bulkPutObjects(String containerName, List<String> objectIds, MultiplexedStreamReader multiplexedStreamReader, DataCategory type, DigestType digestType)`
  `Map<String,AccessRequestStatus>`
  `checkAccessRequestStatuses(List<String> accessRequestId, boolean adminCrossTenantAccessRequestAllowed)`
  `boolean`
  `checkObjectAvailability(String containerName, List<String> objectsIds)`
  `void`
  `compactOfferLogs()`
  `String`
  `createAccessRequest(String containerName, List<String> objectIds)`
  Create access request (asynchronous read from tape to local FS) for the given @containerName and objects list.
  `String`
  `createObject(String containerName, String objectId, InputStream objectPart, DataCategory type, long size, DigestType digestType)`
  Create object on container with objectId Receive object part of object.
  `void`
  `deleteObject(String containerName, String objectId, DataCategory type)`
  Deletes a object representing the data at location containerName/objectName
  `StorageBulkMetadataResult`
  `getBulkMetadata(String containerName, List<String> objectIds, Boolean noCache)`
  `ContainerInformation`
  `getCapacity(String containerName)`
  Get container capacity
  `StorageMetadataResult`
  `getMetadata(String containerName, String objectId, boolean noCache)`
  Get Metadata
  `ObjectContent`
  `getObject(String containerName, String objectId)`
  Get object on offer as an inputStream
  `String`
  `getObjectDigest(String containerName, String objectId, DigestType digestAlgorithm)`
  Get offer storage digest of object
  `List<OfferLog>`
  `getOfferLogs(String containerName, Long offset, int limit, Order order)`
  Get the offer log of objects created in offer container
  `boolean`
  `isObjectExist(String containerName, String objectId)`
  Check if object exists
  `void`
  `listObjects(String containerName, ObjectListingListener objectListingListener)`
  List container objects
  `void`
  `removeAccessRequest(String accessRequestId, boolean adminCrossTenantAccessRequestAllowed)`

- ## Field Details

  - ### STORAGE_CONF_FILE_NAME

    static final String STORAGE_CONF_FILE_NAME
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getObjectDigest

    String getObjectDigest(String containerName, String objectId, DigestType digestAlgorithm) throws ContentAddressableStorageException
    Get offer storage digest of object
    Parameters:
      `containerName` - the container with the object
      `objectId` - the object name / id
      `digestAlgorithm` - the digest algorithm
    Returns:
      the offer computed digest
    Throws:
      `ContentAddressableStorageException` - thrown on storage error

  - ### getObject

    ObjectContent getObject(String containerName, String objectId) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
    Get object on offer as an inputStream
    Parameters:
      `containerName` - the container containing the object
      `objectId` - the object id
    Returns:
      the object included in a response
    Throws:
      `ContentAddressableStorageNotFoundException` - thrown when object does not exists
      `ContentAddressableStorageException` - thrown when a server error occurs

  - ### createAccessRequest

    String createAccessRequest(String containerName, List<String> objectIds) throws ContentAddressableStorageException
    Create access request (asynchronous read from tape to local FS) for the given @containerName and objects list. Return access request id
    Parameters:
      `containerName` - the container containing the object
      `objectIds` - the objects ids
    Returns:
      acess request id
    Throws:
      `ContentAddressableStorageNotFoundException` - thrown when object does not exists
      `ContentAddressableStorageException` - thrown when a server error occurs

  - ### checkAccessRequestStatuses

    Map<String,AccessRequestStatus> checkAccessRequestStatuses(List<String> accessRequestId, boolean adminCrossTenantAccessRequestAllowed) throws ContentAddressableStorageException
    Throws:
      `ContentAddressableStorageException`

  - ### removeAccessRequest

    void removeAccessRequest(String accessRequestId, boolean adminCrossTenantAccessRequestAllowed) throws ContentAddressableStorageException
    Throws:
      `ContentAddressableStorageException`

  - ### checkObjectAvailability

    boolean checkObjectAvailability(String containerName, List<String> objectsIds) throws ContentAddressableStorageException
    Throws:
      `ContentAddressableStorageException`

  - ### createObject

    String createObject(String containerName, String objectId, InputStream objectPart, DataCategory type, long size, DigestType digestType) throws ContentAddressableStorageException
    Create object on container with objectId Receive object part of object. Actually these parts HAVE TO be send in the great order.
    Parameters:
      `containerName` - the container name
      `objectId` - the offer objectId to create
      `objectPart` - the part of the object to create (chunk style)
      `type` - the object type to create
      `size` - inputstream size
      `digestType` - digest of object
    Returns:
      the digest of the complete file or the digest of the chunk
    Throws:
      `ContentAddressableStorageException` - if the container does not exist

  - ### bulkPutObjects

    StorageBulkPutResult bulkPutObjects(String containerName, List<String> objectIds, MultiplexedStreamReader multiplexedStreamReader, DataCategory type, DigestType digestType) throws ContentAddressableStorageException, IOException
    Throws:
      `ContentAddressableStorageException`
      `IOException`

  - ### isObjectExist

    boolean isObjectExist(String containerName, String objectId) throws ContentAddressableStorageException
    Check if object exists
    Parameters:
      `containerName` - the container suppose to contain the object
      `objectId` - the objectId to check
    Returns:
      true if object exists, false otherwise
    Throws:
      `ContentAddressableStorageServerException`
      `ContentAddressableStorageException`

  - ### getCapacity

    ContainerInformation getCapacity(String containerName) throws ContentAddressableStorageException
    Get container capacity
    Parameters:
      `containerName` - the container name
    Returns:
      Json with usableSpace information
    Throws:
      `ContentAddressableStorageNotFoundException` - thrown if the container does not exist
      `ContentAddressableStorageServerException`
      `ContentAddressableStorageException`

  - ### deleteObject

    void deleteObject(String containerName, String objectId, DataCategory type) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
    Deletes a object representing the data at location containerName/objectName
    Parameters:
      `containerName` - container where this exists.
      `objectId` - the objectId to delete
      `type` - the object type to delete
    Throws:
      `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 failure

  - ### getMetadata

    StorageMetadataResult getMetadata(String containerName, String objectId, boolean noCache) throws ContentAddressableStorageException
    Get Metadata
    Parameters:
      `containerName` -
      `objectId` -
      `noCache` -
    Returns:
      StorageMetadataResult
    Throws:
      `ContentAddressableStorageException`
      `IOException`

  - ### getOfferLogs

    List<OfferLog> getOfferLogs(String containerName, Long offset, int limit, Order order) throws ContentAddressableStorageException
    Get the offer log of objects created in offer container
    Parameters:
      `containerName` - container the container name
      `offset` - the offset of the object before the wanted list
      `limit` - number of objects wanted
      `order` - order of search
    Returns:
      list of object informations
    Throws:
      `ContentAddressableStorageDatabaseException` - Database error
      `ContentAddressableStorageServerException` - Parsing error
      `ContentAddressableStorageException`

  - ### listObjects

    void listObjects(String containerName, ObjectListingListener objectListingListener) throws IOException, ContentAddressableStorageException
    List container objects
    Parameters:
      `containerName` - the container name
      `objectListingListener` - a listener to which are reported found object entries
    Throws:
      `IOException`
      `ContentAddressableStorageException`

  - ### compactOfferLogs

    void compactOfferLogs() throws Exception
    Throws:
      `Exception`

  - ### getBulkMetadata

    StorageBulkMetadataResult getBulkMetadata(String containerName, List<String> objectIds, Boolean noCache) throws ContentAddressableStorageException
    Throws:
      `ContentAddressableStorageException`