Package fr.gouv.vitam.functional.administration.core.ontologies

# Class OntologyServiceImpl

java.lang.Object
fr.gouv.vitam.functional.administration.core.ontologies.OntologyServiceImpl

All Implemented Interfaces:
  `OntologyService`

public class OntologyServiceImpl extends Object implements OntologyService
The implementation of the Ontology CRUD service

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OntologyServiceImpl(MongoDbAccessAdminImpl mongoAccess, FunctionalBackupService functionalBackupService)`
  Constructor
  `OntologyServiceImpl(MongoDbAccessAdminImpl mongoAccess, FunctionalBackupService functionalBackupService, LogbookOperationsClientFactory logbookOperationsClientFactory)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `RequestResponse<OntologyModel>`
  `checkUpgradeOntologies(List<OntologyModel> ontologyInternalModelList)`
  Check the safety of ontology import at vitam reinstall/upgrade
  `RequestResponseOK<OntologyModel>`
  `findOntologies(com.fasterxml.jackson.databind.JsonNode queryDsl)`
  find an ontology by QueryDsl
  `RequestResponseOK<OntologyModel>`
  `findOntologiesForCache(com.fasterxml.jackson.databind.JsonNode queryDsl)`
  find an ontology by QueryDsl (find directly in db)
  `RequestResponse<OntologyModel>`
  `importInternalOntologies(List<OntologyModel> ontologyInternalModelList)`
  Import a collections of ontologies After passing the validation steps.
  `RequestResponse<OntologyModel>`
  `importOntologies(boolean forceUpdate, List<OntologyModel> ontologyModelList)`
  Import a collections of ontologies After passing the validation steps.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### OntologyServiceImpl

    public OntologyServiceImpl(MongoDbAccessAdminImpl mongoAccess, FunctionalBackupService functionalBackupService)
    Constructor
    Parameters:
      `mongoAccess` - MongoDB client
      `functionalBackupService` - the functional backup service

  - ### OntologyServiceImpl

    public OntologyServiceImpl(MongoDbAccessAdminImpl mongoAccess, FunctionalBackupService functionalBackupService, LogbookOperationsClientFactory logbookOperationsClientFactory)

- ## Method Details

  - ### importOntologies

    public RequestResponse<OntologyModel> importOntologies(boolean forceUpdate, List<OntologyModel> ontologyModelList) throws VitamException, IOException
    Description copied from interface: `OntologyService`
    Import a collections of ontologies After passing the validation steps. If all the ontologies are valid, they are stored in the collection and indexed. The ontologies are not valid in the following situations :
    - The json is invalid
    - The json contains an already used identifier
    - One or more mandatory field is missing
    - A field has an invalid format
    Specified by:
      `importOntologies` in interface `OntologyService`
    Parameters:
      `forceUpdate` -
      `ontologyModelList` - the list of ontologies to be imported
    Returns:
      RequestResponseOK if success or VitamError
    Throws:
      `VitamException` - if in error occurs while validating ontologies
      `IOException`

  - ### importInternalOntologies

    public RequestResponse<OntologyModel> importInternalOntologies(List<OntologyModel> ontologyInternalModelList) throws VitamException, IOException
    Description copied from interface: `OntologyService`
    Import a collections of ontologies After passing the validation steps. If all the ontologies are valid, they are stored in the collection and indexed. If there is some external ontologies used by vitam at the moment of import, they will be preserved and merged with the new internal ontologies being imported
    Specified by:
      `importInternalOntologies` in interface `OntologyService`
    Parameters:
      `ontologyInternalModelList` - the list of internal ontologies to be imported
    Returns:
      RequestResponseOK if success or VitamError
    Throws:
      `VitamException` - if in error occurs while validating ontologies
      `IOException`

  - ### checkUpgradeOntologies

    public RequestResponse<OntologyModel> checkUpgradeOntologies(List<OntologyModel> ontologyInternalModelList) throws VitamException
    Description copied from interface: `OntologyService`
    Check the safety of ontology import at vitam reinstall/upgrade
    Specified by:
      `checkUpgradeOntologies` in interface `OntologyService`
    Parameters:
      `ontologyInternalModelList` - the list of internal ontologies to check
    Returns:
      Response the response of check
    Throws:
      `VitamException` - if in error occurs while validating ontologies

  - ### findOntologiesForCache

    public RequestResponseOK<OntologyModel> findOntologiesForCache(com.fasterxml.jackson.databind.JsonNode queryDsl) throws InvalidParseOperationException
    Description copied from interface: `OntologyService`
    find an ontology by QueryDsl (find directly in db)
    Specified by:
      `findOntologiesForCache` in interface `OntologyService`
    Parameters:
      `queryDsl` - the query as a json to be executed
    Returns:
      list of OntologyModel
    Throws:
      `InvalidParseOperationException` - thrown if the query could not be executed

  - ### findOntologies

    public RequestResponseOK<OntologyModel> findOntologies(com.fasterxml.jackson.databind.JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException
    Description copied from interface: `OntologyService`
    find an ontology by QueryDsl
    Specified by:
      `findOntologies` in interface `OntologyService`
    Parameters:
      `queryDsl` - the query as a json to be executed
    Returns:
      list of OntologyModel
    Throws:
      `ReferentialException` - thrown if the query could not be executed
      `InvalidParseOperationException` - thrown if the query could not be executed