public class TypeRegistry extends Object implements ITypeRegistry
Modifier and Type | Field and Description |
---|---|
protected URI |
baseURI |
protected javax.ws.rs.client.Client |
client |
protected javax.ws.rs.client.WebTarget |
createTarget |
protected String |
identifierPrefix |
protected javax.ws.rs.client.WebTarget |
idTarget |
protected javax.ws.rs.client.WebTarget |
rootTarget |
protected javax.ws.rs.client.WebTarget |
searchTarget |
Constructor and Description |
---|
TypeRegistry(String baseURI,
String identifierPrefix) |
Modifier and Type | Method and Description |
---|---|
static TypeRegistry |
configFromProperties(Properties properties)
Factory method.
|
javax.ws.rs.core.Response |
createPropertyDefinition(PropertyDefinition propertyDefinition,
String creator,
String emailAddress,
Date date,
String organization) |
void |
createTypeDefinition(String typeIdentifier,
TypeDefinition typeDefinition) |
EntityClass |
determineEntityClass(String identifier)
Determines whether the given identifier references a property or type.
|
String |
getIdentifierPrefix() |
boolean |
isTypeRegistryPID(String pid)
Determines whether the given PID is an identifier in the type registry.
|
Object |
query(String identifier)
Generic query method.
|
PropertyDefinition |
queryPropertyDefinition(String propertyIdentifier)
Retrieves a property definition by its unique identifier.
|
List<PropertyDefinition> |
queryPropertyDefinitionByName(String propertyName)
Retrieves a property definition by its property name.
|
TypeDefinition |
queryTypeDefinition(String typeIdentifier)
Queries a type definition record from the type registry.
|
void |
removePropertyDefinition(String propertyIdentifier)
Removes the property definition with given PID.
|
protected final URI baseURI
protected String identifierPrefix
protected javax.ws.rs.client.Client client
protected javax.ws.rs.client.WebTarget rootTarget
protected javax.ws.rs.client.WebTarget searchTarget
protected javax.ws.rs.client.WebTarget idTarget
protected javax.ws.rs.client.WebTarget createTarget
public static TypeRegistry configFromProperties(Properties properties) throws InvalidConfigException
properties
- InvalidConfigException
public PropertyDefinition queryPropertyDefinition(String propertyIdentifier) throws IOException
ITypeRegistry
queryPropertyDefinition
in interface ITypeRegistry
IOException
- on communication errors with a remote registrypublic List<PropertyDefinition> queryPropertyDefinitionByName(String propertyName) throws IOException
ITypeRegistry
queryPropertyDefinitionByName
in interface ITypeRegistry
IOException
- on communication errors with a remote registrypublic javax.ws.rs.core.Response createPropertyDefinition(PropertyDefinition propertyDefinition, String creator, String emailAddress, Date date, String organization) throws IOException
IOException
public TypeDefinition queryTypeDefinition(String typeIdentifier) throws IOException
ITypeRegistry
queryTypeDefinition
in interface ITypeRegistry
IOException
- on communication errors with a remote registrypublic void createTypeDefinition(String typeIdentifier, TypeDefinition typeDefinition)
createTypeDefinition
in interface ITypeRegistry
public void removePropertyDefinition(String propertyIdentifier) throws IOException
ITypeRegistry
removePropertyDefinition
in interface ITypeRegistry
IOException
- on communication errors with a remote registrypublic Object query(String identifier) throws com.fasterxml.jackson.core.JsonProcessingException, IOException
ITypeRegistry
query
in interface ITypeRegistry
com.fasterxml.jackson.core.JsonProcessingException
IOException
public EntityClass determineEntityClass(String identifier) throws IOException
ITypeRegistry
determineEntityClass
in interface ITypeRegistry
EntityClass
IOException
- on communication errors with a remote registrypublic boolean isTypeRegistryPID(String pid)
ITypeRegistry
isTypeRegistryPID
in interface ITypeRegistry
public String getIdentifierPrefix()
Copyright © 2014. All rights reserved.