Class LogbookOperationsClientMock
- java.lang.Object
-
- fr.gouv.vitam.common.client.AbstractMockClient
-
- fr.gouv.vitam.logbook.operations.client.LogbookOperationsClientMock
-
- All Implemented Interfaces:
BasicClient,MockOrRestClient,VitamAutoCloseable,LogbookOperationsClient,java.lang.AutoCloseable
public class LogbookOperationsClientMock extends AbstractMockClient implements LogbookOperationsClient
Mock client implementation for logbook operation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class fr.gouv.vitam.common.client.AbstractMockClient
AbstractMockClient.FakeInboundResponse
-
-
Field Summary
-
Fields inherited from interface fr.gouv.vitam.common.client.BasicClient
STATUS_URL
-
-
Constructor Summary
Constructors Constructor Description LogbookOperationsClientMock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbulkCreate(java.lang.String eventIdProc, java.lang.Iterable<LogbookOperationParameters> queue)Bulk Create
To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).voidbulkUpdate(java.lang.String eventIdProc, java.lang.Iterable<LogbookOperationParameters> queue)Bulk Update
To be used everywhere except very first time (when eventIdentifierProcess already used once)LifecycleTraceabilityStatuscheckLifecycleTraceabilityWorkflowStatus(java.lang.String operationId)Check life cycle traceability status (unit / got)LogbookCheckResultcheckLogbookCoherence()checkLogbookCoherencevoidclose()Close the underneath http clientvoidcommitCreateDelegate(java.lang.String eventIdProc)Finalize logbook entry using delegation
To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).voidcommitUpdateDelegate(java.lang.String eventIdProc)Finalize logbook entry using delegation
To be used everywhere except very first time (when eventIdentifierProcess already used once)voidcreate(LogbookOperationParameters parameters)Create logbook entry
To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).voidcreateDelegate(LogbookOperationParameters parameters)Create logbook entry using delegation
To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).RequestResponse<com.fasterxml.jackson.databind.JsonNode>getLastOperationByType(java.lang.String operationType)voidreconstructCollection(java.util.List<ReconstructionRequestItem> reconstructionItems)ReindexationResultreindex(IndexParameters indexParam)Reindex a collection with parameterscom.fasterxml.jackson.databind.JsonNodeselectOperation(com.fasterxml.jackson.databind.JsonNode select)com.fasterxml.jackson.databind.JsonNodeselectOperation(com.fasterxml.jackson.databind.JsonNode select, boolean isSliced, boolean isCrossTenant)com.fasterxml.jackson.databind.JsonNodeselectOperationById(java.lang.String id)com.fasterxml.jackson.databind.JsonNodeselectOperationById(java.lang.String processId, com.fasterxml.jackson.databind.JsonNode query, boolean isSliced, boolean isCrossTenant)SwitchIndexResultswitchIndexes(SwitchIndexParameters switchIndexParam)Switch indexesRequestResponseOK<TenantLogbookOperationTraceabilityResult>traceability(java.util.List<java.lang.Integer> tenants)Call traceability logbook operation for requested tenantsvoidtraceabilityAudit(int tenant, AuditLogbookOptions options)RequestResponseOK<java.lang.String>traceabilityLfcObjectGroup()Starts Object Group logbook lifecycle traceabilityRequestResponseOK<java.lang.String>traceabilityLfcUnit()Starts Unit logbook lifecycle traceabilityvoidupdate(LogbookOperationParameters parameters)Update logbook entry
To be used everywhere except very first time (when eventIdentifierProcess already used once)voidupdateDelegate(LogbookOperationParameters parameters)Update logbook entry using delegation
To be used everywhere except very first time (when eventIdentifierProcess already used once)-
Methods inherited from class fr.gouv.vitam.common.client.AbstractMockClient
checkStatus, checkStatus, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.gouv.vitam.common.client.MockOrRestClient
checkStatus, checkStatus, consumeAnyEntityAndClose, getResourcePath, getServiceUrl
-
-
-
-
Method Detail
-
create
public void create(LogbookOperationParameters parameters) throws LogbookClientBadRequestException, LogbookClientAlreadyExistsException, LogbookClientServerException
Description copied from interface:LogbookOperationsClientCreate logbook entry
To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).- Specified by:
createin interfaceLogbookOperationsClient- Parameters:
parameters- the entry parameters- Throws:
LogbookClientBadRequestException- if the argument is incorrectLogbookClientAlreadyExistsException- if the element already existsLogbookClientServerException- if the Server got an internal error
-
update
public void update(LogbookOperationParameters parameters) throws LogbookClientBadRequestException, LogbookClientNotFoundException, LogbookClientServerException
Description copied from interface:LogbookOperationsClientUpdate logbook entry
To be used everywhere except very first time (when eventIdentifierProcess already used once)- Specified by:
updatein interfaceLogbookOperationsClient- Parameters:
parameters- the entry parameters- Throws:
LogbookClientBadRequestException- if the argument is incorrectLogbookClientNotFoundException- if the element was not created beforeLogbookClientServerException- if the Server got an internal error
-
selectOperation
public com.fasterxml.jackson.databind.JsonNode selectOperation(com.fasterxml.jackson.databind.JsonNode select) throws LogbookClientException, InvalidParseOperationException- Specified by:
selectOperationin interfaceLogbookOperationsClient- Returns:
- logbook operation as JsonNode
- Throws:
LogbookClientExceptionInvalidParseOperationException
-
selectOperation
public com.fasterxml.jackson.databind.JsonNode selectOperation(com.fasterxml.jackson.databind.JsonNode select, boolean isSliced, boolean isCrossTenant) throws LogbookClientException, InvalidParseOperationException- Specified by:
selectOperationin interfaceLogbookOperationsClient- Throws:
LogbookClientExceptionInvalidParseOperationException
-
selectOperationById
public com.fasterxml.jackson.databind.JsonNode selectOperationById(java.lang.String processId, com.fasterxml.jackson.databind.JsonNode query, boolean isSliced, boolean isCrossTenant) throws LogbookClientException, InvalidParseOperationException- Specified by:
selectOperationByIdin interfaceLogbookOperationsClient- Throws:
LogbookClientExceptionInvalidParseOperationException
-
selectOperationById
public com.fasterxml.jackson.databind.JsonNode selectOperationById(java.lang.String id) throws LogbookClientException, InvalidParseOperationException- Specified by:
selectOperationByIdin interfaceLogbookOperationsClient- Parameters:
id- identifier- Returns:
- logbook operation as String
- Throws:
LogbookClientException- LogbookClientExceptionInvalidParseOperationException- InvalidParseOperationException
-
traceability
public RequestResponseOK<TenantLogbookOperationTraceabilityResult> traceability(java.util.List<java.lang.Integer> tenants)
Description copied from interface:LogbookOperationsClientCall traceability logbook operation for requested tenants- Specified by:
traceabilityin interfaceLogbookOperationsClient- Returns:
- logbook operation result per tenant
-
createDelegate
public void createDelegate(LogbookOperationParameters parameters) throws LogbookClientAlreadyExistsException
Description copied from interface:LogbookOperationsClientCreate logbook entry using delegation
To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).- Specified by:
createDelegatein interfaceLogbookOperationsClient- Parameters:
parameters- the entry parameters (can be reused and modified after without impacting the one created)- Throws:
LogbookClientAlreadyExistsException- if the element already exists
-
updateDelegate
public void updateDelegate(LogbookOperationParameters parameters) throws LogbookClientNotFoundException
Description copied from interface:LogbookOperationsClientUpdate logbook entry using delegation
To be used everywhere except very first time (when eventIdentifierProcess already used once)- Specified by:
updateDelegatein interfaceLogbookOperationsClient- Parameters:
parameters- the entry parameters (can be reused and modified after without impacting the one updated)- Throws:
LogbookClientNotFoundException- if the element does not yet exists (createDeletage not called before)
-
bulkCreate
public void bulkCreate(java.lang.String eventIdProc, java.lang.Iterable<LogbookOperationParameters> queue) throws LogbookClientBadRequestExceptionDescription copied from interface:LogbookOperationsClientBulk Create
To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).- Specified by:
bulkCreatein interfaceLogbookOperationsClient- Parameters:
eventIdProc- event Process Identifierqueue- queue of LogbookOperationParameters to create- Throws:
LogbookClientBadRequestException- if the argument is incorrect
-
bulkUpdate
public void bulkUpdate(java.lang.String eventIdProc, java.lang.Iterable<LogbookOperationParameters> queue) throws LogbookClientBadRequestExceptionDescription copied from interface:LogbookOperationsClientBulk Update
To be used everywhere except very first time (when eventIdentifierProcess already used once)- Specified by:
bulkUpdatein interfaceLogbookOperationsClient- Parameters:
eventIdProc- event Process Identifierqueue- queue of LogbookOperationParameters to update- Throws:
LogbookClientBadRequestException- if the argument is incorrect
-
commitCreateDelegate
public void commitCreateDelegate(java.lang.String eventIdProc) throws LogbookClientBadRequestExceptionDescription copied from interface:LogbookOperationsClientFinalize logbook entry using delegation
To be used ONLY once at top level of process startup (where eventIdentifierProcess is set for the first time).- Specified by:
commitCreateDelegatein interfaceLogbookOperationsClient- Parameters:
eventIdProc- event Process Identifier- Throws:
LogbookClientBadRequestException- if the argument is incorrect
-
commitUpdateDelegate
public void commitUpdateDelegate(java.lang.String eventIdProc) throws LogbookClientBadRequestExceptionDescription copied from interface:LogbookOperationsClientFinalize logbook entry using delegation
To be used everywhere except very first time (when eventIdentifierProcess already used once)- Specified by:
commitUpdateDelegatein interfaceLogbookOperationsClient- Parameters:
eventIdProc- event Process Identifier- Throws:
LogbookClientBadRequestException- if the argument is incorrect
-
close
public void close()
Description copied from interface:MockOrRestClientClose the underneath http client- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceMockOrRestClient- Specified by:
closein interfaceVitamAutoCloseable- Overrides:
closein classAbstractMockClient
-
traceabilityLfcUnit
public RequestResponseOK<java.lang.String> traceabilityLfcUnit()
Description copied from interface:LogbookOperationsClientStarts Unit logbook lifecycle traceability- Specified by:
traceabilityLfcUnitin interfaceLogbookOperationsClient- Returns:
- logbook lifecycles as String
-
traceabilityLfcObjectGroup
public RequestResponseOK<java.lang.String> traceabilityLfcObjectGroup()
Description copied from interface:LogbookOperationsClientStarts Object Group logbook lifecycle traceability- Specified by:
traceabilityLfcObjectGroupin interfaceLogbookOperationsClient- Returns:
- logbook lifecycles as String
-
reindex
public ReindexationResult reindex(IndexParameters indexParam) throws InvalidParseOperationException
Description copied from interface:LogbookOperationsClientReindex a collection with parameters- Specified by:
reindexin interfaceLogbookOperationsClient- Parameters:
indexParam- reindexation parameters- Returns:
- JsonObject containing information about the newly created index
- Throws:
InvalidParseOperationException
-
switchIndexes
public SwitchIndexResult switchIndexes(SwitchIndexParameters switchIndexParam) throws InvalidParseOperationException
Description copied from interface:LogbookOperationsClientSwitch indexes- Specified by:
switchIndexesin interfaceLogbookOperationsClient- Parameters:
switchIndexParam- switch index parameters- Returns:
- JsonObject containing information about the newly created index
- Throws:
InvalidParseOperationException
-
traceabilityAudit
public void traceabilityAudit(int tenant, AuditLogbookOptions options)- Specified by:
traceabilityAuditin interfaceLogbookOperationsClient
-
checkLogbookCoherence
public LogbookCheckResult checkLogbookCoherence()
Description copied from interface:LogbookOperationsClientcheckLogbookCoherence- Specified by:
checkLogbookCoherencein interfaceLogbookOperationsClient- Returns:
- result
-
getLastOperationByType
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> getLastOperationByType(java.lang.String operationType)
- Specified by:
getLastOperationByTypein interfaceLogbookOperationsClient
-
reconstructCollection
public void reconstructCollection(java.util.List<ReconstructionRequestItem> reconstructionItems) throws LogbookClientServerException
- Specified by:
reconstructCollectionin interfaceLogbookOperationsClient- Throws:
LogbookClientServerException
-
checkLifecycleTraceabilityWorkflowStatus
public LifecycleTraceabilityStatus checkLifecycleTraceabilityWorkflowStatus(java.lang.String operationId)
Description copied from interface:LogbookOperationsClientCheck life cycle traceability status (unit / got)- Specified by:
checkLifecycleTraceabilityWorkflowStatusin interfaceLogbookOperationsClient- Parameters:
operationId- the process id- Returns:
- lifecycle traceability status
-
-