Integrations

SDK

This document is a plugin development kit for the Anjana Data platform.
Requirements: Java 17 · Spring Boot 3.5.x

Project Structure

File / Class

Description

Example in tot-plugin-example

pom.xml

Project object model. Defines version, dependencies, and build configuration. Since v6.0.0 uses anjana-jdk-parent as parent — manages versions via BOM, without declaring them explicitly.

tot-plugin-example/pom.xml
Ref: Apache Maven

application.yaml

Startup configuration: port, SSL/TLS, Eureka, logging.

src/main/resources/application.yaml
Ref: Spring.io

application-default.yaml

Connection and ARI configuration. Deployed alongside the jar.

external/application-default.yaml

Main class

Annotated with @SpringBootApplication and @TotPlugin. Declares the base packages needed to start up and interact with tot.

TotPluginExampleApplication.java

Configuration class

Loads properties from YAML. See Multi / Single connection pattern below.

configuration/

Controller

Annotated with @TotPluginController. Implements the required operation interfaces and delegates to the services.

controller/OperationsController.java

Services (@Service)

Contain all the technology integration logic. One per operation.

service/

Directory Tree

tot-plugin-example/
├── external/
│   └── application-default.yaml       <- connections and ARIs
├── src/main/
│   ├── java/com/anjana/tot/plugin/example/
│   │   ├── configuration/
│   │   │   ├── ExampleMultiConnectionConfiguration.java
│   │   │   ├── ExampleUniqueConnectionConfiguration.java
│   │   │   └── ExampleTechnology.java
│   │   ├── controller/
│   │   │   └── OperationsController.java
│   │   ├── service/
│   │   │   ├── ExtractMetadataService.java
│   │   │   ├── ObjectService.java
│   │   │   ├── PermissionService.java
│   │   │   └── SampleDataService.java
│   │   └── TotPluginExampleApplication.java
│   └── resources/
│       └── application.yaml
└── pom.xml

Configuration Pattern: Multi Connection vs. Single Connection

The two strategies are mutually exclusive. One is chosen depending on whether the plugin manages a single connection or several.


Multiple connections

Single connection

Base class

PluginMultiConnectionProperties

PluginUniqueConnectionProperties

Example class

ExampleMultiConnectionConfiguration

ExampleUniqueConnectionConfiguration

YAML structure

Array totplugin.connection[]

Properties directly under totplugin

Technology binding

In @PostConstruct, via Spring Boot Binder, to the ExampleTechnology type

ExampleTechnology technology field in the class

ExampleTechnology (implements the Technology interface) is where the technology-specific properties are declared: credentials, driverClassName, connectionTimeout, etc. Add here the fields the integration needs.

Available Operations

The controller implements the interfaces of the tot-plugin-lib library. The following table summarizes all the operations:

Operation

Interface

Endpoint

DTOs

When it's invoked

Create group (createGroup)

IdentityManagementControllerInterfaceV2

POST /permission/create

DSAFullInfoDTO, DSAOperationResultDTO

When creating or versioning a DSA with governed datasets

Delete group (deleteGroup)

IdentityManagementControllerInterfaceV2

POST /permission/delete

DSAFullInfoDTO, DSAOperationResultDTO

When a DSA with governed datasets expires

Remove object from a group (removeObject)

IdentityManagementControllerInterfaceV2

POST /permission/object/remove

ObjectOperationDTO, ObjectOperationResultDTO

When a governed dataset expires

Assign user (addUser)

IdentityManagementControllerInterfaceV2

POST /permission/user/add

DSAFullInfoDTO, DSAOperationResultDTO

When a user joins a DSA with governed datasets

Unassign user (removeUser)

IdentityManagementControllerInterfaceV2

POST /permission/user/remove

DSAFullInfoDTO, DSAOperationResultDTO

When a user withdraws from a DSA with governed datasets

Edit object (editObject)

ManagementControllerInterface

POST /object/edit

EditFullInfoDto, ObjectOperationResultDTO

