Zetect Connector Guide Back to zetect.inSwitch portal ⇄

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

Key concepts

Connector template
The connector-template folder in the agent repository: a minimal connector with a ready pom.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's ServiceLoader can 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 provided scope: available when compiling and testing, but left out of the JAR because the agent already has it.

Tasks in this topic