Package fr.gouv.vitam.storage.engine.server.distribution.impl

# Class ReadOnlyShieldStorageDistribution

java.lang.Object
fr.gouv.vitam.storage.engine.server.distribution.impl.ReadOnlyShieldStorageDistribution

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

public class ReadOnlyShieldStorageDistribution extends Object implements StorageDistribution
Proxy StorageDistribution implementation that prevents write operations on ReadOnly deployments (secondary site)

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BulkObjectStoreResponse`
  `bulkCreateFromWorkspace(String strategyId, BulkObjectStoreRequest bulkObjectStoreRequest, String requester)`
  `Map<String,AccessRequestStatus>`
  `checkAccessRequestStatuses(String strategyId, String offerId, List<String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed)`
  `boolean`
  `checkObjectAvailability(String strategyId, String offerId, DataCategory dataCategory, List<String> objectsNames)`
  `Map<String,Boolean>`
  `checkObjectExisting(String strategyId, String objectId, DataCategory category, List<String> offerIds)`
  Verify if object exists.
  `void`
  `close()`
  `StoredInfoResult`
  `copyObjectFromOfferToOffer(DataContext context, String sourceOffer, String destinationOffer)`
  copy object from on offer to an another
  `Optional<String>`
  `createAccessRequestIfRequired(String strategyId, String offerId, DataCategory dataCategory, List<String> objectsNames)`
  `void`
  `deleteObjectInAllOffers(String strategyId, DataContext context)`
  Delete an object
  `void`
  `deleteObjectInOffers(String strategyId, DataContext context, List<String> offers)`
  Delete an object in offers
  `List<BatchObjectInformationResponse>`
  `getBatchObjectInformation(String strategyId, DataCategory type, List<String> objectIds, List<String> offerIds)`
  `jakarta.ws.rs.core.Response`
  `getContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, AccessLogInfoModel logInformation)`
  Get a specific Object binary data as an input stream
  `jakarta.ws.rs.core.Response`
  `getContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, String offerId)`
  Get a specific Object binary data as an input stream
  `com.fasterxml.jackson.databind.JsonNode`
  `getContainerInformation(String strategyId)`
  Get Storage Information (availability and capacity) for the requested tenant + strategy
  `com.fasterxml.jackson.databind.JsonNode`
  `getContainerInformation(String strategyId, DataCategory type, String objectId, List<String> offerIds, boolean noCache)`
  Get a specific Object information
  `List<String>`
  `getOfferIds(String strategyId)`
  get offer ids list
  `RequestResponse<OfferLog>`
  `getOfferLogs(String strategyId, DataCategory category, Long offset, int limit, Order order)`
  Get offer log from referent
  `RequestResponse<OfferLog>`
  `getOfferLogsByOfferId(String strategyId, String offerId, DataCategory category, Long offset, int limit, Order order)`
  Get offer log from the given offer
  `String`
  `getReferentOffer(String strategyId)`
  `Map<String,StorageStrategy>`
  `getStrategies()`
  Retrieve all the available storage strategies
  `jakarta.ws.rs.core.Response`
  `launchOfferLogCompaction(String offerReferenceId, Integer tenantId)`
  `CloseableIterator<ObjectEntry>`
  `listContainerObjects(String strategyId, DataCategory category)`
  List container objects
  `CloseableIterator<ObjectEntry>`
  `listContainerObjectsForOffer(DataCategory category, String offerId, boolean includeDisabled)`
  `void`
  `removeAccessRequest(String strategyId, String offerId, String accessRequestId, boolean adminCrossTenantAccessRequestAllowed)`
  `StoredInfoResult`
  `storeDataInAllOffers(String strategyId, String objectId, ObjectDescription createObjectDescription, DataCategory category, String requester)`
  Store data of any type for given tenant on storage offers associated to given strategy
  `StoredInfoResult`
  `storeDataInOffers(String strategyId, String origin, StreamAndInfo streamAndInfo, String objectId, DataCategory category, String requester, List<String> offerIds)`
  `StoredInfoResult`
  `storeDataInOffers(String strategyId, String origin, String objectId, DataCategory category, String requester, List<String> offerIds, jakarta.ws.rs.core.Response response)`
  Store data of any type for given tenant on the given storage offer.

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

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

- ## Method Details

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `VitamAutoCloseable`

  - ### copyObjectFromOfferToOffer

    public StoredInfoResult copyObjectFromOfferToOffer(DataContext context, String sourceOffer, String destinationOffer)
    Description copied from interface: `StorageDistribution`
    copy object from on offer to an another
    Specified by:
      `copyObjectFromOfferToOffer` in interface `StorageDistribution`
    Parameters:
      `context` - the context
      `sourceOffer` - source offer
      `destinationOffer` - destination Offer
    Returns:
      StoredInfoResult Object

  - ### storeDataInAllOffers

    public StoredInfoResult storeDataInAllOffers(String strategyId, String objectId, ObjectDescription createObjectDescription, DataCategory category, String requester)
    Description copied from interface: `StorageDistribution`
    Store data of any type for given tenant on storage offers associated to given strategy
    Specified by:
      `storeDataInAllOffers` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy
      `objectId` - the workspace URI of the data to be retrieve (and stored in offer)
      `createObjectDescription` - object additional informations
      `category` - the category of the data to store (unit, object...)
      `requester` - the requester information
    Returns:
      a StoredInfoResult containing informations about the created Data

  - ### storeDataInOffers

    public StoredInfoResult storeDataInOffers(String strategyId, String origin, String objectId, DataCategory category, String requester, List<String> offerIds, jakarta.ws.rs.core.Response response)
    Description copied from interface: `StorageDistribution`
    Store data of any type for given tenant on the given storage offer.
    Specified by:
      `storeDataInOffers` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy
      `origin` - origin of the transaction (normal, bulk, offer_sync)
      `objectId` - the workspace URI of the data to be retrieve (and stored in
      `category` - the category of the data to store (unit, object...)
      `requester` - the requester information
      `offerIds` - offer identifiers
      `response` - the response
    Returns:
      a StoredInfoResult containing information about the created Data

  - ### storeDataInOffers

    public StoredInfoResult storeDataInOffers(String strategyId, String origin, StreamAndInfo streamAndInfo, String objectId, DataCategory category, String requester, List<String> offerIds)
    Specified by:
      `storeDataInOffers` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy
      `origin` - origin of the transaction (normal, bulk, offer_sync)
      `streamAndInfo` - streamAndInfo
      `objectId` - id of the object
      `category` - the object type to list
      `requester` - the requester information
      `offerIds` - offer identfiers
    Returns:
      StoredInfoResult

  - ### getOfferIds

    public List<String> getOfferIds(String strategyId) throws StorageException
    Description copied from interface: `StorageDistribution`
    get offer ids list
    Specified by:
      `getOfferIds` in interface `StorageDistribution`
    Parameters:
      `strategyId` - strategy id
    Returns:
      offers ids list
    Throws:
      `StorageException`

  - ### getContainerInformation

    public com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId) throws StorageException
    Description copied from interface: `StorageDistribution`
    Get Storage Information (availability and capacity) for the requested tenant + strategy
    Specified by:
      `getContainerInformation` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy
    Returns:
      a JsonNode containing informations about the storage
    Throws:
      `StorageException`

  - ### listContainerObjects

    public CloseableIterator<ObjectEntry> listContainerObjects(String strategyId, DataCategory category) throws StorageException
    Description copied from interface: `StorageDistribution`
    List container objects
    Specified by:
      `listContainerObjects` in interface `StorageDistribution`
    Parameters:
      `strategyId` - the strategy id to get offers
      `category` - the object type to list
    Returns:
      a response with object listing
    Throws:
      `StorageException` - thrown in case of any technical problem

  - ### listContainerObjectsForOffer

    public CloseableIterator<ObjectEntry> listContainerObjectsForOffer(DataCategory category, String offerId, boolean includeDisabled) throws StorageException
    Specified by:
      `listContainerObjectsForOffer` in interface `StorageDistribution`
    Throws:
      `StorageException`

  - ### getOfferLogs

    public RequestResponse<OfferLog> getOfferLogs(String strategyId, DataCategory category, Long offset, int limit, Order order) throws StorageException
    Description copied from interface: `StorageDistribution`
    Get offer log from referent
    Specified by:
      `getOfferLogs` in interface `StorageDistribution`
    Parameters:
      `strategyId` - the strategy id to get offers
      `category` - the object type to list
      `offset` - offset of the excluded object
      `limit` - the number of result wanted
      `order` - order
    Returns:
      list of offer log
    Throws:
      `StorageException` - thrown in case of any technical problem

  - ### getOfferLogsByOfferId

    public RequestResponse<OfferLog> getOfferLogsByOfferId(String strategyId, String offerId, DataCategory category, Long offset, int limit, Order order) throws StorageException
    Description copied from interface: `StorageDistribution`
    Get offer log from the given offer
    Specified by:
      `getOfferLogsByOfferId` in interface `StorageDistribution`
    Parameters:
      `strategyId` - the strategy id to get offers
      `offerId` -
      `category` - the object type to list
      `offset` - offset of the excluded object
      `limit` - the number of result wanted
      `order` - order
    Returns:
      list of offer log
    Throws:
      `StorageException` - thrown in case of any technical problem

  - ### getContainerByCategory

    public jakarta.ws.rs.core.Response getContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, AccessLogInfoModel logInformation) throws StorageException
    Description copied from interface: `StorageDistribution`
    Get a specific Object binary data as an input stream

    Specified by:
      `getContainerByCategory` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy
      `origin` - origin
      `objectId` - id of the object
      `category` - category of the object
      `logInformation` - information for accessLog
    Returns:
      an object as a Response with an InputStream
    Throws:
      `StorageException`

  - ### getContainerByCategory

    public jakarta.ws.rs.core.Response getContainerByCategory(String strategyId, String origin, String objectId, DataCategory category, String offerId) throws StorageException
    Description copied from interface: `StorageDistribution`
    Get a specific Object binary data as an input stream

    Specified by:
      `getContainerByCategory` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy
      `origin` - origin
      `objectId` - id of the object
      `category` - category
      `offerId` - offer identfier
    Returns:
      an object as a Response with an InputStream
    Throws:
      `StorageException`

  - ### getContainerInformation

    public com.fasterxml.jackson.databind.JsonNode getContainerInformation(String strategyId, DataCategory type, String objectId, List<String> offerIds, boolean noCache) throws StorageException
    Description copied from interface: `StorageDistribution`
    Get a specific Object information
    Specified by:
      `getContainerInformation` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy
      `type` - data category
      `objectId` - id of the object
      `offerIds` - list id of offers
    Returns:
      JsonNode containing informations about the requested object
    Throws:
      `StorageException`

  - ### checkObjectExisting

    public Map<String,Boolean> checkObjectExisting(String strategyId, String objectId, DataCategory category, List<String> offerIds) throws StorageException
    Description copied from interface: `StorageDistribution`
    Verify if object exists. If an offer is not in hot offers in strategy, it is considered as not existing.
    Specified by:
      `checkObjectExisting` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy
      `objectId` - id of the object
      `category` - category
      `offerIds` - list id of offers
    Returns:
      list of result existence by offerId
    Throws:
      `StorageException` - StorageException

  - ### deleteObjectInAllOffers

    public void deleteObjectInAllOffers(String strategyId, DataContext context)
    Description copied from interface: `StorageDistribution`
    Delete an object
    Specified by:
      `deleteObjectInAllOffers` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy

  - ### deleteObjectInOffers

    public void deleteObjectInOffers(String strategyId, DataContext context, List<String> offers)
    Description copied from interface: `StorageDistribution`
    Delete an object in offers
    Specified by:
      `deleteObjectInOffers` in interface `StorageDistribution`
    Parameters:
      `strategyId` - id of the strategy
      `context` - context
      `offers` - offers

  - ### getBatchObjectInformation

    public List<BatchObjectInformationResponse> getBatchObjectInformation(String strategyId, DataCategory type, List<String> objectIds, List<String> offerIds) throws StorageException
    Specified by:
      `getBatchObjectInformation` in interface `StorageDistribution`
    Throws:
      `StorageException`

  - ### bulkCreateFromWorkspace

    public BulkObjectStoreResponse bulkCreateFromWorkspace(String strategyId, BulkObjectStoreRequest bulkObjectStoreRequest, String requester)
    Specified by:
      `bulkCreateFromWorkspace` in interface `StorageDistribution`

  - ### getStrategies

    public Map<String,StorageStrategy> getStrategies() throws StorageException
    Description copied from interface: `StorageDistribution`
    Retrieve all the available storage strategies
    Specified by:
      `getStrategies` in interface `StorageDistribution`
    Returns:
      all storage strategies by id
    Throws:
      `StorageException` - if any unwanted technical issue happens

  - ### createAccessRequestIfRequired

    public Optional<String> createAccessRequestIfRequired(String strategyId, String offerId, DataCategory dataCategory, List<String> objectsNames) throws StorageException
    Specified by:
      `createAccessRequestIfRequired` in interface `StorageDistribution`
    Throws:
      `StorageException`

  - ### checkAccessRequestStatuses

    public Map<String,AccessRequestStatus> checkAccessRequestStatuses(String strategyId, String offerId, List<String> accessRequestIds, boolean adminCrossTenantAccessRequestAllowed) throws StorageException
    Specified by:
      `checkAccessRequestStatuses` in interface `StorageDistribution`
    Throws:
      `StorageException`

  - ### removeAccessRequest

    public void removeAccessRequest(String strategyId, String offerId, String accessRequestId, boolean adminCrossTenantAccessRequestAllowed) throws StorageException
    Specified by:
      `removeAccessRequest` in interface `StorageDistribution`
    Throws:
      `StorageException`

  - ### checkObjectAvailability

    public boolean checkObjectAvailability(String strategyId, String offerId, DataCategory dataCategory, List<String> objectsNames) throws StorageException
    Specified by:
      `checkObjectAvailability` in interface `StorageDistribution`
    Throws:
      `StorageException`

  - ### getReferentOffer

    public String getReferentOffer(String strategyId) throws StorageTechnicalException, StorageNotFoundException
    Specified by:
      `getReferentOffer` in interface `StorageDistribution`
    Throws:
      `StorageTechnicalException`
      `StorageNotFoundException`

  - ### launchOfferLogCompaction

    public jakarta.ws.rs.core.Response launchOfferLogCompaction(String offerReferenceId, Integer tenantId) throws StorageException
    Specified by:
      `launchOfferLogCompaction` in interface `StorageDistribution`
    Throws:
      `StorageException`