Interface StorageDistribution

    • Method Detail

      • copyObjectFromOfferToOffer

        StoredInfoResult copyObjectFromOfferToOffer​(DataContext context,
                                                    java.lang.String sourceOffer,
                                                    java.lang.String destinationOffer)
                                             throws StorageException
        copy object from on offer to an another
        Parameters:
        context - the context
        destinationOffer - destination Offer
        sourceOffer - source offer
        Returns:
        StoredInfoResult Object
        Throws:
        StorageException - StorageException
      • storeDataInAllOffers

        StoredInfoResult storeDataInAllOffers​(java.lang.String strategyId,
                                              java.lang.String objectId,
                                              ObjectDescription createObjectDescription,
                                              DataCategory category,
                                              java.lang.String requester)
                                       throws StorageException
        Store data of any type for given tenant on storage offers associated to given strategy
        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
        Throws:
        StorageException - StorageException
      • storeDataInOffers

        StoredInfoResult storeDataInOffers​(java.lang.String strategyId,
                                           java.lang.String objectId,
                                           DataCategory category,
                                           java.lang.String requester,
                                           java.util.List<java.lang.String> offerIds,
                                           javax.ws.rs.core.Response response)
                                    throws StorageException
        Store data of any type for given tenant on the given storage offer.
        Parameters:
        strategyId - id of the strategy
        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 identfier
        response - the response
        Returns:
        a StoredInfoResult containing informations about the created Data
        Throws:
        StorageException - StorageException
      • storeDataInOffers

        StoredInfoResult storeDataInOffers​(java.lang.String strategyId,
                                           StreamAndInfo streamAndInfo,
                                           java.lang.String objectId,
                                           DataCategory category,
                                           java.lang.String requester,
                                           java.util.List<java.lang.String> offerIds)
                                    throws StorageException
        Parameters:
        strategyId - id of the strategy
        streamAndInfo - streamAndInfo
        objectId - id of the object
        category - the object type to list
        requester - the requester information
        offerIds - offer identfiers
        Returns:
        StoredInfoResult
        Throws:
        StorageException - StorageException
      • getOfferIds

        java.util.List<java.lang.String> getOfferIds​(java.lang.String strategyId)
                                              throws StorageException
        get offer ids list
        Parameters:
        strategyId - strategy id
        Returns:
        offers ids list
        Throws:
        StorageException
      • getContainerInformation

        com.fasterxml.jackson.databind.JsonNode getContainerInformation​(java.lang.String strategyId)
                                                                 throws StorageException
        Get Storage Information (availability and capacity) for the requested tenant + strategy
        Parameters:
        strategyId - id of the strategy
        Returns:
        a JsonNode containing informations about the storage
        Throws:
        StorageNotFoundException - Thrown if the Container does not exist
        StorageTechnicalException - Thrown in case of any technical problem
        StorageException
      • listContainerObjects

        CloseableIterator<ObjectEntry> listContainerObjects​(java.lang.String strategyId,
                                                            DataCategory category)
                                                     throws StorageException
        List container objects
        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
      • getOfferLogs

        RequestResponse<OfferLog> getOfferLogs​(java.lang.String strategyId,
                                               DataCategory category,
                                               java.lang.Long offset,
                                               int limit,
                                               Order order)
                                        throws StorageException
        Get offer log from referent
        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

        RequestResponse<OfferLog> getOfferLogsByOfferId​(java.lang.String strategyId,
                                                        java.lang.String offerId,
                                                        DataCategory category,
                                                        java.lang.Long offset,
                                                        int limit,
                                                        Order order)
                                                 throws StorageException
        Get offer log from the given offer
        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

        javax.ws.rs.core.Response getContainerByCategory​(java.lang.String strategyId,
                                                         java.lang.String objectId,
                                                         DataCategory category,
                                                         AccessLogInfoModel logInformation)
                                                  throws StorageException
        Get a specific Object binary data as an input stream

        Parameters:
        strategyId - id of the strategy
        objectId - id of the object
        category - category of the object
        logInformation - information for accessLog
        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
      • getContainerByCategory

        javax.ws.rs.core.Response getContainerByCategory​(java.lang.String strategyId,
                                                         java.lang.String objectId,
                                                         DataCategory category,
                                                         java.lang.String offerId)
                                                  throws StorageException
        Get a specific Object binary data as an input stream

        Parameters:
        strategyId - id of the strategy
        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

        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
        Get a specific Object information
        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

        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
        Verify if object exists. If an offer is not in hot offers in strategy, it is considered as not existing.
        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
      • getStrategies

        java.util.Map<java.lang.String,​StorageStrategy> getStrategies()
                                                                     throws StorageException
        Retrieve all the available storage strategies
        Returns:
        all storage strategies by id
        Throws:
        StorageException - if any unwanted technical issue happens