Interface AccessInternalModule
- All Known Implementing Classes:
AccessInternalModuleImpl
public interface AccessInternalModule
AccessModule interface for database operations in select
-
Method Summary
Modifier and TypeMethodDescriptioncheckAccessRequestStatuses
(List<AccessRequestReference> accessRequestReferences) void
checkClassificationLevel
(com.fasterxml.jackson.databind.JsonNode query) check ClassificationLevel in update UnitcreateObjectAccessRequestIfRequired
(String idObjectGroup, String qualifier, int version) javax.ws.rs.core.Response
retrieve a DIP file according to an operationIdfindOneObjectGroupByPersistentId
(String persistentId, com.fasterxml.jackson.databind.JsonNode query) javax.ws.rs.core.Response
retrieve a SIP file according to an operationIdjavax.ws.rs.core.Response
getAccessLog
(com.fasterxml.jackson.databind.JsonNode params) Retrieve all accessLog by the concatenation of all accesslog files as InputStreamjavax.ws.rs.core.Response
getObjectByPersistentIdentifier
(String persistentIdentifier) Gets a Response as InputStream according the founded object by persistent identifier.javax.ws.rs.core.Response
getObjectByUnitPersistentIdentifier
(String persistentIdentifier, String qualifier, Integer version) javax.ws.rs.core.Response
getOneObjectFromObjectGroup
(String idObjectGroup, String qualifier, int version, String idUnit) Retrieve an object as InputStream based on the associated ObjectGroupId and qualifier + version requestedvoid
removeAccessRequest
(String storageStrategyId, String accessRequestId) com.fasterxml.jackson.databind.JsonNode
selectObjectGroupById
(com.fasterxml.jackson.databind.JsonNode queryJson, String idObjectGroup) Retrieve an ObjectGroup by its id with results fields filtered based on given querycom.fasterxml.jackson.databind.JsonNode
selectObjects
(com.fasterxml.jackson.databind.JsonNode queryJson) select Objects Group based on DSL querycom.fasterxml.jackson.databind.JsonNode
selectPurgedPersistentIdentifier
(String persistentIdentifier, PurgedCollectionType type) select purged persistent identifiercom.fasterxml.jackson.databind.JsonNode
selectUnit
(com.fasterxml.jackson.databind.JsonNode queryJson) select Unitcom.fasterxml.jackson.databind.JsonNode
selectUnitbyId
(com.fasterxml.jackson.databind.JsonNode queryJson, String idUnit) select Unit by idcom.fasterxml.jackson.databind.JsonNode
selectUnitsWithInheritedRules
(com.fasterxml.jackson.databind.JsonNode jsonQuery) Select units by DSL and computes inherited rules for matching unitsjavax.ws.rs.core.Response
streamObjects
(com.fasterxml.jackson.databind.JsonNode applyAccessContractRestrictionForObjectForSelect) javax.ws.rs.core.Response
streamUnits
(com.fasterxml.jackson.databind.JsonNode applyAccessContractRestrictionForUnitForSelect) com.fasterxml.jackson.databind.JsonNode
updateUnitById
(com.fasterxml.jackson.databind.JsonNode queryJson, String idUnit, String requestId) update Unit by id
-
Method Details
-
selectUnit
com.fasterxml.jackson.databind.JsonNode selectUnit(com.fasterxml.jackson.databind.JsonNode queryJson) throws InvalidParseOperationException, AccessInternalExecutionException, VitamDBException select Unit- Parameters:
queryJson
- as String { $query : query}- Returns:
- the result of the select on Unit
- Throws:
IllegalArgumentException
- if json query is nullInvalidParseOperationException
- Throw if json format is not correctAccessInternalExecutionException
- Throw if error occurs when send Unit to databaseVitamDBException
-
selectPurgedPersistentIdentifier
com.fasterxml.jackson.databind.JsonNode selectPurgedPersistentIdentifier(String persistentIdentifier, @Nullable PurgedCollectionType type) throws InvalidParseOperationException, AccessInternalException select purged persistent identifier- Parameters:
persistentIdentifier
- as Stringtype
- Purged collection type- Returns:
- the result of the select on persistent identifier
- Throws:
IllegalArgumentException
- if json query is nullInvalidParseOperationException
- Throw if parameter is not correctAccessInternalExecutionException
- Throw if error occurs when retrieve data from databaseAccessInternalException
-
selectUnitbyId
com.fasterxml.jackson.databind.JsonNode selectUnitbyId(com.fasterxml.jackson.databind.JsonNode queryJson, String idUnit) throws InvalidParseOperationException, AccessInternalExecutionException, MetaDataNotFoundException select Unit by id- Parameters:
queryJson
- as String { $query : query}idUnit
- as String- Returns:
- the corresponding JsonNode
- Throws:
InvalidParseOperationException
- Throw if json format is not correctAccessInternalExecutionException
- Throw if error occurs when send Unit to databaseIllegalArgumentException
- Throw if error occurs when checking argumentMetaDataNotFoundException
-
updateUnitById
com.fasterxml.jackson.databind.JsonNode updateUnitById(com.fasterxml.jackson.databind.JsonNode queryJson, String idUnit, String requestId) throws MetaDataNotFoundException, InvalidParseOperationException, AccessInternalExecutionException, IllegalArgumentException, UpdatePermissionException, AccessInternalRuleExecutionException update Unit by id- Parameters:
queryJson
- json update queryidUnit
- as StringrequestId
- the request id- Returns:
- the result of the update on Unit
- Throws:
InvalidParseOperationException
- Throw if json format is not correctAccessInternalExecutionException
- Throw if error occurs when send Unit to databaseAccessInternalRuleExecutionException
- Throw When error occures on rules update checkIllegalArgumentException
- Throw if error occurs when checking argumentMetaDataNotFoundException
- Throw if unit is not foundUpdatePermissionException
-
selectObjectGroupById
com.fasterxml.jackson.databind.JsonNode selectObjectGroupById(com.fasterxml.jackson.databind.JsonNode queryJson, String idObjectGroup) throws InvalidParseOperationException, AccessInternalExecutionException, MetaDataNotFoundException Retrieve an ObjectGroup by its id with results fields filtered based on given query- Parameters:
queryJson
- the query DSL as a Json nodeidObjectGroup
- the id of the ObjectGroup as- Returns:
- the ObjectGroup metadata as a JsonNode
- Throws:
IllegalArgumentException
- in case of null/incorrect parametersInvalidParseOperationException
- thrown if json query is not syntactically correctAccessInternalExecutionException
- in case of access failureMetaDataNotFoundException
-
getOneObjectFromObjectGroup
javax.ws.rs.core.Response getOneObjectFromObjectGroup(String idObjectGroup, String qualifier, int version, String idUnit) throws StorageNotFoundException, InvalidParseOperationException, MetaDataNotFoundException, AccessInternalExecutionException, AccessInternalUnavailableDataFromAsyncOfferException Retrieve an object as InputStream based on the associated ObjectGroupId and qualifier + version requested- Parameters:
idObjectGroup
- The Object Group Idqualifier
- the qualifier to be retrieve (ie: Dissemination etc.)version
- the version number to getidUnit
- identifier of the parent archiveunit used to have access to the object- Returns:
- response
- Throws:
StorageNotFoundException
- If the object is not found in storageInvalidParseOperationException
- when a query is badly structuredAccessInternalExecutionException
- For other technical errorsMetaDataNotFoundException
AccessInternalUnavailableDataFromAsyncOfferException
-
getObjectByPersistentIdentifier
javax.ws.rs.core.Response getObjectByPersistentIdentifier(String persistentIdentifier) throws MetaDataNotFoundException, StorageNotFoundException, AccessInternalException, AccessUnauthorizedException Gets a Response as InputStream according the founded object by persistent identifier.- Parameters:
persistentIdentifier
- The object persistent identifier.- Returns:
- Response with InputStream.
- Throws:
MetaDataNotFoundException
- when persistent identifier not found in metadata database.StorageNotFoundException
AccessInternalException
AccessUnauthorizedException
-
getAccessLog
javax.ws.rs.core.Response getAccessLog(com.fasterxml.jackson.databind.JsonNode params) throws AccessInternalExecutionException, StorageNotFoundException, ParseException Retrieve all accessLog by the concatenation of all accesslog files as InputStream- Parameters:
params
- a json containing query on StartDate or EndDate- Returns:
- the Storage response for the asked file
- Throws:
StorageNotFoundException
AccessInternalExecutionException
ParseException
-
findDIPByOperationId
retrieve a DIP file according to an operationId- Parameters:
id
- operation id- Returns:
- zip file containing a DIP
- Throws:
AccessInternalExecutionException
-
findTransferSIPByOperationId
javax.ws.rs.core.Response findTransferSIPByOperationId(String id) throws AccessInternalExecutionException retrieve a SIP file according to an operationId- Parameters:
id
- operation id- Returns:
- zip file containing a SIP
- Throws:
AccessInternalExecutionException
-
selectObjects
com.fasterxml.jackson.databind.JsonNode selectObjects(com.fasterxml.jackson.databind.JsonNode queryJson) throws InvalidParseOperationException, AccessInternalExecutionException, VitamDBException select Objects Group based on DSL query- Parameters:
queryJson
- as String { $query : query}- Returns:
- the result of the select on object
- Throws:
IllegalArgumentException
- if json query is nullInvalidParseOperationException
- Throw if json format is not correctAccessInternalExecutionException
- Throw if error occurs when send Object to databaseVitamDBException
-
selectUnitsWithInheritedRules
com.fasterxml.jackson.databind.JsonNode selectUnitsWithInheritedRules(com.fasterxml.jackson.databind.JsonNode jsonQuery) throws IllegalArgumentException, InvalidParseOperationException, AccessInternalExecutionException Select units by DSL and computes inherited rules for matching units- Parameters:
jsonQuery
- the query DSL- Returns:
- the selected units with there inherited rules
- Throws:
IllegalArgumentException
- Throw if json format is not correctAccessInternalExecutionException
- Throw if error occurs when send Unit to databaseInvalidParseOperationException
-
checkClassificationLevel
void checkClassificationLevel(com.fasterxml.jackson.databind.JsonNode query) throws IllegalArgumentException, InvalidParseOperationException check ClassificationLevel in update Unit- Parameters:
query
- query- Throws:
IllegalArgumentException
- IllegalArgumentExceptionInvalidParseOperationException
- InvalidParseOperationException
-
createObjectAccessRequestIfRequired
Optional<AccessRequestReference> createObjectAccessRequestIfRequired(String idObjectGroup, String qualifier, int version) throws MetaDataNotFoundException, InvalidParseOperationException, AccessInternalExecutionException -
checkAccessRequestStatuses
List<StatusByAccessRequest> checkAccessRequestStatuses(List<AccessRequestReference> accessRequestReferences) throws AccessInternalExecutionException, AccessInternalIllegalOperationException -
removeAccessRequest
void removeAccessRequest(String storageStrategyId, String accessRequestId) throws AccessInternalExecutionException, AccessInternalIllegalOperationException -
streamUnits
javax.ws.rs.core.Response streamUnits(com.fasterxml.jackson.databind.JsonNode applyAccessContractRestrictionForUnitForSelect) throws AccessInternalExecutionException, MetadataScrollLimitExceededException, MetadataScrollThresholdExceededException -
streamObjects
javax.ws.rs.core.Response streamObjects(com.fasterxml.jackson.databind.JsonNode applyAccessContractRestrictionForObjectForSelect) throws AccessInternalExecutionException, MetadataScrollLimitExceededException, MetadataScrollThresholdExceededException -
getObjectByUnitPersistentIdentifier
javax.ws.rs.core.Response getObjectByUnitPersistentIdentifier(String persistentIdentifier, String qualifier, Integer version) throws InvalidParseOperationException, MetaDataNotFoundException, StorageNotFoundException, AccessInternalException -
findOneObjectGroupByPersistentId
ObjectGroupResponse findOneObjectGroupByPersistentId(String persistentId, @Nullable com.fasterxml.jackson.databind.JsonNode query) throws MetaDataNotFoundException, AccessUnauthorizedException
-