public interface LogbookTraceabilityHelper
Modifier and Type | Field and Description |
---|---|
static LocalDateTime |
INITIAL_START_DATE |
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
|
Long |
getDataSize()
Warning: This method MUST be used after "saveDataInZip" witch initialize traceabilityIterator
|
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() |
TraceabilityType |
getTraceabilityType() |
String |
getUriName() |
String |
getZipName() |
void |
initialize()
Initialize traceability.
|
void |
saveDataInZip(MerkleTreeAlgo algo,
TraceabilityFile file)
Search for entries to secure with the traceability process and store data in the given Traceability zip file.
Also, Merkle Algorithm should be updated by adding each wanted entry as a leaf of the tree. |
void |
saveEmpty(Integer tenantId)
Save the close master event if needed
|
void |
saveEvent(TraceabilityEvent event)
Save the finalized event if needed
|
void |
storeAndDeleteZip(Integer tenant,
File zipFile,
String fileName,
String uri,
TraceabilityEvent event)
Store the temporary zip in the final destination (on a specific offer for example) and delete tmp file.
|
static final LocalDateTime INITIAL_START_DATE
void initialize() throws TraceabilityException
TraceabilityException
- for any errorvoid saveDataInZip(MerkleTreeAlgo algo, TraceabilityFile file) throws IOException, TraceabilityException
algo
- algorithm used to generate MerkleTree with data.file
- output zip to store data (in some TYPE_COLLECTION.json)IOException
- if any error occurs while writing in traceabilityFileTraceabilityException
- for any other errors specifically in the search / data transformationvoid createLogbookOperationStructure() throws TraceabilityException
TraceabilityException
- if any error occursvoid createLogbookOperationEvent(Integer tenantId, String eventType, StatusCode status, TraceabilityEvent event) throws TraceabilityException
tenantId
- tenant used for the operationeventType
- code of the eventType for the entrystatus
- status of the entryevent
- data of the entryTraceabilityException
- if any error occursvoid storeAndDeleteZip(Integer tenant, File zipFile, String fileName, String uri, TraceabilityEvent event) throws TraceabilityException
tenant
- tenant used for the operationzipFile
- file containing multiple information about the traceability operation (data, merkle, computingData, ...)fileName
- name of the file on the destinationuri
- uri of the tmp fileevent
- traceability event that should be updated by this operationTraceabilityException
- if any error occursTraceabilityType getTraceabilityType()
String getStepName()
String getTimestampStepName()
String getZipName()
String getUriName()
String getTraceabilityStartDate() throws TraceabilityException
TraceabilityException
- on errorString getTraceabilityEndDate() throws TraceabilityException
TraceabilityException
- on errorLong getDataSize() throws TraceabilityException
TraceabilityException
- if the traceabilityIterator isn't yet initializedbyte[] getPreviousTimestampToken() throws InvalidParseOperationException
InvalidParseOperationException
- if any errors occurs while deserializing entry's data.byte[] getPreviousMonthTimestampToken() throws InvalidParseOperationException, TraceabilityException
InvalidParseOperationException
- if any errors occurs while deserializing entry's data.TraceabilityException
- if any other error occursbyte[] getPreviousYearTimestampToken() throws InvalidParseOperationException, TraceabilityException
InvalidParseOperationException
- if any errors occurs while deserializing entry's data.TraceabilityException
- if any other error occursString getPreviousStartDate() throws InvalidParseOperationException
InvalidParseOperationException
- if any errors occurs while deserializing entry's data.String getPreviousMonthStartDate() throws InvalidParseOperationException, TraceabilityException
InvalidParseOperationException
- if any errors occurs while deserializing entry's data.TraceabilityException
- if any other error occursString getPreviousYearStartDate() throws InvalidParseOperationException, TraceabilityException
InvalidParseOperationException
- if any errors occurs while deserializing entry's data.TraceabilityException
- if any other error occursvoid saveEvent(TraceabilityEvent event)
event
- The TraceabilityEvent of the operationvoid saveEmpty(Integer tenantId) throws TraceabilityException
tenantId
- the tenant used for logTraceabilityException
Copyright © 2018 Vitam. All rights reserved.