Class ReadOnlyShieldStorageDistribution

  • All Implemented Interfaces:
    VitamAutoCloseable, StorageDistribution, java.lang.AutoCloseable

    public class ReadOnlyShieldStorageDistribution
    extends java.lang.Object
    implements StorageDistribution
    Proxy StorageDistribution implementation that prevents write operations on ReadOnly deployments (secondary site)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface VitamAutoCloseable
      • copyObjectFromOfferToOffer

        public StoredInfoResult copyObjectFromOfferToOffer​(DataContext context,
                                                           java.lang.String sourceOffer,
                                                           java.lang.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​(java.lang.String strategyId,
                                                     java.lang.String objectId,
                                                     ObjectDescription createObjectDescription,
                                                     DataCategory category,
                                                     java.lang.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​(java.lang.String strategyId,
                                                  java.lang.String origin,
                                                  java.lang.String objectId,
                                                  DataCategory category,
                                                  java.lang.String requester,
                                                  java.util.List<java.lang.String> offerIds,
                                                  javax.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​(java.lang.String strategyId,
                                                  java.lang.String origin,
                                                  StreamAndInfo streamAndInfo,
                                                  java.lang.String objectId,
                                                  DataCategory category,
                                                  java.lang.String requester,
                                                  java.util.List<java.lang.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
      • getOfferLogs

        public RequestResponse<OfferLog> getOfferLogs​(java.lang.String strategyId,
                                                      DataCategory category,
                                                      java.lang.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​(java.lang.String strategyId,
                                                               java.lang.String offerId,
                                                               DataCategory category,
                                                               java.lang.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
        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 javax.ws.rs.core.Response getContainerByCategory​(java.lang.String strategyId,
                                                                java.lang.String origin,
                                                                java.lang.String objectId,
                                                                DataCategory category,
                                                                java.lang.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:
        StorageNotFoundException - Thrown if the Container or the object does not exist
        StorageTechnicalException - thrown if a technical error happened
        StorageException
      • getContainerInformation

        public com.fasterxml.jackson.databind.JsonNode getContainerInformation​(java.lang.String strategyId,
                                                                               DataCategory type,
                                                                               java.lang.String objectId,
                                                                               java.util.List<java.lang.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 java.util.Map<java.lang.String,​java.lang.Boolean> checkObjectExisting​(java.lang.String strategyId,
                                                                                           java.lang.String objectId,
                                                                                           DataCategory category,
                                                                                           java.util.List<java.lang.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
      • deleteObjectInOffers

        public void deleteObjectInOffers​(java.lang.String strategyId,
                                         DataContext context,
                                         java.util.List<java.lang.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