Working with the Catalog Framework
Overview
The Catalog Framework functions as the routing mechanism between all catalog components. It decouples clients from service implementations and provides integration points for Catalog Plugins and convenience methods for Endpoint developers.
Usage
Catalog Framework Reference
The Catalog Framework can be requested from the OSGi registry. See Working with OSGi for more details on Blueprint injection.
<reference id="catalogFramework" interface="ddf.catalog.CatalogFramework" />
Methods
Create, Update, and Delete
Create, Update, and Delete (CUD) methods add, change, or remove stored metadata in the local Catalog Provider.
public CreateResponse create(CreateRequest createRequest) throws IngestException, SourceUnavailableException; public UpdateResponse update(UpdateRequest updateRequest) throws IngestException, SourceUnavailableException; public DeleteResponse delete(DeleteRequest deleteRequest) throws IngestException, SourceUnavailableException;
CUD operations process PreIngestPlugin
s before execution and PostIngestPlugin
s after execution.
Query
Query methods search metadata from available Sources based on the QueryRequest
properties and Federation Strategy. Sources could include Catalog Provider, Connected Sources, and Federated Sources.
public QueryResponse query(QueryRequest query) throws UnsupportedQueryException, SourceUnavailableException, FederationException; public QueryResponse query(QueryRequest queryRequest, FederationStrategy strategy) throws SourceUnavailableException, UnsupportedQueryException, FederationException;
Query requests process PreQueryPlugin
s before execution and PostQueryPlugin
s after execution.
Resources
Resource methods retrieve products from Sources.
public ResourceResponse getEnterpriseResource(ResourceRequest request) throws IOException, ResourceNotFoundException, ResourceNotSupportedException; public ResourceResponse getLocalResource(ResourceRequest request) throws IOException, ResourceNotFoundException, ResourceNotSupportedException; public ResourceResponse getResource(ResourceRequest request, String resourceSiteName) throws IOException, ResourceNotFoundException, ResourceNotSupportedException;
Resource requests process PreResourcePlugin
s before execution and PostResourcePlugin
s after execution.
Sources
Source methods can get a list of Source identifiers or request descriptions about Sources.
public Set<String> getSourceIds(); public SourceInfoResponse getSourceInfo(SourceInfoRequest sourceInfoRequest) throws SourceUnavailableException;
Transforms
Transform methods provide convenience methods for using Metacard Transformers and Query Response Transformers.
// Metacard Transformer public BinaryContent transform(Metacard metacard, String transformerId, Map<String, Serializable> requestProperties) throws CatalogTransformerException; // Query Response Transformer public BinaryContent transform(SourceResponse response, String transformerId, Map<String, Serializable> requestProperties) throws CatalogTransformerException;