skipcheck

TM1 Spring Boot starter · Docs · The client

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

getServiceRootThe REST API's service root, such as http://tm1:8010/api/v1/.
getAuthenticatorThe credentials to log in with.
getSslBundleThe 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 null for the JVM's defaults

Also in the Javadoc.