/
Working with the Catalog Framework

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.

Blueprint Service Reference
<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.

Create, Update, Delete Methods
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 PreIngestPlugins before execution and PostIngestPlugins after execution.

Query

Query methods search metadata from available Sources based on the QueryRequest properties and Federation Strategy.  Sources could include Catalog ProviderConnected Sources, and Federated Sources.

Query Methods
public QueryResponse query(QueryRequest query) throws UnsupportedQueryException, SourceUnavailableException, FederationException;
public QueryResponse query(QueryRequest queryRequest, FederationStrategy strategy) throws SourceUnavailableException, UnsupportedQueryException, FederationException;

Query requests process PreQueryPlugins before execution and PostQueryPlugins after execution.

Resources

Resource methods retrieve products from Sources.

Resource Methods
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 PreResourcePlugins before execution and PostResourcePlugins after execution.

Sources

Source methods can get a list of Source identifiers or request descriptions about Sources.

Source Methods
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.

Transform Methods
// 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;