public interface MetacardTypeRegistry
MetacardType
s that are supported by the system's Endpoints and
Sources. MetacardTypes describe the attributes in a specific Metacard. This registry allows other
DDF components to lookup MetacardTypes based on their qualified name. MetacardTypes should
typically be registered by Sources that support that data set. Lookups will typically be
performed by InputTransformers to discover how the incoming metadata should be parsed.
This code is experimental. While this interface is functional and tested, it may change or be removed in a future version of the library.
Modifier and Type | Field and Description |
---|---|
static String |
METACARD_TYPE_NAME_KEY |
static String |
METACARD_TYPE_NAMESPACE_KEY |
Modifier and Type | Method and Description |
---|---|
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.
|
static final String METACARD_TYPE_NAMESPACE_KEY
static final String METACARD_TYPE_NAME_KEY
void register(QualifiedMetacardType qualifiedMetacardType) throws IllegalArgumentException
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.
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.void unregister(QualifiedMetacardType qualifiedMetacardType) throws IllegalArgumentException, MetacardTypeUnregistrationException
qualifiedMetacardType
- The MetacardType to remove from the registry. Cannot be null or
empty.IllegalArgumentException
MetacardTypeUnregistrationException
QualifiedMetacardType lookup(String namespace, String metacardTypeName) throws IllegalArgumentException
MetacardType
identified by the namespace and MetacardType name.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.QualifiedMetacardType lookup(String metacardTypeName) throws IllegalArgumentException
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.Set<QualifiedMetacardType> getRegisteredTypes()
This work is licensed under a Creative Commons Attribution 4.0 International License.