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 InputTransformers, MetacardTransformers,
QueryResponseTransformers, 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
MetacardTypeRegistryQualifiedMetacardType in the system so that it is accessible to InputTransformers, MetacardTransformers,
QueryResponseTransformers, and other components. This allows
those components to know how to properly interpret a Metacard and its Attributes.
If the QualifiedMetacardType does not contain a namespace, the default namespace will be assumed.
register in interface MetacardTypeRegistryqualifiedMetacardType - 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
MetacardTypeRegistryMetacardType identified by the namespace and MetacardType name.lookup in interface MetacardTypeRegistrynamespace - 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
MetacardTypeRegistrylookup in interface MetacardTypeRegistrymetacardTypeName - 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
MetacardTypeRegistryunregister in interface MetacardTypeRegistryqualifiedMetacardType - The MetacardType to remove from the registry. Cannot be null or
empty.IllegalArgumentExceptionMetacardTypeUnregistrationExceptionpublic Set<QualifiedMetacardType> getRegisteredTypes()
MetacardTypeRegistrygetRegisteredTypes in interface MetacardTypeRegistryThis work is licensed under a Creative Commons Attribution 4.0 International License.