Class FakeDriverImpl.FakeConnectionImpl

    • Method Detail

      • getOfferId

        public java.lang.String getOfferId()
      • getObject

        public StorageGetResult getObject​(StorageObjectRequest objectRequest)
                                   throws StorageDriverException
        Description copied from interface: Connection
        Retrieve an object from the storage offer based on criterias defined in request argument.
        Parameters:
        objectRequest - the request to send. It contains informations needed to retrieve a given object.
        Returns:
        a result that may contains metadatas as well as the binary file
        Throws:
        StorageDriverException - if any problem occurs during request
      • createAccessRequest

        public java.lang.String createAccessRequest​(StorageAccessRequestCreationRequest request)
        Description copied from interface: Connection
        Create an access request for retrieving objects from asynchronous storage offer.
        Parameters:
        request - the request to send. It contains information needed to prepare a given object.
        Returns:
        an AccessRequestId that can be used to check the status of the AccessRequest, and to remove it
      • checkAccessRequestStatuses

        public java.util.Map<java.lang.String,​AccessRequestStatus> checkAccessRequestStatuses​(java.util.List<java.lang.String> accessRequestIds,
                                                                                                    int tenant,
                                                                                                    boolean adminCrossTenantAccessRequestAllowed)
        Description copied from interface: Connection
        Check access request statuses of asynchronous offer.
        Parameters:
        accessRequestIds - the accessRequestIds whose status is to be checked
        tenant - the tenant Id
        adminCrossTenantAccessRequestAllowed - when true, access to access requests of other tenants is allowed from Admin tenant
        Returns:
        a Map of AccessRequestStatus by access request Id
      • removeAccessRequest

        public void removeAccessRequest​(java.lang.String accessRequestId,
                                        int tenant,
                                        boolean adminCrossTenantAccessRequestAllowed)
        Description copied from interface: Connection
        Removes (cancel / delete) and access request for an asynchronous offer. Does nothing is access request id does not exist (idempotency)
        Parameters:
        accessRequestId - the accessRequestId to remove
        tenant - the tenant Id
        adminCrossTenantAccessRequestAllowed - when true, removing access requests of other tenants is allowed from Admin tenant
      • checkObjectAvailability

        public boolean checkObjectAvailability​(StorageCheckObjectAvailabilityRequest request)
        Description copied from interface: Connection
        Check immediate availability of objects from asynchronous storage offer.
        Parameters:
        request - the request to send. It contains information needed to check object availability.
        Returns:
        true if ALL objects are available, otherwise false.
      • putObject

        public StoragePutResult putObject​(StoragePutRequest objectRequest)
                                   throws StorageDriverException
        Description copied from interface: Connection
        Put the object file into the storage offer based on criteria defined in request argument and underlying connection parameters.
        Parameters:
        objectRequest - the request to send. It may contain information needed to store the file.
        Returns:
        a result that may contain metadata or statistics about the object put operation.
        Throws:
        StorageDriverException - if any problem occurs during request
      • removeObject

        public StorageRemoveResult removeObject​(StorageRemoveRequest objectRequest)
        Description copied from interface: Connection
        Delete an object on the distant storage offer.
        Parameters:
        objectRequest - the request to send, it contains information needed to delete an object on the distant store
        Returns:
        a result that may contains metadatas or statistics about the object removal operation.
      • objectExistsInOffer

        public boolean objectExistsInOffer​(StorageObjectRequest request)
        Description copied from interface: Connection
        Check if an object is present in the offer
        Parameters:
        request - the request to send. It contains informations needed to retrieve a given object.
        Returns:
        true if exists, else false
      • listObjects

        public CloseableIterator<ObjectEntry> listObjects​(StorageListRequest request)
        Description copied from interface: Connection
        List object on a container type
        Parameters:
        request - the request contains data needed to list container type
        Returns:
        an iterator with each object metadata
      • getOfferLogs

        public RequestResponse<OfferLog> getOfferLogs​(StorageOfferLogRequest storageOfferLogRequest)
        Description copied from interface: Connection
        Get a listing of offer logs on a container type
        Parameters:
        storageOfferLogRequest - the request contains data needed to retrieve the listing of the container
        Returns:
        the listing of last objects save according to the request
      • launchOfferLogCompaction

        public javax.ws.rs.core.Response launchOfferLogCompaction​(VitamContext vitamContext)
        Description copied from interface: Connection
        launch Offer Log Compaction
        Returns:
        RequestResponse
      • staticConsumeAnyEntityAndClose

        public static void staticConsumeAnyEntityAndClose​(javax.ws.rs.core.Response response)
        This method consume everything (in particular InputStream) and close the response.
        Parameters:
        response -
      • consumeAnyEntityAndClose

        public final void consumeAnyEntityAndClose​(javax.ws.rs.core.Response response)
        Description copied from interface: MockOrRestClient
        Helper when an error occurs on client usage side to consume response however
        Specified by:
        consumeAnyEntityAndClose in interface MockOrRestClient
      • getResourcePath

        public java.lang.String getResourcePath()
        Description copied from interface: MockOrRestClient
        Get the resource path of the server.
        Specified by:
        getResourcePath in interface MockOrRestClient
        Returns:
        the resource path as string
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getClient

        public javax.ws.rs.client.Client getClient()
      • getChunkedClient

        public javax.ws.rs.client.Client getChunkedClient()