public final class MetacardTypeRegistryImpl extends Object implements MetacardTypeRegistry
This code is experimental. While this class is functional and tested, it may change or be removed in a future version of the library.
METACARD_TYPE_NAME_KEY, METACARD_TYPE_NAMESPACE_KEY
Modifier and Type | Method and Description |
---|---|
static MetacardTypeRegistry |
getInstance() |
Set<QualifiedMetacardType> |
getRegisteredTypes()
This must be invoked each time an updated view of the registered types is desired.
|
QualifiedMetacardType |
lookup(String metacardTypeName)
Gets the MetacardType identified using the default namespace and the specified MetacardType
name.
|
QualifiedMetacardType |
lookup(String namespace,
String metacardTypeName)
Gets the
MetacardType identified by the namespace and MetacardType name. |
void |
register(QualifiedMetacardType qualifiedMetacardType)
Registers a
QualifiedMetacardType in the system so that it is accessible to InputTransformer s, MetacardTransformer s,
QueryResponseTransformer s, and other components. |
void |
unregister(QualifiedMetacardType qualifiedMetacardType)
Removes from the registry the given QualifiedMetacardType.
|
public static MetacardTypeRegistry getInstance()
public void register(QualifiedMetacardType qualifiedMetacardType) throws IllegalArgumentException
MetacardTypeRegistry
QualifiedMetacardType
in the system so that it is accessible to InputTransformer
s, MetacardTransformer
s,
QueryResponseTransformer
s, and other components. This allows
those components to know how to properly interpret a Metacard
and its Attribute
s.
If the QualifiedMetacardType does not contain a namespace, the default namespace will be assumed.
register
in interface MetacardTypeRegistry
qualifiedMetacardType
- the QualifiedMetacardType
to make available to the catalog
framework.IllegalArgumentException
- An IllegalArgumentException will be thrown if
qualifiedMetacardType is null. An IllegalArgumentException will also be thrown if the
QualifiedMetacardType
's name is null or empty.public QualifiedMetacardType lookup(String namespace, String metacardTypeName) throws IllegalArgumentException
MetacardTypeRegistry
MetacardType
identified by the namespace and MetacardType name.lookup
in interface MetacardTypeRegistry
namespace
- prefix qualifier in which the MetacardType
name is unique.metacardTypeName
- unique name identifying MetacardType
. Cannot be null or empty.QualifiedMetacardType
matching provided namespace and metacardTypeName or null
if no matching MetacardType can be found.IllegalArgumentException
- if the namespace is null or if the metacardTypeName is null or
empty.public QualifiedMetacardType lookup(String metacardTypeName) throws IllegalArgumentException
MetacardTypeRegistry
lookup
in interface MetacardTypeRegistry
metacardTypeName
- unique name identifying MetacardType
. Cannot be null or empty.QualifiedMetacardType
matching provided namespace and metacardTypeName or null
if no matching MetacardType can be found.IllegalArgumentException
- if the metacardTypeName is null or empty.public void unregister(QualifiedMetacardType qualifiedMetacardType) throws IllegalArgumentException, MetacardTypeUnregistrationException
MetacardTypeRegistry
unregister
in interface MetacardTypeRegistry
qualifiedMetacardType
- The MetacardType to remove from the registry. Cannot be null or
empty.IllegalArgumentException
MetacardTypeUnregistrationException
public Set<QualifiedMetacardType> getRegisteredTypes()
MetacardTypeRegistry
getRegisteredTypes
in interface MetacardTypeRegistry
This work is licensed under a Creative Commons Attribution 4.0 International License.