public interface SchemaService
Modifier and Type | Method and Description |
---|---|
boolean |
deleteSchema(String schemaId)
Delete a schema according to its id
|
Set<String> |
getInstalledJsonSchemaIds()
Get the list of installed Json Schema Ids
|
JsonSchemaWrapper |
getSchema(String schemaId)
Get a schema matching by a schema id
|
JsonSchemaWrapper |
getSchemaForEventType(String eventType)
Get the schema that is able to validate the specific event type
|
List<JsonSchemaWrapper> |
getSchemasByTarget(String target)
Get a list a
JsonSchemaWrapper |
boolean |
isEventValid(String event)
Verify if the event is valid
(This method is fail safe, if unexpected errors happens it will returns false)
|
boolean |
isEventValid(String event,
String eventType)
Deprecated.
|
boolean |
isValid(String data,
String schemaId)
Verify if a jsonNode is valid against a schema
(This method is fail safe, if unexpected errors happens it will returns false)
|
void |
loadPredefinedSchema(InputStream schemaStream)
Load a predefined schema into memory
|
void |
saveSchema(String schema)
Save a new schema or update a schema
|
boolean |
unloadPredefinedSchema(InputStream schemaStream)
Unload a predefined schema into memory
|
Set<ValidationError> |
validateEvent(String event)
perform a validation on the given event
|
Map<String,Set<ValidationError>> |
validateEvents(String events)
perform a validation of a list of the given events
|
boolean isValid(String data, String schemaId)
data
- to validateschemaId
- id of the schema used for the validation@Deprecated boolean isEventValid(String event, String eventType)
boolean isEventValid(String event)
event
- the event to check validitySet<ValidationError> validateEvent(String event) throws ValidationException
event
- the event to validateValidationException
- in case something goes wrong and validation could not be performed.Map<String,Set<ValidationError>> validateEvents(String events) throws ValidationException
events
- the events to validateValidationException
- in case something goes wrong and validation could not be performed.Set<String> getInstalledJsonSchemaIds()
JsonSchemaWrapper getSchema(String schemaId)
schemaId
- Id of the schemaList<JsonSchemaWrapper> getSchemasByTarget(String target)
JsonSchemaWrapper
target
- to filter the schemasJsonSchemaWrapper getSchemaForEventType(String eventType) throws ValidationException
eventType
- the eventTypeValidationException
void saveSchema(String schema)
schema
- as a String valueboolean deleteSchema(String schemaId)
schemaId
- id of the schema to deletevoid loadPredefinedSchema(InputStream schemaStream) throws IOException
schemaStream
- inputStream of the schemaIOException
boolean unloadPredefinedSchema(InputStream schemaStream)
schemaStream
- inputStream of the schema to deleteCopyright © 2014–2023 Apache Software Foundation. All rights reserved.