Interface AccessExternalClient
-
- All Superinterfaces:
java.lang.AutoCloseable
,BasicClient
,MockOrRestClient
,VitamAutoCloseable
public interface AccessExternalClient extends BasicClient
Access External Client Interface
-
-
Field Summary
-
Fields inherited from interface fr.gouv.vitam.common.external.client.BasicClient
STATUS_URL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description RequestResponse<com.fasterxml.jackson.databind.JsonNode>
bulkAtomicUpdateUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode updateRequest)
Bulk atomic update of archive units by atomic query.RequestResponse<StatusByAccessRequest>
checkAccessRequestStatuses(VitamContext vitamContext, java.util.Collection<AccessRequestReference> accessRequestReferences)
Bulk check of the status of a set of Access Requests.RequestResponse<com.fasterxml.jackson.databind.JsonNode>
computedInheritedRules(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode ComputedInheritedRulesQuery)
compute inherited rules.RequestResponse<AccessRequestReference>
createObjectAccessRequestByUnitId(VitamContext vitamContext, java.lang.String unitId, java.lang.String usage, int version)
Create an access request for accessing the object of an archive unit stored on an async storage offer (tape storage offer) Access requests for objects stored on non-asynchronous storage offers does NOT require Access Request creation.RequestResponse<com.fasterxml.jackson.databind.JsonNode>
deleteComputedInheritedRules(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode deleteComputedInheritedRulesQuery)
compute inherited rules.RequestResponse<com.fasterxml.jackson.databind.JsonNode>
exportDIP(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode dslRequest)
javax.ws.rs.core.Response
getAccessLog(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode params)
Get AccessLog file matching the given paramsjavax.ws.rs.core.Response
getDIPById(VitamContext vitamContext, java.lang.String dipId)
getDIPById
The caller is responsible to close the Response after consuming the inputStream.javax.ws.rs.core.Response
getObjectStreamByUnitId(VitamContext vitamContext, java.lang.String unitId, java.lang.String usage, int version)
Download the object by parent unit id, qualifier usage & version The caller is responsible to close the Response after consuming the inputStream. When accessing an object stored on tape storage offer that is not available for immediate access, aVitamClientAccessUnavailableDataFromAsyncOfferException
is thrown.javax.ws.rs.core.Response
getTransferById(VitamContext vitamContext, java.lang.String transferId)
Get Transfer SIPRequestResponse<com.fasterxml.jackson.databind.JsonNode>
launchPreservation(VitamContext vitamContext, PreservationRequest preservationRequest)
RequestResponse<com.fasterxml.jackson.databind.JsonNode>
massUpdateUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode updateQuery)
Mass update of archive units.RequestResponse<com.fasterxml.jackson.databind.JsonNode>
massUpdateUnitsRules(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode updateRulesQuery)
Mass update of archive units rules.RequestResponse<com.fasterxml.jackson.databind.JsonNode>
reclassification(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode reclassificationRequest)
Performs a reclassification workflow.RequestResponse<java.lang.Void>
removeAccessRequest(VitamContext vitamContext, AccessRequestReference accessRequestReference)
Removes an Access Request from an async storage offer (tape storage offer).RequestResponse<com.fasterxml.jackson.databind.JsonNode>
revertUpdateUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode revertUpdateQuery)
RequestResponse<LogbookLifecycle>
selectObjectGroupLifeCycleById(VitamContext vitamContext, java.lang.String objectGroupLifeCycleId, com.fasterxml.jackson.databind.JsonNode select)
selectObjectGroupLifeCycleByIdRequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectObjectMetadatasByUnitId(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId)
selectObjectByIdRequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectObjects(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery)
selectObjects /objectsRequestResponse<LogbookOperation>
selectOperationbyId(VitamContext vitamContext, java.lang.String operationId, com.fasterxml.jackson.databind.JsonNode select)
selectOperationbyIdRequestResponse<LogbookOperation>
selectOperations(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode select)
selectOperationRequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectUnitbyId(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId)
selectUnitbyId GET(POST overrided) /units/{id}RequestResponse<LogbookLifecycle>
selectUnitLifeCycleById(VitamContext vitamContext, java.lang.String unitLifeCycleId, com.fasterxml.jackson.databind.JsonNode select)
selectUnitLifeCycleByIdRequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery)
selectUnits /unitsRequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectUnitsWithInheritedRules(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery)
Select units with inherited rules by select query (DSL)RequestResponse<com.fasterxml.jackson.databind.JsonNode>
startEliminationAction(VitamContext vitamContext, EliminationRequestBody eliminationRequestBody)
Performs an elimination action workflow .RequestResponse<com.fasterxml.jackson.databind.JsonNode>
startEliminationAnalysis(VitamContext vitamContext, EliminationRequestBody eliminationRequestBody)
Performs an elimination analysis workflow .JsonLineIterator<com.fasterxml.jackson.databind.JsonNode>
streamUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery)
streamUnits /unitsRequestResponse<com.fasterxml.jackson.databind.JsonNode>
transfer(VitamContext vitamContext, TransferRequest transferRequest)
RequestResponse<com.fasterxml.jackson.databind.JsonNode>
transferReply(VitamContext vitamContext, java.io.InputStream transferReply)
RequestResponse<com.fasterxml.jackson.databind.JsonNode>
updateUnitbyId(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String unitId)
Deprecated.This Method is no longer maintained and is no longer acceptable for updating units.-
Methods inherited from interface fr.gouv.vitam.common.client.MockOrRestClient
checkStatus, checkStatus, close, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
-
-
-
-
Method Detail
-
selectUnits
RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery) throws VitamClientException
selectUnits /units- Parameters:
vitamContext
- the vitam contextselectQuery
- the select query- Returns:
- Json representation
- Throws:
VitamClientException
-
streamUnits
JsonLineIterator<com.fasterxml.jackson.databind.JsonNode> streamUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery) throws VitamClientException
streamUnits /units- Parameters:
vitamContext
- the vitam contextselectQuery
- the select query- Returns:
- Json representation
- Throws:
VitamClientException
-
selectUnitbyId
RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectUnitbyId(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId) throws VitamClientException
selectUnitbyId GET(POST overrided) /units/{id}- Parameters:
vitamContext
- the vitam contextselectQuery
- the select queryunitId
- the unit id to select- Returns:
- Json representation
- Throws:
VitamClientException
-
updateUnitbyId
@Deprecated RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnitbyId(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode updateQuery, java.lang.String unitId) throws VitamClientException
Deprecated.This Method is no longer maintained and is no longer acceptable for updating units.Use
massUpdateUnits(VitamContext, JsonNode)
ormassUpdateUnitsRules(VitamContext, JsonNode)
instead.updateUnitbyId UPDATE /units/{id}- Parameters:
vitamContext
- the vitam contextupdateQuery
- the update queryunitId
- the unit id to update- Returns:
- Json representation
- Throws:
VitamClientException
-
selectObjectMetadatasByUnitId
RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectObjectMetadatasByUnitId(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery, java.lang.String unitId) throws VitamClientException
selectObjectById- Parameters:
vitamContext
- the vitam contextselectQuery
- the select queryunitId
- the unit id for getting object- Returns:
- Json representation
- Throws:
VitamClientException
-
getObjectStreamByUnitId
javax.ws.rs.core.Response getObjectStreamByUnitId(VitamContext vitamContext, java.lang.String unitId, java.lang.String usage, int version) throws VitamClientException
Download the object by parent unit id, qualifier usage & version The caller is responsible to close the Response after consuming the inputStream. When accessing an object stored on tape storage offer that is not available for immediate access, aVitamClientAccessUnavailableDataFromAsyncOfferException
is thrown. Access to object require creating an Access Request using thecreateObjectAccessRequestByUnitId(fr.gouv.vitam.common.client.VitamContext, java.lang.String, java.lang.String, int)
method.- Parameters:
vitamContext
- the vitam contextunitId
- the unit id for getting the objectusage
- kind of usageversion
- the version- Returns:
- Response including InputStream
- Throws:
VitamClientAccessUnavailableDataFromAsyncOfferException
- thrown when access to object in not currently available from async storage offer. Access request required.VitamClientException
- when an error occurs
-
createObjectAccessRequestByUnitId
RequestResponse<AccessRequestReference> createObjectAccessRequestByUnitId(VitamContext vitamContext, java.lang.String unitId, java.lang.String usage, int version) throws VitamClientException, AccessExternalClientNotFoundException
Create an access request for accessing the object of an archive unit stored on an async storage offer (tape storage offer) Access requests for objects stored on non-asynchronous storage offers does NOT require Access Request creation. The status of returned Access Requests should be monitoring periodically (typically every few minutes) to check the availability of data via thecheckAccessRequestStatuses(fr.gouv.vitam.common.client.VitamContext, java.util.Collection<fr.gouv.vitam.common.model.storage.AccessRequestReference>)
method. Once an Access Request status isAccessRequestStatus.READY
, the data can be downloaded, using thegetObjectStreamByUnitId(fr.gouv.vitam.common.client.VitamContext, java.lang.String, java.lang.String, int)
method, within the Access Request expiration delay defined in the tape storage offer configuration by the administrator. CAUTION : After successful download of object, caller SHOULD remove the Access Request using theremoveAccessRequest(fr.gouv.vitam.common.client.VitamContext, fr.gouv.vitam.common.model.storage.AccessRequestReference)
method to free up disk resources on tape storage offer.- Parameters:
vitamContext
- the vitam contextunitId
- the unit id for getting the objectusage
- kind of usageversion
- the version- Returns:
- RequestResponse with an optional
AccessRequestReference
entry. An Access request is created and returned only if required (async storage offer). Otherwise, an empty RequestResponse is returned. - Throws:
AccessExternalClientNotFoundException
- when unit has no object group with such object qualifier usage and versionVitamClientException
- when an error occurs
-
checkAccessRequestStatuses
RequestResponse<StatusByAccessRequest> checkAccessRequestStatuses(VitamContext vitamContext, java.util.Collection<AccessRequestReference> accessRequestReferences) throws VitamClientException
Bulk check of the status of a set of Access Requests. Once Access Request status isAccessRequestStatus.READY
, the object is guaranteed to be available for download using thegetObjectStreamByUnitId(fr.gouv.vitam.common.client.VitamContext, java.lang.String, java.lang.String, int)
method within the Access Request expiration delay defined in the tape storage offer configuration by the administrator. Access Requests are only visible within their tenant. Attempts to check status of Access Requests of another tenant will return aAccessRequestStatus.NOT_FOUND
. Attempts to check an Access Request status for a non-asynchronous storage offer (tape storage offer) throws anVitamClientIllegalAccessRequestOperationOnSyncOfferException
.- Parameters:
vitamContext
- the vitam contextaccessRequestReferences
- the set of Access Requests to check- Returns:
- RequestResponse with of access request statuses.
- Throws:
VitamClientException
- when an error occurs
-
removeAccessRequest
RequestResponse<java.lang.Void> removeAccessRequest(VitamContext vitamContext, AccessRequestReference accessRequestReference) throws VitamClientException
Removes an Access Request from an async storage offer (tape storage offer). After removing an Access Request, object in not more guaranteed to be accessible for download. Attempts to remove an Access Request from a non-asynchronous storage offer throws anVitamClientIllegalAccessRequestOperationOnSyncOfferException
. Attempts to remove an already removed Access Request does NOT throw any error (idempotency). Access Requests are only visible within their tenant. Attempts to remove an Access Request of another tenant does NOT delete access request.- Parameters:
vitamContext
- the vitam contextaccessRequestReference
- the Access Request to remove- Returns:
- RequestResponse.
- Throws:
VitamClientException
- when an error occurs
-
selectOperations
RequestResponse<LogbookOperation> selectOperations(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode select) throws VitamClientException
selectOperation- Parameters:
vitamContext
- the vitam contextselect
- the select query- Returns:
- logbookOperation representation
- Throws:
VitamClientException
-
selectOperationbyId
RequestResponse<LogbookOperation> selectOperationbyId(VitamContext vitamContext, java.lang.String operationId, com.fasterxml.jackson.databind.JsonNode select) throws VitamClientException
selectOperationbyId- Parameters:
vitamContext
- the vitam contextoperationId
- the operation idselect
- the select query- Returns:
- logbookOperation representation
- Throws:
VitamClientException
-
selectUnitLifeCycleById
RequestResponse<LogbookLifecycle> selectUnitLifeCycleById(VitamContext vitamContext, java.lang.String unitLifeCycleId, com.fasterxml.jackson.databind.JsonNode select) throws VitamClientException
selectUnitLifeCycleById- Parameters:
vitamContext
- the vitam contextunitLifeCycleId
- the unit LFC idselect
- the select query- Returns:
- logbooklifecycle representation
- Throws:
VitamClientException
-
selectObjectGroupLifeCycleById
RequestResponse<LogbookLifecycle> selectObjectGroupLifeCycleById(VitamContext vitamContext, java.lang.String objectGroupLifeCycleId, com.fasterxml.jackson.databind.JsonNode select) throws VitamClientException
selectObjectGroupLifeCycleById- Parameters:
vitamContext
- the vitam contextobjectGroupLifeCycleId
- the objectGroup LFC idselect
- the select query- Returns:
- logbooklifecycle representation
- Throws:
VitamClientException
-
exportDIP
RequestResponse<com.fasterxml.jackson.databind.JsonNode> exportDIP(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode dslRequest) throws VitamClientException
- Parameters:
vitamContext
- the vitam context- Returns:
- the result of the information obtained in the DIP
- Throws:
VitamClientException
-
transfer
RequestResponse<com.fasterxml.jackson.databind.JsonNode> transfer(VitamContext vitamContext, TransferRequest transferRequest) throws VitamClientException
- Throws:
VitamClientException
-
getDIPById
javax.ws.rs.core.Response getDIPById(VitamContext vitamContext, java.lang.String dipId) throws VitamClientException
getDIPById
The caller is responsible to close the Response after consuming the inputStream.- Parameters:
vitamContext
- the vitam contextdipId
- the previously generated DIP id to download the DIP- Returns:
- Response including InputStream
- Throws:
VitamClientException
-
getTransferById
javax.ws.rs.core.Response getTransferById(VitamContext vitamContext, java.lang.String transferId) throws VitamClientException
Get Transfer SIP- Parameters:
vitamContext
-transferId
-- Returns:
- Throws:
VitamClientException
-
reclassification
RequestResponse<com.fasterxml.jackson.databind.JsonNode> reclassification(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode reclassificationRequest) throws VitamClientException
Performs a reclassification workflow.- Parameters:
vitamContext
- the vitam contextreclassificationRequest
- List of attachment and detachment operations in unit graph.- Returns:
- Response
- Throws:
VitamClientException
- VitamClientException
-
massUpdateUnits
RequestResponse<com.fasterxml.jackson.databind.JsonNode> massUpdateUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode updateQuery) throws VitamClientException
Mass update of archive units.- Parameters:
vitamContext
- the vitam contextupdateQuery
- the update query- Returns:
- Json representation
- Throws:
VitamClientException
-
massUpdateUnitsRules
RequestResponse<com.fasterxml.jackson.databind.JsonNode> massUpdateUnitsRules(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode updateRulesQuery) throws VitamClientException
Mass update of archive units rules.- Parameters:
vitamContext
- the vitam contextupdateRulesQuery
- the update request (query and actions)- Returns:
- Json representation
- Throws:
VitamClientException
-
revertUpdateUnits
RequestResponse<com.fasterxml.jackson.databind.JsonNode> revertUpdateUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode revertUpdateQuery) throws VitamClientException
- Throws:
VitamClientException
-
bulkAtomicUpdateUnits
RequestResponse<com.fasterxml.jackson.databind.JsonNode> bulkAtomicUpdateUnits(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode updateRequest) throws VitamClientException
Bulk atomic update of archive units by atomic query.- Parameters:
vitamContext
- the vitam contextupdateQuery
- the bulk atomic update request- Returns:
- Json representation
- Throws:
VitamClientException
-
selectObjects
RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectObjects(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery) throws VitamClientException
selectObjects /objects- Parameters:
vitamContext
- the vitam contextselectQuery
- the select query- Returns:
- Json representation
- Throws:
VitamClientException
-
selectUnitsWithInheritedRules
RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectUnitsWithInheritedRules(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode selectQuery) throws VitamClientException
Select units with inherited rules by select query (DSL)- Parameters:
vitamContext
- the vitam contextselectQuery
- the select query- Returns:
- Json representation
- Throws:
VitamClientException
-
startEliminationAnalysis
RequestResponse<com.fasterxml.jackson.databind.JsonNode> startEliminationAnalysis(VitamContext vitamContext, EliminationRequestBody eliminationRequestBody) throws VitamClientException
Performs an elimination analysis workflow .- Parameters:
eliminationRequestBody
- Object Body DSL request for elimination and Date- Returns:
- Json representation
- Throws:
VitamClientException
- VitamClientException
-
startEliminationAction
RequestResponse<com.fasterxml.jackson.databind.JsonNode> startEliminationAction(VitamContext vitamContext, EliminationRequestBody eliminationRequestBody) throws VitamClientException
Performs an elimination action workflow .- Parameters:
eliminationRequestBody
- Object Body DSL request for elimination and Date- Returns:
- Json representation
- Throws:
VitamClientException
- VitamClientException
-
getAccessLog
javax.ws.rs.core.Response getAccessLog(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode params) throws VitamClientException
Get AccessLog file matching the given params- Parameters:
vitamContext
- the vitam contextparams
- Could contains StartDate and EndDate information for file filter- Returns:
- accesslog file
- Throws:
VitamClientException
-
computedInheritedRules
RequestResponse<com.fasterxml.jackson.databind.JsonNode> computedInheritedRules(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode ComputedInheritedRulesQuery) throws VitamClientException
compute inherited rules.- Parameters:
vitamContext
- the vitam contextComputedInheritedRulesQuery
- the query request (query and actions)- Returns:
- Json representation
- Throws:
VitamClientException
-
deleteComputedInheritedRules
RequestResponse<com.fasterxml.jackson.databind.JsonNode> deleteComputedInheritedRules(VitamContext vitamContext, com.fasterxml.jackson.databind.JsonNode deleteComputedInheritedRulesQuery) throws VitamClientException
compute inherited rules.- Parameters:
vitamContext
- the vitam contextdeleteComputedInheritedRulesQuery
- the query request (query and actions)- Returns:
- Json representation
- Throws:
VitamClientException
-
launchPreservation
RequestResponse<com.fasterxml.jackson.databind.JsonNode> launchPreservation(VitamContext vitamContext, PreservationRequest preservationRequest) throws VitamClientException
- Throws:
VitamClientException
-
transferReply
RequestResponse<com.fasterxml.jackson.databind.JsonNode> transferReply(VitamContext vitamContext, java.io.InputStream transferReply) throws VitamClientException
- Throws:
VitamClientException
-
-