public class TypingService extends Object implements ITypingService
Modifier and Type | Field and Description |
---|---|
protected IIdentifierSystem |
identifierSystem |
protected ITypeRegistry |
typeRegistry |
Constructor and Description |
---|
TypingService(IIdentifierSystem identifierSystem,
ITypeRegistry typeRegistry) |
Modifier and Type | Method and Description |
---|---|
boolean |
conformsToType(String pid,
String typeIdentifier) |
boolean |
deletePID(String pid)
Remove the given PID.
|
PropertyDefinition |
describeProperty(String propertyIdentifier)
Retrieves a property definition
|
TypeDefinition |
describeType(String typeIdentifier)
Retrieves a type definition
|
EntityClass |
determineEntityClass(String identifier)
Determines whether the given identifier references a simple object, a
property, a type etc.
|
Object |
genericResolve(String pid)
Resolves the given PID without previous knowledge about the kind of
entity it identifies (e.g. a common PID record, a property or type
definition etc.).
|
IIdentifierSystem |
getIdentifierSystem() |
ITypeRegistry |
getTypeRegistry() |
boolean |
isIdentifierRegistered(String pid)
Checks whether the given PID is already registered.
|
PIDInformation |
queryAllProperties(String pid)
Queries all properties from the given PID, independent of types.
|
PIDInformation |
queryAllProperties(String pid,
boolean includePropertyNames) |
PIDInformation |
queryByType(String pid,
String typeIdentifier,
boolean includePropertyNames)
Queries all properties of a type available from the given PID.
|
PIDInformation |
queryByType(String pid,
TypeDefinition typeDefinition)
Queries all properties of a given type available from the given PID.
|
PIDInformation |
queryByTypeWithConformance(String pid,
List<String> typeIdentifiers,
boolean includePropertyNames) |
PIDInformation |
queryByTypeWithConformance(String pid,
String typeIdentifier,
boolean includePropertyNames)
Same as
ITypingService.queryByType(java.lang.String, java.lang.String, boolean) , but also performs a type conformance check. |
String |
queryProperty(String pid,
PropertyDefinition propertyDefinition)
Queries a single property from the given PID.
|
PIDInformation |
queryProperty(String pid,
String propertyIdentifier)
Queries a single property from the PID.
|
String |
registerPID(Map<String,String> properties)
Registers a new PID with given property values.
|
protected final IIdentifierSystem identifierSystem
protected final ITypeRegistry typeRegistry
public TypingService(IIdentifierSystem identifierSystem, ITypeRegistry typeRegistry) throws IOException
IOException
public boolean isIdentifierRegistered(String pid) throws IOException
IIdentifierSystem
isIdentifierRegistered
in interface IIdentifierSystem
IOException
public String queryProperty(String pid, PropertyDefinition propertyDefinition) throws IOException
IIdentifierSystem
queryProperty
in interface IIdentifierSystem
IOException
public String registerPID(Map<String,String> properties) throws IOException
IIdentifierSystem
registerPID
in interface IIdentifierSystem
properties
- A simple dictionary with string keys and string values that
contains the initial PID record.IOException
public PIDInformation queryByType(String pid, TypeDefinition typeDefinition) throws IOException
IIdentifierSystem
queryByType
in interface IIdentifierSystem
IOException
public boolean deletePID(String pid)
IIdentifierSystem
deletePID
in interface IIdentifierSystem
public PropertyDefinition describeProperty(String propertyIdentifier) throws IOException
ITypingService
describeProperty
in interface ITypingService
IOException
public TypeDefinition describeType(String typeIdentifier) throws IOException
ITypingService
describeType
in interface ITypingService
IOException
public boolean conformsToType(String pid, String typeIdentifier) throws IOException
conformsToType
in interface ITypingService
IOException
public Object genericResolve(String pid) throws IOException
ITypingService
genericResolve
in interface ITypingService
IOException
public PIDInformation queryAllProperties(String pid) throws IOException
IIdentifierSystem
queryAllProperties
in interface IIdentifierSystem
IOException
public PIDInformation queryAllProperties(String pid, boolean includePropertyNames) throws IOException, InconsistentRecordsException
public PIDInformation queryProperty(String pid, String propertyIdentifier) throws IOException
ITypingService
queryProperty
in interface ITypingService
propertyIdentifier
- must be registered in the type registryIOException
public PIDInformation queryByType(String pid, String typeIdentifier, boolean includePropertyNames) throws IOException, InconsistentRecordsException
ITypingService
queryByType
in interface ITypingService
typeIdentifier
- a type identifier, not a nameincludePropertyNames
- if true, the method will also return property names at
additional call costs.IOException
InconsistentRecordsException
public PIDInformation queryByTypeWithConformance(String pid, String typeIdentifier, boolean includePropertyNames) throws IOException, InconsistentRecordsException
ITypingService
ITypingService.queryByType(java.lang.String, java.lang.String, boolean)
, but also performs a type conformance check.
The result of the check will be available from the PID information record
returned.queryByTypeWithConformance
in interface ITypingService
IOException
InconsistentRecordsException
public PIDInformation queryByTypeWithConformance(String pid, List<String> typeIdentifiers, boolean includePropertyNames) throws IOException, InconsistentRecordsException
queryByTypeWithConformance
in interface ITypingService
IOException
InconsistentRecordsException
public EntityClass determineEntityClass(String identifier) throws IOException
ITypingService
determineEntityClass
in interface ITypingService
EntityClass
IOException
public ITypeRegistry getTypeRegistry()
public IIdentifierSystem getIdentifierSystem()
Copyright © 2014. All rights reserved.