public final class ResourceTypeFactory extends Object
| Constructor and Description |
|---|
ResourceTypeFactory()
will register the default resource types
|
| Modifier and Type | Method and Description |
|---|---|
Collection<ResourceType> |
getAllResourceTypes() |
ResourceType |
getResourceType(String endpoint)
tries to get a resource type by the endpoint path under which it is accessible
|
Optional<ResourceType> |
getResourceTypeByName(String name)
gets a resource type by its name value
|
protected boolean |
isResourceRegistered(String resourceName)
checks if a resource type with the given name does exist
|
ResourceType |
registerResourceType(ResourceHandler resourceHandler,
com.fasterxml.jackson.databind.JsonNode resourceType,
com.fasterxml.jackson.databind.JsonNode resourceSchema,
com.fasterxml.jackson.databind.JsonNode... resourceSchemaExtensions)
this method will register a new resource type
|
void |
registerResourceType(ResourceHandler resourceHandler,
String id,
String name,
String description,
String schema,
String endpoint,
com.fasterxml.jackson.databind.JsonNode resourceSchema,
com.fasterxml.jackson.databind.JsonNode... resourceSchemaExtensions)
builds a json resource type object and calls
registerResourceType(ResourceHandler, JsonNode, JsonNode, JsonNode...) |
public ResourceTypeFactory()
public ResourceType registerResourceType(ResourceHandler resourceHandler, com.fasterxml.jackson.databind.JsonNode resourceType, com.fasterxml.jackson.databind.JsonNode resourceSchema, com.fasterxml.jackson.databind.JsonNode... resourceSchemaExtensions)
resourceType - the resource type as json documentresourceSchema - the resource schema definition as json object this object will additionally be
registered within the SchemaFactory. This is the resource that is referenced under the
"schema" attribute within the resourceType documentresourceSchemaExtensions - the extensions that will be appended to the resourceSchema
definitionpublic void registerResourceType(ResourceHandler resourceHandler, String id, String name, String description, String schema, String endpoint, com.fasterxml.jackson.databind.JsonNode resourceSchema, com.fasterxml.jackson.databind.JsonNode... resourceSchemaExtensions)
registerResourceType(ResourceHandler, JsonNode, JsonNode, JsonNode...)id - the id of the resource typename - the name of the resource typedescription - the description of the resource typeschema - the resource type schema that describes this resource typeendpoint - the endpoint under which this resource should be reachableresourceSchema - the resource schema definition as json object these object will also be registeredresourceSchemaExtensions - the extensions that will be appended to the resourceSchema
definitionpublic ResourceType getResourceType(String endpoint)
endpoint - the endpoint of the resource typeprotected boolean isResourceRegistered(String resourceName)
resourceName - the name of the resourcepublic Optional<ResourceType> getResourceTypeByName(String name)
name - the name value of the given resource typepublic Collection<ResourceType> getAllResourceTypes()
Copyright © 2019. All rights reserved.