public abstract class LogbookLifeCycleTraceabilityHelper extends Object implements LogbookTraceabilityHelper
INITIAL_START_DATE| Constructor and Description |
|---|
LogbookLifeCycleTraceabilityHelper(HandlerIO handlerIO,
LogbookOperationsClient logbookOperationsClient,
ItemStatus itemStatus,
String operationID,
String traceabilityEventFileName,
String traceabilityZipFileName) |
| Modifier and Type | Method and Description |
|---|---|
void |
createLogbookOperationEvent(Integer tenantId,
String eventType,
StatusCode status,
TraceabilityEvent event)
Update or finalize the traceability entry in the logbook collection
|
void |
createLogbookOperationStructure()
initialize the traceability entry in the logbook collection
|
protected void |
extractAppendToFinalFile(CloseableIterator<JsonLineModel> jsonLineIterator,
TraceabilityFile traceabilityFile,
MerkleTreeAlgo algo)
Reduce part of the process : lets merge in one only file the disting lifecycles ones
|
protected abstract Select |
generateSelectLogbookOperation(LocalDateTime date) |
long |
getDataSize()
Warning: This method MUST be used after "saveDataInZip" witch initialize traceabilityIterator
|
boolean |
getMaxEntriesReached() |
String |
getPreviousMonthStartDate()
Get the first traceability (in logbook) one month before the given currentDate and return the startDate of the entry
|
byte[] |
getPreviousMonthTimestampToken()
Get the first traceability (in logbook) one month before the given currentDate and return the timestampToken of the entry
|
String |
getPreviousStartDate()
Get the last traceability (in logbook) event and return the startDate of the entry
|
byte[] |
getPreviousTimestampToken()
Get the last traceability (in logbook) event and return the timestampToken of the entry
|
String |
getPreviousYearStartDate()
Get the first traceability (in logbook) one year before the given currentDate and return the startDate of the entry
|
byte[] |
getPreviousYearTimestampToken()
Get the first traceability (in logbook) one year before the given currentDate and return the timestampToken of the entry
|
String |
getStepName() |
String |
getTimestampStepName() |
String |
getTraceabilityEndDate() |
String |
getTraceabilityStartDate() |
TraceabilityStatistics |
getTraceabilityStatistics() |
void |
initialize()
Initialize traceability.
|
void |
saveEmpty(Integer tenantId)
Save the close master event if needed
|
void |
storeAndDeleteZip(Integer tenant,
File zipFile,
String fileName,
TraceabilityEvent event)
Store the temporary zip.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTraceabilityType, getZipName, saveDataInZippublic LogbookLifeCycleTraceabilityHelper(HandlerIO handlerIO, LogbookOperationsClient logbookOperationsClient, ItemStatus itemStatus, String operationID, String traceabilityEventFileName, String traceabilityZipFileName)
handlerIO - Workflow Input/Output of the traceability eventlogbookOperationsClient - used to search the operation to secureitemStatus - used by workflow, event must be updated hereoperationID - of the current traceability processtraceabilityEventFileName - traceabilityZipFileName - public void initialize()
throws TraceabilityException
LogbookTraceabilityHelperinitialize in interface LogbookTraceabilityHelperTraceabilityException - for any errorpublic void createLogbookOperationStructure()
throws TraceabilityException
LogbookTraceabilityHelpercreateLogbookOperationStructure in interface LogbookTraceabilityHelperTraceabilityException - if any error occurspublic void createLogbookOperationEvent(Integer tenantId, String eventType, StatusCode status, TraceabilityEvent event) throws TraceabilityException
LogbookTraceabilityHelpercreateLogbookOperationEvent in interface LogbookTraceabilityHelpertenantId - tenant used for the operationeventType - code of the eventType for the entrystatus - status of the entryevent - data of the entryTraceabilityException - if any error occurspublic void saveEmpty(Integer tenantId)
LogbookTraceabilityHelpersaveEmpty in interface LogbookTraceabilityHelpertenantId - the tenant used for logpublic boolean getMaxEntriesReached()
getMaxEntriesReached in interface LogbookTraceabilityHelperpublic TraceabilityStatistics getTraceabilityStatistics()
getTraceabilityStatistics in interface LogbookTraceabilityHelperpublic void storeAndDeleteZip(Integer tenant, File zipFile, String fileName, TraceabilityEvent event) throws TraceabilityException
LogbookTraceabilityHelperstoreAndDeleteZip in interface LogbookTraceabilityHelpertenant - tenant used for the operationzipFile - file containing multiple information about the traceability operation (data, merkle, computingData, ...)fileName - name of the file on the destinationevent - traceability event that should be updated by this operationTraceabilityException - if any error occurspublic String getStepName()
getStepName in interface LogbookTraceabilityHelperpublic String getTimestampStepName()
getTimestampStepName in interface LogbookTraceabilityHelperpublic String getTraceabilityStartDate()
getTraceabilityStartDate in interface LogbookTraceabilityHelperpublic String getTraceabilityEndDate()
getTraceabilityEndDate in interface LogbookTraceabilityHelperpublic long getDataSize()
LogbookTraceabilityHelpergetDataSize in interface LogbookTraceabilityHelperpublic byte[] getPreviousTimestampToken()
throws InvalidParseOperationException
LogbookTraceabilityHelpergetPreviousTimestampToken in interface LogbookTraceabilityHelperInvalidParseOperationException - if any errors occurs while deserializing entry's data.public byte[] getPreviousMonthTimestampToken()
throws InvalidParseOperationException,
TraceabilityException
LogbookTraceabilityHelpergetPreviousMonthTimestampToken in interface LogbookTraceabilityHelperInvalidParseOperationException - if any errors occurs while deserializing entry's data.TraceabilityException - if any other error occurspublic byte[] getPreviousYearTimestampToken()
throws InvalidParseOperationException,
TraceabilityException
LogbookTraceabilityHelpergetPreviousYearTimestampToken in interface LogbookTraceabilityHelperInvalidParseOperationException - if any errors occurs while deserializing entry's data.TraceabilityException - if any other error occurspublic String getPreviousStartDate() throws InvalidParseOperationException
LogbookTraceabilityHelpergetPreviousStartDate in interface LogbookTraceabilityHelperInvalidParseOperationException - if any errors occurs while deserializing entry's data.public String getPreviousMonthStartDate() throws InvalidParseOperationException, TraceabilityException
LogbookTraceabilityHelpergetPreviousMonthStartDate in interface LogbookTraceabilityHelperInvalidParseOperationException - if any errors occurs while deserializing entry's data.TraceabilityException - if any other error occurspublic String getPreviousYearStartDate() throws InvalidParseOperationException, TraceabilityException
LogbookTraceabilityHelpergetPreviousYearStartDate in interface LogbookTraceabilityHelperInvalidParseOperationException - if any errors occurs while deserializing entry's data.TraceabilityException - if any other error occursprotected void extractAppendToFinalFile(CloseableIterator<JsonLineModel> jsonLineIterator, TraceabilityFile traceabilityFile, MerkleTreeAlgo algo) throws TraceabilityException
jsonLineIterator - traceabilityFile - algo - TraceabilityExceptionprotected abstract Select generateSelectLogbookOperation(LocalDateTime date) throws InvalidCreateOperationException
InvalidCreateOperationExceptionCopyright © 2020 Vitam. All rights reserved.