Package ddf.catalog.data
Interface MetacardTypeRegistry
public interface MetacardTypeRegistry
Registry to maintain
MetacardTypes 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.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionThis must be invoked each time an updated view of the registered types is desired.Gets the MetacardType identified using the default namespace and the specified MetacardType name.Gets theMetacardTypeidentified by the namespace and MetacardType name.voidregister(QualifiedMetacardType qualifiedMetacardType) Registers aQualifiedMetacardTypein the system so that it is accessible toInputTransformers,MetacardTransformers,QueryResponseTransformers, and other components.voidunregister(QualifiedMetacardType qualifiedMetacardType) Removes from the registry the given QualifiedMetacardType.
-
Field Details
-
METACARD_TYPE_NAMESPACE_KEY
- See Also:
-
METACARD_TYPE_NAME_KEY
- See Also:
-
-
Method Details
-
register
Registers aQualifiedMetacardTypein the system so that it is accessible toInputTransformers,MetacardTransformers,QueryResponseTransformers, and other components. This allows those components to know how to properly interpret aMetacardand itsAttributes.If the QualifiedMetacardType does not contain a namespace, the default namespace will be assumed.
- Parameters:
qualifiedMetacardType- theQualifiedMetacardTypeto make available to the catalog framework.- Throws:
IllegalArgumentException- An IllegalArgumentException will be thrown if qualifiedMetacardType is null. An IllegalArgumentException will also be thrown if theQualifiedMetacardType's name is null or empty.
-
unregister
void unregister(QualifiedMetacardType qualifiedMetacardType) throws IllegalArgumentException, MetacardTypeUnregistrationException Removes from the registry the given QualifiedMetacardType.- Parameters:
qualifiedMetacardType- The MetacardType to remove from the registry. Cannot be null or empty.- Throws:
IllegalArgumentExceptionMetacardTypeUnregistrationException
-
lookup
QualifiedMetacardType lookup(String namespace, String metacardTypeName) throws IllegalArgumentException Gets theMetacardTypeidentified by the namespace and MetacardType name.- Parameters:
namespace- prefix qualifier in which theMetacardTypename is unique.metacardTypeName- unique name identifyingMetacardType. Cannot be null or empty.- Returns:
QualifiedMetacardTypematching provided namespace and metacardTypeName or null if no matching MetacardType can be found.- Throws:
IllegalArgumentException- if the namespace is null or if the metacardTypeName is null or empty.
-
lookup
Gets the MetacardType identified using the default namespace and the specified MetacardType name.- Parameters:
metacardTypeName- unique name identifyingMetacardType. Cannot be null or empty.- Returns:
QualifiedMetacardTypematching provided namespace and metacardTypeName or null if no matching MetacardType can be found.- Throws:
IllegalArgumentException- if the metacardTypeName is null or empty.
-
getRegisteredTypes
Set<QualifiedMetacardType> getRegisteredTypes()This must be invoked each time an updated view of the registered types is desired.- Returns:
- Unmodifiable copy of the set of registered MetacardTypes in the system.
-