Spring Boot API (Sync)

Definition :

This is a Spring Boot auto-configuration for the Java API client.

Dependency declaration

To declare a dependency to this client, use the following syntax.

Maven users

Add this dependency to your project’s POM:

<dependency>
  <groupId>com.decisionbrain</groupId>
  <artifactId>spring-boot-starter-optimserver-api-client</artifactId>
  <version>3.3.1</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project’s build file:

compile "com.decisionbrain:spring-boot-starter-optimserver-api-client:3.3.1"

And enable the API client with the @EnableOptimServerClient annotation on your Spring application class:

@SpringBootApplication
@EnableOptimServerClient
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Usage

The client Javadoc is available in this page .

Configuration

You can configure the master API URL with the property:

optim-server:
  url: https://master-host/

Keycloak authentication

To enable the Keycloak authentication, you have to configure the following properties (default values below):

optim-server:
  keycloak:
    url:
    realm: decisionbrain
    clientId: optimserver
    user: optimserver
    password: optimserver

Basic authentication

To enable the basic authentication, you have to configure the following properties (default values below):

optim-server:
  basicAuth:
    user: decisionbrain
    password: optimserver

Available beans

You can then inject the beans you need to query the individual API endpoints using the @Autowired annotation. The complete list of available beans is available in this page .