public class RulesManagerFileImpl extends Object implements ReferentialFile<FileRules>
Constructor and Description |
---|
RulesManagerFileImpl(MongoDbAccessAdminImpl dbConfiguration,
VitamCounterService vitamCounterService) |
Modifier and Type | Method and Description |
---|---|
com.fasterxml.jackson.databind.node.ArrayNode |
checkFile(InputStream rulesFileStream,
Map<Integer,List<ErrorReport>> errorsMap,
List<FileRulesModel> usedDeletedRules,
List<FileRulesModel> usedUpdatedRules,
List<FileRulesModel> insertRules,
Set<String> notUsedDeletedRules,
Set<String> notUsedUpdatedRules)
Checks File : checks if a stream of referential data is valid
|
boolean |
checkRuleConformity(com.fasterxml.jackson.databind.node.ArrayNode array1,
com.fasterxml.jackson.databind.node.ArrayNode array2,
int tenant)
Check if two arrayNodes are the same
|
FileRules |
findDocumentById(String id)
find document based on a given Id
|
RequestResponseOK<FileRules> |
findDocuments(com.fasterxml.jackson.databind.JsonNode select)
find document based on DSL query
|
InputStream |
generateErrorReport(Map<Integer,List<ErrorReport>> errors,
List<FileRulesModel> usedDeletedRules,
List<FileRulesModel> usedUpdatedRules,
StatusCode status,
GUID eipMaster)
generate Error Report
|
com.fasterxml.jackson.databind.node.ArrayNode |
getRuleFromCollection(int tenant)
get the rule file from collection
|
com.fasterxml.jackson.databind.node.ArrayNode |
getRuleFromOffer(int tenant)
get the last rule file from offer
|
void |
importFile(InputStream rulesFileStream,
String filename)
importFile : import reference file to database
|
public RulesManagerFileImpl(MongoDbAccessAdminImpl dbConfiguration, VitamCounterService vitamCounterService)
public void importFile(InputStream rulesFileStream, String filename) throws IOException, InvalidParseOperationException, ReferentialException, StorageException
ReferentialFile
importFile
in interface ReferentialFile<FileRules>
rulesFileStream
- as InputStreamfilename
- file nameIOException
InvalidParseOperationException
ReferentialException
- when there is error of importStorageException
public com.fasterxml.jackson.databind.node.ArrayNode checkFile(InputStream rulesFileStream, Map<Integer,List<ErrorReport>> errorsMap, List<FileRulesModel> usedDeletedRules, List<FileRulesModel> usedUpdatedRules, List<FileRulesModel> insertRules, Set<String> notUsedDeletedRules, Set<String> notUsedUpdatedRules) throws IOException, ReferentialException, InvalidParseOperationException
rulesFileStream
- as InputStreamerrorsMap
- List of string that contains errorsusedDeletedRules
- used rules in AU that want to deleteusedUpdatedRules
- used rules in AU that want to updatenotUsedDeletedRules
- not used rules in AU that want to deletenotUsedUpdatedRules
- Updated rules not used in AUReferentialException
- when there is errors importIOException
- when there is IO ExceptionInvalidCreateOperationException
InvalidParseOperationException
public FileRules findDocumentById(String id) throws ReferentialException
ReferentialFile
findDocumentById
in interface ReferentialFile<FileRules>
id
- of vitam documentReferentialException
- when error occurspublic RequestResponseOK<FileRules> findDocuments(com.fasterxml.jackson.databind.JsonNode select) throws ReferentialException
ReferentialFile
findDocuments
in interface ReferentialFile<FileRules>
select
- filterFileFormatNotFoundException
- when no results foundReferentialException
- when error occurspublic InputStream generateErrorReport(Map<Integer,List<ErrorReport>> errors, List<FileRulesModel> usedDeletedRules, List<FileRulesModel> usedUpdatedRules, StatusCode status, GUID eipMaster)
errors
- the list of error for generated errorsusedDeletedRules
- list of fileRules that attempt to be deleted but have reference to unitusedUpdatedRules
- list of fileRules that attempt to be updated but have reference to unitstatus
- statuseipMaster
- eipMasterpublic com.fasterxml.jackson.databind.node.ArrayNode getRuleFromCollection(int tenant) throws InvalidParseOperationException
tenant
- InvalidParseOperationException
public com.fasterxml.jackson.databind.node.ArrayNode getRuleFromOffer(int tenant)
tenant
- public boolean checkRuleConformity(com.fasterxml.jackson.databind.node.ArrayNode array1, com.fasterxml.jackson.databind.node.ArrayNode array2, int tenant)
array1
- array2
- tenant
- Copyright © 2018 Vitam. All rights reserved.