/
Catalog Framework Camel Component

Catalog Framework Camel Component

Overview

The catalog framework camel component supports creating, updating and deleting metacards using the Catalog Framework from a Camel route.

URI format

catalog:framework

Message Headers

Catalog Framework Producer


HeaderDescription
operationthe operation to perform using the catalog framework. (possible values are CREATE | UPDATE | DELETE)

Sending Messages To Catalog Framework Endpoint

Catalog Framework Producer

In Producer mode, the component provides the ability to provide different inputs and have the catalog framework perform different operations based upon the header values.  For the CREATE and UPDATE operation, the message body can contain a list of Metacards or a single Metacard object.  For the DELETE operation, the message body can contain a list of Strings or a single String object. The String objects represent the IDs of Metacards that you would want to delete.  The exchange's "in" message will be set with the affected Metacards. In the case of a CREATE, it will be updated with the created Metacards. In the case of the UPDATE, it will be updated with the updated Metacards and with the DELETE it will contain the deleted Metacards.

HeaderMessage Body (Input)Exchange Modification (Output)
operation = CREATEList<Metacard> or Metacardexchange.getIn().getBody() updated with List of Metacards created
operation = UPDATEList<Metacard> or Metacardexchange.getIn().getBody() updated with List of Metacards updated
operation = DELETEList<String> or String (representing metacard IDs)exchange.getIn().getBody() updated with List of Metacards deleted

Samples

This example demonstrates:

  1. Reading in some sample data from the file system.
  2. Using a Java bean to convert the data into a Metacard.
  3. Setting a header value on the Exchange.
  4. Sending the Metacard to the Catalog Framework component for ingestion.
<route>
	<from uri="file:data/sampleData?noop=true"/>
    <bean ref="sampleDataToMetacardConverter" method="covertToMetacard"/>
  	<setHeader headerName="operation">
		<constant>CREATE</constant>
	</setHeader>
    <to uri="catalog:framework"/>
</route>