public class OntologyManager extends Object
Constructor and Description |
---|
OntologyManager(LogbookOperationsClient logbookClient,
GUID eip,
Map<String,List<ErrorReportOntologies>> errors) |
Modifier and Type | Method and Description |
---|---|
void |
addError(String identifier,
ErrorReportOntologies error,
Map<String,List<ErrorReportOntologies>> errors)
Add an error to the report
|
OntologyValidator |
createCheckDuplicateInDatabaseValidator()
Check if the ontology identifier already exists in DB or is equal to a sedafield in DB
Check is done for the current tenant and the admin tenant ontologies
|
OntologyValidator |
createCheckIdentifierValidator()
Check if the ontology identifier against un regular expression
For an identifier to be valid, it must not contain a white space, nor begin by "_" or "#"
|
OntologyValidator |
createCheckUsedByDocumentTypeValidator()
Check if the ontology is used in a document type
|
OntologyValidator |
createMandatoryParamsValidator()
Validate that the ontology has not a missing mandatory parameter
|
OntologyValidator |
createWrongFieldFormatValidator()
Set a default value if null and check for wrong data type/format/value for fields
|
void |
logFatalError(String eventType,
String objectId,
String errorsDetails)
log fatal error (system or technical error)
|
void |
logStarted(String eventType,
String objectId)
log start process
|
void |
logSuccess(String eventType,
String objectId,
String message)
log end success process
|
void |
logValidationError(String eventType,
String objectId,
String errorsDetails)
Log validation error (business error)
|
boolean |
validateCreateExternalOntology(String identifier,
OntologyModel ontology)
Validate the creation of an EXTERNAL ontology
|
boolean |
validateCreateInternalOntology(String identifier,
OntologyModel ontology)
Validate the creation of an INTERNAL ontology
|
boolean |
validateDeleteOntology(String identifier,
OntologyModel ontology)
Validate the deletion of an ontology
|
boolean |
validateUpdateExternalOntology(String identifier,
OntologyModel ontology)
Validate the update of an EXTERNAL ontology
|
boolean |
validateUpdateInternalOntology(String identifier,
OntologyModel ontology)
Validate the update of an INTERNAL ontology
|
public OntologyManager(LogbookOperationsClient logbookClient, GUID eip, Map<String,List<ErrorReportOntologies>> errors)
public boolean validateCreateInternalOntology(String identifier, OntologyModel ontology)
identifier
- ontology
- public boolean validateCreateExternalOntology(String identifier, OntologyModel ontology)
identifier
- ontology
- public boolean validateUpdateExternalOntology(String identifier, OntologyModel ontology)
identifier
- ontology
- public boolean validateUpdateInternalOntology(String identifier, OntologyModel ontology)
identifier
- ontology
- public boolean validateDeleteOntology(String identifier, OntologyModel ontology)
identifier
- ontology
- public void addError(String identifier, ErrorReportOntologies error, Map<String,List<ErrorReportOntologies>> errors)
identifier
- error
- public void logValidationError(String eventType, String objectId, String errorsDetails) throws VitamException
errorsDetails
- VitamException
public void logFatalError(String eventType, String objectId, String errorsDetails) throws VitamException
errorsDetails
- VitamException
public void logStarted(String eventType, String objectId) throws VitamException
VitamException
public void logSuccess(String eventType, String objectId, String message) throws VitamException
VitamException
public OntologyValidator createMandatoryParamsValidator()
public OntologyValidator createWrongFieldFormatValidator()
public OntologyValidator createCheckDuplicateInDatabaseValidator()
public OntologyValidator createCheckUsedByDocumentTypeValidator()
public OntologyValidator createCheckIdentifierValidator()
Copyright © 2018 Vitam. All rights reserved.