This is a Spring Boot auto-configuration for the Java API client.
To declare a dependency to this client, use the following syntax.
Add this dependency to your project’s POM:
<dependency>
<groupId>com.decisionbrain</groupId>
<artifactId>spring-boot-starter-optimserver-api-client</artifactId>
<version>4.0.2</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project’s build file:
compile "com.decisionbrain:spring-boot-starter-optimserver-api-client:4.0.2"
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);
}
}
The client Javadoc is available in this page .
You can configure the master API URL with the property:
optim-server:
url: https://master-host/
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
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
.