Class DefaultOfferResource
- java.lang.Object
-
- fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
-
- fr.gouv.vitam.storage.offers.rest.DefaultOfferResource
-
@Path("/offer/v1") @ApplicationPath("webresources") public class DefaultOfferResource extends ApplicationStatusResource
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
RE_AUTHENTICATION_CALL_STREAM_ALREADY_CONSUMED_BUT_NO_FILE_CREATED
-
Fields inherited from class fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
STATUS_URL, TENANTS_URL
-
-
Constructor Summary
Constructors Constructor Description DefaultOfferResource(DefaultOfferService defaultOfferService)
Constructor
-
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 objectjavax.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 Objectjavax.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 containerjavax.ws.rs.core.Response
getReadOrderRequest(java.lang.String readOrderRequestId, javax.ws.rs.core.HttpHeaders headers)
Get read order requestjavax.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 fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
getServerTenants, status
-
-
-
-
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
- XtenantIdtype
- 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 idtype
- 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 idtype
- object typeofferLogRequest
- 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 typeobjectId
- object id :.+ in order to get all path if some '/' are providedheaders
- 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 typeobjectsIds
- objects ids :.+ in order to get all path if some '/' are providedheaders
- 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 requestHEADER 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 typeobjectId
- the object idheaders
- 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 typeheaders
- 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 tenantIdxDigestAlgorithm
- the digest algorithmtype
- Object type to deleteidObject
- 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 objectHEADER X-Tenant-Id (mandatory) : tenant's identifier
- Parameters:
type
- Object type to testidObject
- the id of the object to be testedxTenantId
- 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 testidObject
- the id of the object to be testedxTenantId
- 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 testxTenantId
- the id of the tenant- Returns:
- metadata by object id
-
-