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
Header | Description |
---|---|
operation | the 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.
Header | Message Body (Input) | Exchange Modification (Output) |
---|---|---|
operation = CREATE | List<Metacard> or Metacard | exchange.getIn().getBody() updated with List of Metacards created |
operation = UPDATE | List<Metacard> or Metacard | exchange.getIn().getBody() updated with List of Metacards updated |
operation = DELETE | List<String> or String (representing metacard IDs) | exchange.getIn().getBody() updated with List of Metacards deleted |
Samples
This example demonstrates:
- Reading in some sample data from the file system.
- Using a Java bean to convert the data into a Metacard.
- Setting a header value on the Exchange.
- 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>