Class StoreGraphService
java.lang.Object
fr.gouv.vitam.metadata.core.graph.StoreGraphService
This class get units where calculated data are modified
Zip generated files and store the zipped file in the offer.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final DateTimeFormatter
static final String
static final LocalDateTime
static final String
static final String
static final String
-
Constructor Summary
ConstructorDescriptionStoreGraphService
(VitamRepositoryProvider vitamRepositoryProvider) StoreGraphService
(VitamRepositoryProvider vitamRepositoryProvider, RestoreBackupService restoreBackupService, WorkspaceClientFactory workspaceClientFactory, StorageClientFactory storageClientFactory) -
Method Summary
Modifier and TypeMethodDescriptiongetLastGraphStoreDate
(MetadataCollections metadataCollections) As the files generated are zip files.boolean
static LocalDateTime
parseGraphEndDateFromFileName
(String fileName) static LocalDateTime
parseGraphStartDateFromFileName
(String fileName) void
storeInWorkspace
(String containerName, String graphFolder, List<org.bson.Document> documents) Connect to workspace and store the collection of documents as json file The destination container is containerName The destination folder is GRAPHIf no graph store in progress, try to start one Should be exposed in the APIvoid
zipAndSaveInOffer
(DataCategory dataCategory, String containerName, String graphFolder, String graphZipName, String graph_store_name)
-
Field Details
-
INITIAL_START_DATE
-
formatter
-
GRAPH
- See Also:
-
UNDERSCORE
- See Also:
-
ZIP_EXTENTION
- See Also:
-
ZIP_PREFIX_NAME
- See Also:
-
$_GTE
- See Also:
-
$_LT
- See Also:
-
-
Constructor Details
-
StoreGraphService
public StoreGraphService(VitamRepositoryProvider vitamRepositoryProvider, RestoreBackupService restoreBackupService, WorkspaceClientFactory workspaceClientFactory, StorageClientFactory storageClientFactory) - Parameters:
vitamRepositoryProvider
-restoreBackupService
-workspaceClientFactory
-storageClientFactory
-
-
StoreGraphService
- Parameters:
vitamRepositoryProvider
-
-
-
Method Details
-
getLastGraphStoreDate
public LocalDateTime getLastGraphStoreDate(MetadataCollections metadataCollections) throws StoreGraphException As the files generated are zip files. There name is the last store date Load from the offer, the latest zip file Get His name The name of zip file is fromDate_endDate.zip yyyy-MM-dd-HH-mm-ss-SSS_yyyy-MM-dd-HH-mm-ss-SSS.zip Format the name to LocalDateTime- Parameters:
metadataCollections
- the concerned collection- Returns:
- The date of the last store operation
- Throws:
StoreGraphException
-
parseGraphStartDateFromFileName
-
parseGraphEndDateFromFileName
-
isInProgress
public boolean isInProgress() -
tryStoreGraph
If no graph store in progress, try to start one Should be exposed in the API- Returns:
- the map of collection:number of treated documents
- Throws:
StoreGraphException
-
zipAndSaveInOffer
public void zipAndSaveInOffer(DataCategory dataCategory, String containerName, String graphFolder, String graphZipName, String graph_store_name) throws StoreGraphException - Parameters:
dataCategory
- (Unit or GOT)containerName
-graphFolder
- the name of graph folder in the containergraphZipName
- the name if the zipFile in the containergraph_store_name
- the name of the zip file in the offer- Throws:
StoreGraphException
-
storeInWorkspace
public void storeInWorkspace(String containerName, String graphFolder, List<org.bson.Document> documents) throws StoreGraphException Connect to workspace and store the collection of documents as json file The destination container is containerName The destination folder is GRAPH- Parameters:
documents
-- Throws:
StoreGraphException
-