Building a Connector Overview
Building a connector means implementing one Java interface, packaging it with its libraries into a single JAR, and proving it works against a real agent. Start from the connector template so the project layout, Maven setup and service registration are already right.
- Start from a working skeleton. The connector template compiles and loads as-is, so you only add the code that talks to your target system.
- Implement only what you need. Two methods cover every request. Actions you don't support return a standard "not supported" result.
- Package once, run anywhere. The build produces one fat JAR that carries its own libraries and loads into any agent.
- Test before you onboard. Unit-test with captured request JSON, then run the JAR in a local agent and trigger real requests from Zetect.
Before you begin
- Install JDK 17 and Maven, and configure access to the Connector API. See Preparing Your Environment.
- Know which request types your connector must answer. See Connector Reference.
Key concepts
- Connector template
- The
connector-templatefolder in the agent repository: a minimal connector with a readypom.xml, an example class and its service registration file. - Service registration file
META-INF/services/io.cyiam.connector.api.Connector. It holds the fully qualified name of your connector class, so the agent'sServiceLoadercan find it.- Fat JAR
- A single JAR that contains your classes and every library they need, except the Connector API, Jackson and SLF4J, which the agent provides.
- Provided dependency
- A Maven dependency with
providedscope: available when compiling and testing, but left out of the JAR because the agent already has it.
