Tm1ConnectionDetails
import io.skipcheck.tm1.spring.boot.autoconfigure.Tm1ConnectionDetails; How to connect to a TM1 server: the source of truth for the server's auto-configured
session and pool. By default it comes from the server's properties, tm1.* or
tm1.servers.<name>.*. A bean of yours named <name>Tm1ConnectionDetails
takes its place, for any server. For the default server, so does a bean of yours under
any other name, or @ServiceConnection on a Tm1ServerContainer (with
tm1-spring-boot-testcontainers); see Tm1AutoConfiguration.
A bean of your own for the default server, for credentials the properties can't describe:
// In place of the tm1.* connection properties: a CAM passport, fetched for each login
@Configuration(proxyBeanMethods = false)
static class Tm1Connection {
@Bean
Tm1ConnectionDetails tm1ConnectionDetails(CamPassports passports) {
return new Tm1ConnectionDetails() {
@Override
public String getServiceRoot() {
return "https://tm1.example.com:8010/api/v1/";
}
@Override
public Tm1Authenticator getAuthenticator() {
return Tm1Authenticator.camPassport(passports::current);
}
};
}
}
Members
getServiceRoot | The REST API's service root, such as http://tm1:8010/api/v1/. |
getAuthenticator | The credentials to log in with. |
getSslBundle | The SSL bundle to connect with, for a server on HTTPS with certificates the JVM doesn't trust by default. |
getServiceRoot
String getServiceRoot() The REST API's service root, such as http://tm1:8010/api/v1/.
Returns
- the service root
getAuthenticator
Tm1Authenticator getAuthenticator()The credentials to log in with.
Returns
- the authenticator
getSslBundle
SslBundle getSslBundle()The SSL bundle to connect with, for a server on HTTPS with certificates the JVM doesn't trust by default.
Returns
- the bundle, or
nullfor the JVM's defaults
Also in the Javadoc.