Implementing a configuration endpoint
The configuration endpoint of a connector must respond to requests from the i2 Connect gateway with a JSON structure that describes the services in the connector. The more sophisticated the connector, the more information you need to provide.
Navigate to the source code for any of the connector projects in the connector directory of the Analyze-Connect repository. In a text editor, open one of the config.json files that implements the configuration endpoint and demonstrates an approach that you might take.
When the i2® Analyze server starts, the i2 Connect gateway sends a request to the configuration endpoint. The response that your connector sends back tells the gateway what services are available. i2 Analyze caches this information and provides it to clients when they connect.
- The
defaultValues
object is mandatory.Within thedefaultValues
object, you must specify the timezone for the i2 Connect gateway to apply to any retrieved value that does not specify its own timezone. There are also some optional settings:- You can specify a direction for any retrieved link that does not specify its own direction.
- You can specify the identifiers and locations of the entity and link types that the i2 Connect gateway applies to records if a service does not indicate the types of data that it can retrieve.
- You can provide a default setting for whether the data identifiers that the connector returns are persistent from one call to the next.Note: If you do not indicate whether these identifiers are persistent here or in the
services
array, the gateway assumes that the identifiers are not persistent.
- The
services
array is also mandatory.The
services
array must contain information for at least one synchronous or asynchronous service. The information must include a unique identifier and a name for the service. It must also specify whether the service requires a client UI, and the URL of the acquire or queriesResource endpoint.
First, construct the defaultValues
object:
Then, add an object to the services
array:
This JSON structure represents (almost) the simplest response that you can send from the configuration endpoint of a connector. It contains the definition of one simple service. In order for the i2 Connect gateway to retrieve that definition, you must add details of the connector to the i2 Analyze deployment topology.