Class DefaultOfferResource

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.Response bulkPutObjects​(DataCategory type, javax.ws.rs.core.HttpHeaders headers, java.io.InputStream input)
      Bulk create or update objects.
      javax.ws.rs.core.Response checkObjectExistence​(DataCategory type, java.lang.String idObject, java.lang.String xTenantId)
      Test the existence of an object
      javax.ws.rs.core.Response createReadOrderRequest​(DataCategory type, java.util.List<java.lang.String> objectsIds, javax.ws.rs.core.HttpHeaders headers)
      Create read order (asynchronous read from tape to local FS) for the given @type and objects ids list.
      javax.ws.rs.core.Response deleteObject​(java.lang.String xTenantId, java.lang.String xDigestAlgorithm, DataCategory type, java.lang.String idObject)
      Delete an Object
      javax.ws.rs.core.Response getBulkObjectMetadata​(DataCategory type, java.lang.String xTenantId, java.lang.Boolean noCache, java.util.List<java.lang.String> objectIds)
      Get bulk metadata of the objects by ids.
      javax.ws.rs.core.Response getCapacity​(java.lang.String xTenantId, DataCategory type)
      Get the information on the offer objects collection (free and used capacity, etc)
      javax.ws.rs.core.Response getContainerList​(java.lang.String xTenantId, DataCategory type)
      Get container object list.
      javax.ws.rs.core.Response getObject​(DataCategory type, @NotNull java.lang.String objectId, javax.ws.rs.core.HttpHeaders headers)
      Get the object data or digest from its id.
      javax.ws.rs.core.Response getObjectMetadata​(DataCategory type, java.lang.String idObject, java.lang.String xTenantId, java.lang.Boolean noCache)
      Get metadata of the object type.
      javax.ws.rs.core.Response getOfferLogs​(java.lang.String xTenantId, DataCategory type, OfferLogRequest offerLogRequest)
      Get log of objects from container
      javax.ws.rs.core.Response getReadOrderRequest​(java.lang.String readOrderRequestId, javax.ws.rs.core.HttpHeaders headers)
      Get read order request
      javax.ws.rs.core.Response putObject​(java.lang.String objectId, DataCategory type, javax.ws.rs.core.HttpHeaders headers, java.io.InputStream input)
      Creates or updates an object.
      javax.ws.rs.core.Response removeReadOrderRequest​(java.lang.String readOrderRequestId, javax.ws.rs.core.HttpHeaders headers)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • RE_AUTHENTICATION_CALL_STREAM_ALREADY_CONSUMED_BUT_NO_FILE_CREATED

        public static final java.lang.String RE_AUTHENTICATION_CALL_STREAM_ALREADY_CONSUMED_BUT_NO_FILE_CREATED
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultOfferResource

        public DefaultOfferResource​(DefaultOfferService defaultOfferService)
        Constructor
        Parameters:
        defaultOfferService -
    • Method Detail

      • getCapacity

        @HEAD
        @Path("/objects/{type}")
        @Produces("application/json")
        public javax.ws.rs.core.Response getCapacity​(@HeaderParam("X-Tenant-Id")
                                                     java.lang.String xTenantId,
                                                     @PathParam("type")
                                                     DataCategory type)
        Get the information on the offer objects collection (free and used capacity, etc)
        Parameters:
        xTenantId - XtenantId
        type - The container type
        Returns:
        information on the offer objects collection
      • getContainerList

        @GET
        @Path("/objects/{type}")
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response getContainerList​(@HeaderParam("X-Tenant-Id")
                                                          java.lang.String xTenantId,
                                                          @PathParam("type")
                                                          DataCategory type)
        Get container object list.
        Parameters:
        xTenantId - the tenant id
        type - object type
        Returns:
        an iterator with each object metadata (actually only the id)
      • getOfferLogs

        @GET
        @Path("/objects/{type}/logs")
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response getOfferLogs​(@HeaderParam("X-Tenant-Id")
                                                      java.lang.String xTenantId,
                                                      @PathParam("type")
                                                      DataCategory type,
                                                      OfferLogRequest offerLogRequest)
        Get log of objects from container
        Parameters:
        xTenantId - the tenant id
        type - object type
        offerLogRequest - request params
        Returns:
        list of objects infos
      • getObject

        @GET
        @Path("/objects/{type}/{id_object}")
        @Consumes("application/json")
        @Produces({"application/octet-stream","application/zip"})
        public javax.ws.rs.core.Response getObject​(@PathParam("type")
                                                   DataCategory type,
                                                   @NotNull @PathParam("id_object")
                                                   @NotNull java.lang.String objectId,
                                                   @Context
                                                   javax.ws.rs.core.HttpHeaders headers)
        Get the object data or digest from its id.

        HEADER X-Tenant-Id (mandatory) : tenant's identifier HEADER "X-type" (optional) : data (dfault) or digest

        Parameters:
        type - Object type
        objectId - object id :.+ in order to get all path if some '/' are provided
        headers - http header
        Returns:
        response
        Throws:
        java.io.IOException - when there is an error of get object
      • createReadOrderRequest

        @POST
        @Path("/readorder/{type}")
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response createReadOrderRequest​(@PathParam("type")
                                                                DataCategory type,
                                                                java.util.List<java.lang.String> objectsIds,
                                                                @Context
                                                                javax.ws.rs.core.HttpHeaders headers)
        Create read order (asynchronous read from tape to local FS) for the given @type and objects ids list.

        HEADER X-Tenant-Id (mandatory) : tenant's identifier HEADER "X-type" (optional) : data (dfault) or digest

        Parameters:
        type - Object type
        objectsIds - objects ids :.+ in order to get all path if some '/' are provided
        headers - http header
        Returns:
        response
      • getReadOrderRequest

        @GET
        @Path("/readorder/{readOrderRequestId}")
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response getReadOrderRequest​(@PathParam("readOrderRequestId")
                                                             java.lang.String readOrderRequestId,
                                                             @Context
                                                             javax.ws.rs.core.HttpHeaders headers)
        Get read order request

        HEADER X-Tenant-Id (mandatory) : tenant's identifier HEADER "X-type" (optional) : data (dfault) or digest

        Parameters:
        readOrderRequestId - the read request ID
        Returns:
        response
      • removeReadOrderRequest

        @DELETE
        @Path("/readorder/{readOrderRequestId}")
        @Consumes("application/json")
        @Produces("application/json")
        public javax.ws.rs.core.Response removeReadOrderRequest​(@PathParam("readOrderRequestId")
                                                                java.lang.String readOrderRequestId,
                                                                @Context
                                                                javax.ws.rs.core.HttpHeaders headers)
      • putObject

        @PUT
        @Path("/objects/{type}/{objectId:.+}")
        @Consumes("application/octet-stream")
        @Produces("application/json")
        public javax.ws.rs.core.Response putObject​(@PathParam("objectId")
                                                   java.lang.String objectId,
                                                   @PathParam("type")
                                                   DataCategory type,
                                                   @Context
                                                   javax.ws.rs.core.HttpHeaders headers,
                                                   java.io.InputStream input)
        Creates or updates an object.
        Parameters:
        type - Object's type
        objectId - the object id
        headers - http header
        Returns:
        structured response with the object id
      • bulkPutObjects

        @PUT
        @Path("/bulk/objects/{type}")
        @Consumes("application/octet-stream")
        @Produces("application/json")
        public javax.ws.rs.core.Response bulkPutObjects​(@PathParam("type")
                                                        DataCategory type,
                                                        @Context
                                                        javax.ws.rs.core.HttpHeaders headers,
                                                        java.io.InputStream input)
        Bulk create or update objects.
        Parameters:
        type - Object's type
        headers - http header
        Returns:
        structured response with the object id
      • deleteObject

        @DELETE
        @Path("/objects/{type}/{id:.+}")
        @Produces("application/json")
        public javax.ws.rs.core.Response deleteObject​(@HeaderParam("X-Tenant-Id")
                                                      java.lang.String xTenantId,
                                                      @HeaderParam("X-digest-algorithm")
                                                      java.lang.String xDigestAlgorithm,
                                                      @PathParam("type")
                                                      DataCategory type,
                                                      @PathParam("id")
                                                      java.lang.String idObject)
        Delete an Object
        Parameters:
        xTenantId - the tenantId
        xDigestAlgorithm - the digest algorithm
        type - Object type to delete
        idObject - the id of the object to be tested
        Returns:
        the response with a specific HTTP status
      • checkObjectExistence

        @HEAD
        @Path("/objects/{type}/{id:.+}")
        public javax.ws.rs.core.Response checkObjectExistence​(@PathParam("type")
                                                              DataCategory type,
                                                              @PathParam("id")
                                                              java.lang.String idObject,
                                                              @HeaderParam("X-Tenant-Id")
                                                              java.lang.String xTenantId)
        Test the existence of an object

        HEADER X-Tenant-Id (mandatory) : tenant's identifier

        Parameters:
        type - Object type to test
        idObject - the id of the object to be tested
        xTenantId - the id of the tenant
        Returns:
        the response with a specific HTTP status. If none of DIGEST or DIGEST_ALGORITHM headers is given, an existence test is done and can return 204/404 as response. If only DIGEST or only DIGEST_ALGORITHM header is given, a not implemented exception is thrown. Later, this should respond with 200/409. If both DIGEST and DIGEST_ALGORITHM header are given, a full digest check is done and can return 200/409 as response
      • getObjectMetadata

        @GET
        @Path("/objects/{type}/{id:.+}/metadatas")
        @Produces("application/json")
        public javax.ws.rs.core.Response getObjectMetadata​(@PathParam("type")
                                                           DataCategory type,
                                                           @PathParam("id")
                                                           java.lang.String idObject,
                                                           @HeaderParam("X-Tenant-Id")
                                                           java.lang.String xTenantId,
                                                           @HeaderParam("X-Offer-No-Cache")
                                                           java.lang.Boolean noCache)
        Get metadata of the object type.
        Parameters:
        type - Object type to test
        idObject - the id of the object to be tested
        xTenantId - the id of the tenant
        Returns:
        metadatas
      • getBulkObjectMetadata

        @GET
        @Path("/bulk/objects/{type}/metadata")
        @Produces("application/json")
        @Consumes("application/json")
        public javax.ws.rs.core.Response getBulkObjectMetadata​(@PathParam("type")
                                                               DataCategory type,
                                                               @HeaderParam("X-Tenant-Id")
                                                               java.lang.String xTenantId,
                                                               @HeaderParam("X-Offer-No-Cache")
                                                               java.lang.Boolean noCache,
                                                               java.util.List<java.lang.String> objectIds)
        Get bulk metadata of the objects by ids.
        Parameters:
        type - Object type to test
        xTenantId - the id of the tenant
        Returns:
        metadata by object id