Package org.apache.unomi.schema.rest
Class JsonSchemaEndPoint
java.lang.Object
org.apache.unomi.schema.rest.JsonSchemaEndPoint
@Produces("application/json;charset=UTF-8")
@Path("/jsonSchema")
public class JsonSchemaEndPoint
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the list of installed Json Schema IdsGet a schema by it's idboolean
Deletes a JSON schema by it's id.javax.ws.rs.core.Response
Save a JSON schemavoid
setSchemaService
(SchemaService schemaService) validateEvent
(String event) Being able to validate a given event is useful when you want to develop custom events and associated schemasvalidateEvents
(String events) Being able to validate a given list of event is useful when you want to develop custom events and associated schemas
-
Constructor Details
-
JsonSchemaEndPoint
public JsonSchemaEndPoint()
-
-
Method Details
-
setSchemaService
-
getInstalledJsonSchemaIds
Get the list of installed Json Schema Ids- Returns:
- A Set of JSON schema ids
-
getSchema
Get a schema by it's id- Parameters:
id
- of the schema- Returns:
- Json schema matching the id
-
save
@POST @Path("/") @Consumes({"text/plain","application/json"}) @Produces("application/json") public javax.ws.rs.core.Response save(String jsonSchema) Save a JSON schema- Parameters:
jsonSchema
- the schema as string to save- Returns:
- Response of the API call
-
remove
Deletes a JSON schema by it's id.- Parameters:
id
- the identifier of the JSON schema that we want to delete
-
validateEvent
@POST @Produces("application/json;charset=UTF-8") @Consumes({"text/plain","application/json"}) @Path("/validateEvent") public Collection<ValidationError> validateEvent(String event) Being able to validate a given event is useful when you want to develop custom events and associated schemas- Parameters:
event
- the event to be validated- Returns:
- Validation error messages if there is some
-
validateEvents
@POST @Produces("application/json;charset=UTF-8") @Consumes({"text/plain","application/json"}) @Path("/validateEvents") public Map<String,Set<ValidationError>> validateEvents(String events) Being able to validate a given list of event is useful when you want to develop custom events and associated schemas- Parameters:
events
- the events to be validated- Returns:
- Validation error messages if there is some grouped per event type
-