Class RulesManagerFileImpl
java.lang.Object
fr.gouv.vitam.functional.administration.core.rules.RulesManagerFileImpl
- All Implemented Interfaces:
ReferentialFile<FileRules>
RulesManagerFileImpl
Manage the Rules File features
-
Constructor Summary
ConstructorDescriptionRulesManagerFileImpl
(MongoDbAccessAdminImpl dbConfiguration, VitamCounterService vitamCounterService, VitamRuleService vitamRuleService, int ruleAuditThreadPoolSize) -
Method Summary
Modifier and TypeMethodDescriptioncheckFile
(Map<String, FileRulesModel> rulesToImport) Checks File : checks if a stream of referential data is validvoid
checkRuleConformity
(List<Integer> tenants) find document based on a given IdfindDocuments
(com.fasterxml.jackson.databind.JsonNode select) find document based on DSL querygenerateReportContent
(Map<Integer, List<ErrorReport>> errors, List<FileRulesModel> usedDeletedRules, List<FileRulesModel> usedRulesWithDurationModeUpdate, List<FileRulesModel> usedUpdatedRules, List<FileRulesModel> fileRulesModelToDelete, List<FileRulesModel> fileRulesModelToUpdate, List<FileRulesModel> fileRulesModelToInsert, StatusCode status, GUID eipMaster) generate Error ReportgetRulesFromCSV
(InputStream ruleInputStream) void
importFile
(InputStream rulesFileStream, String filename) importFile : import reference file to databaseprocessRuleParsing
(File file, String filename, GUID eip)
-
Constructor Details
-
RulesManagerFileImpl
public RulesManagerFileImpl(MongoDbAccessAdminImpl dbConfiguration, VitamCounterService vitamCounterService, VitamRuleService vitamRuleService, int ruleAuditThreadPoolSize)
-
-
Method Details
-
importFile
public void importFile(InputStream rulesFileStream, String filename) throws IOException, InvalidParseOperationException, ReferentialException, StorageException, InvalidGuidOperationException, LogbookClientException, IllegalPathException Description copied from interface:ReferentialFile
importFile : import reference file to database- Specified by:
importFile
in interfaceReferentialFile<FileRules>
- Parameters:
rulesFileStream
- as InputStreamfilename
- file name- Throws:
IOException
InvalidParseOperationException
ReferentialException
- when there is error of importStorageException
InvalidGuidOperationException
LogbookClientException
IllegalPathException
-
processRuleParsing
public Map<String,FileRulesModel> processRuleParsing(File file, String filename, GUID eip) throws FileRulesReadException, StorageException, InvalidParseOperationException, IOException, LogbookClientException -
checkFile
public RuleImportResultSet checkFile(Map<String, FileRulesModel> rulesToImport) throws ReferentialExceptionChecks File : checks if a stream of referential data is valid- Parameters:
rulesToImport
- rules to import- Returns:
- The rules to import
- Throws:
ReferentialException
- when there is errors import
-
getRulesFromCSV
public Map<String,FileRulesModel> getRulesFromCSV(InputStream ruleInputStream) throws IOException, FileRulesReadException - Throws:
IOException
FileRulesReadException
-
findDocumentById
Description copied from interface:ReferentialFile
find document based on a given Id- Specified by:
findDocumentById
in interfaceReferentialFile<FileRules>
- Parameters:
id
- of vitam document- Returns:
- vitam document
-
findDocuments
public RequestResponseOK<FileRules> findDocuments(com.fasterxml.jackson.databind.JsonNode select) throws ReferentialException Description copied from interface:ReferentialFile
find document based on DSL query- Specified by:
findDocuments
in interfaceReferentialFile<FileRules>
- Parameters:
select
- filter- Returns:
- vitam document list
- Throws:
FileFormatNotFoundException
- when no results foundReferentialException
- when error occurs
-
generateReportContent
public InputStream generateReportContent(Map<Integer, List<ErrorReport>> errors, List<FileRulesModel> usedDeletedRules, List<FileRulesModel> usedRulesWithDurationModeUpdate, List<FileRulesModel> usedUpdatedRules, List<FileRulesModel> fileRulesModelToDelete, List<FileRulesModel> fileRulesModelToUpdate, List<FileRulesModel> fileRulesModelToInsert, StatusCode status, GUID eipMaster) generate Error Report- Parameters:
errors
- the list of error for generated errorsusedDeletedRules
- list of fileRules that attempt to be deleted but have reference to unitusedRulesWithDurationModeUpdate
- list of fileRules referenced by a unit, with duration mode update (defined to undefined, or undefined to defined)usedUpdatedRules
- list of fileRules that attempt to be updated but have reference to unitstatus
- statuseipMaster
- eipMaster- Returns:
- the error report inputStream
-
checkRuleConformity
- Throws:
ReferentialException
-