When reactivating permissions on an object that is included in a DSA again

Data sampling (sample)

SampleDataControllerInterface

POST /structure/sample

MetadataInfoDTO, SampleDataDTO

When accessing the sampling tab on a governed dataset

List objects (metadataList)

ExtractMetadataControllerInterface

POST /metadata/metadataList

ResourceDTO, ResourceStructureDTO

When requesting the list of objects available in the technology

Extract metadata (metadataExtract)

ExtractMetadataControllerInterface

POST /metadata/metadataExtract

ResourceMetadataRequestDTO, MetadataImportedDTO

When extracting metadata for a specific object of the technology

It is recommended to implement metadataList and metadataExtract asynchronously — external technologies can introduce significant latency.

Libraries

Library

What it provides

Main path

tot-lib

Data mapping DTOs. Utilities: TotConstants, TotUtils.

tot-lib/src/main/java/com/anjana/tot/core/model

customers-lib

Additional DTOs and typed enumerators.

customers-lib/src/main/java/com/anjana/core/customers/model

tot-plugin-lib

Endpoint interfaces (interfaces/), base configuration classes (PluginMultiConnectionProperties, PluginUniqueConnectionProperties), TotPluginException and utilities for reading Avro, Parquet, Excel, and CSV.

tot-plugin-lib/src/main/java/com/anjana/tot/plugin/core

How to Create a Plugin

1. Parent and Dependencies

Use anjana-jdk-parent as <parent>. Common dependencies are managed by the BOM — do not declare explicit versions.

Optional dependencies: Avro, Parquet, Excel, CSV

If the plugin needs to read these formats (like Anjana's native plugins), add the following dependencies and include the com.anjana.tot.plugin.core.container package in the main class's @ComponentScan:

XML
<!-- Apache Avro -->
<dependency>
  <groupId>org.apache.avro</groupId>
  <artifactId>avro</artifactId>
</dependency>

<!-- Apache Parquet -->
<dependency>
  <groupId>org.apache.parquet</groupId>
  <artifactId>parquet-common</artifactId>
</dependency>
<dependency>
  <groupId>org.apache.parquet</groupId>
  <artifactId>parquet-hadoop</artifactId>
</dependency>
<dependency>
  <groupId>org.apache.hadoop</groupId>
  <artifactId>hadoop-common</artifactId>
</dependency>

<!-- Excel -->
<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi</artifactId>
</dependency>
<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi-ooxml</artifactId>
</dependency>

<!-- CSV -->
<dependency>
  <groupId>commons-validator</groupId>
  <artifactId>commons-validator</artifactId>
</dependency>

2. Minimum Configuration

With multiple connections (ExampleMultiConnectionConfiguration):

YAML
totplugin:
  server:
    urls:
      - https://yourserver:15000/tot/
    keep-alive-seconds: 60
  connection:
    - name: instance-1
      aris:
        - ari: "anja:totplugin:extract:/infra/tech/zone/"
        - ari: "anja:totplugin:sample:/infra/tech/zone/"
        - ari: "anja:totplugin:im:/infra/tech/zone/"

With single connection (ExampleUniqueConnectionConfiguration):

YAML
totplugin:
  server:
    urls:
      - https://yourserver:15000/tot/
    keep-alive-seconds: 60
  aris:
    - ari: "anja:totplugin:extract:/infra/tech/zone/"
    - ari: "anja:totplugin:sample:/infra/tech/zone/"
    - ari: "anja:totplugin:im:/infra/tech/zone/"

Property

Description

server.urls

tot URL, needed to register and stay active in its registries

server.keep-alive-seconds

Re-registration frequency in tot

connection[].name

Unique connection name (multi-connection mode only)

connection[].aris / aris

Triplets (infrastructure, technology, zone) with the offered functionalities: extract (metadata extraction), sample (data sampling), im (active permission governance)

3. Services

The example services come empty: this is where all the technology integration logic is developed. Method names and structure can be freely adapted; what matters is that they are invoked from the controller.