Class AgenciesService
java.lang.Object
fr.gouv.vitam.functional.administration.core.agencies.AgenciesService
AgenciesService class allowing multiple operation on AgenciesService collection
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAgenciesService(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService backupService) AgenciesService(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService backupService, fr.gouv.vitam.functional.administration.core.agencies.LogbookAgenciesImportManager manager, ContractService<AccessContractModel> accessContractService) -
Method Summary
Modifier and TypeMethodDescriptionfindAgencies(com.fasterxml.jackson.databind.JsonNode queryDsl) Find agencies with a specific querygenerateErrorReport(AgenciesImportResult agenciesImportResult) Generate an error reportimportAgencies(InputStream stream, String filename) Import an input stream into agencies collectionconvert csv file into a set of AgenciesModelRetrieve agencies in database
-
Field Details
-
LOGGER
-
CSV_MULTIPLE_STRINGS_SEPARATOR
- See Also:
-
-
Constructor Details
-
AgenciesService
public AgenciesService(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService backupService) -
AgenciesService
public AgenciesService(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, FunctionalBackupService backupService, fr.gouv.vitam.functional.administration.core.agencies.LogbookAgenciesImportManager manager, ContractService<AccessContractModel> accessContractService)
-
-
Method Details
-
parseFile
convert csv file into a set of AgenciesModel- Parameters:
csvFile- the stream to be converted- Returns:
- a set of AgenciesModel
- Throws:
IOException- thrown if the file could be readReferentialException
-
retrieveAgenciesInDb
Retrieve agencies in database- Returns:
- list of agencies in database
- Throws:
ReferentialException
-
importAgencies
public RequestResponse<AgenciesModel> importAgencies(InputStream stream, String filename) throws VitamException Import an input stream into agencies collection- Parameters:
stream- the stream to be importedfilename- the file name- Returns:
- a response as a RequestResponse
object - Throws:
VitamException- thrown if logbook could not be initialized
-
findAgencies
public DbRequestResult findAgencies(com.fasterxml.jackson.databind.JsonNode queryDsl) throws ReferentialException Find agencies with a specific query- Parameters:
queryDsl- the query to be executed- Returns:
- a DbRequestResult containing agencies
- Throws:
ReferentialException- thrown if the query could not be executed
-
generateErrorReport
Generate an error report- Returns:
- an input stream containing the report
-