Class Tm1Client
java.lang.Object
io.skipcheck.tm1.client.Tm1Client
The client for one TM1 server: one
Tm1Session, and every service built on it,
such as dimensions(). Services arrive with the endpoint phases;
session() sends any request, for what has no service yet.
Tm1Client tm1 = Tm1Client.builder()
.baseUrl("http://localhost:8010/api/v1/")
.basicAuth("admin", "apple")
.build();
tm1.cubes()
.modelCubes(ODataQuery.none().select(Cube.NAME))
.map(Cube::name)
.doOnNext(System.out::println)
.then(tm1.close()) // close after the list completes, not alongside it
.block(); // block only in a standalone main(), never in reactive code
Run a long process asynchronously, so no request stays open for its whole run:
// TM1 runs it in the background and the client polls for the result, so no
// request stays open. Cancelling the subscription stops the process on TM1.
return tm1.withAsync(Duration.ofSeconds(2))
.processes()
.executeWithReturn("Rebuild Forecast", Map.of(), ODataQuery.none());
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds aTm1Client: the same settings asTm1Session.Builder, which it delegates to. -
Method Summary
Modifier and TypeMethodDescriptionAnnotations on cube cells.Attribute definitions.batch()Starts a JSON$batchon this client's session: calls made throughTm1Batch.client()are queued, andTm1Batch.run()sends them together.static Tm1Client.Builderbuilder()A builder for a client of one TM1 server.cells()Cell writes.cellsets()Cellsets.Change sets.chores()Chores.reactor.core.publisher.Mono<Void> close()Closes the session; seeTm1Session.close().reactor.core.publisher.Mono<Tm1Client> connect()Logs in now rather than on the first request, and completes with this client.contents()The contents tree.cubes()Cubes.Dimensions.Drillthrough.edges()Edges.elements()Elements.Encryption at rest.git()TM1 Git.groups()Groups.Hierarchies.levels()Levels.Translated attribute values.logs()The server's logs.members()Members.Member sets.static Tm1Clientof(Tm1Session session) A client over an existing session, such as one from a session pool or a Spring bean.oidcKeys()The cached OpenID Connect keys.Process debugging.Processes.Sandboxes.server()The server.session()The session every service uses.sessions()Server sessions.The ODBC data sources on TM1's host.subsets()Subsets.threads()Server threads.toString()users()Users.views()Views.A client on an async view of this client's session (Tm1Session.withAsync(Duration)): every service's methods work as usual, but TM1 runs each request asynchronously and the client polls for the result, so a long process or chore holds no request open.withChangeSet(String id) A client on a view of this client's session whose writes are recorded in change setid(Tm1Session.withChangeSet(String));ChangeSetService.withinmakes one for the length of some work.A client on a synchronous view of this client's session (Tm1Session.withoutAsync()).withSandbox(String name) A client whose services all run in sandboxname, sharing this client's session.
-
Method Details
-
builder
A builder for a client of one TM1 server.- Returns:
- a new builder
-
of
A client over an existing session, such as one from a session pool or a Spring bean.- Parameters:
session- the session to send requests on- Returns:
- a client over
session
-
session
-
dimensions
Dimensions.- Returns:
- the dimension service, on this client's session
-
hierarchies
Hierarchies.- Returns:
- the hierarchie service, on this client's session
-
elements
-
edges
-
levels
-
members
-
subsets
-
attributes
Attribute definitions.- Returns:
- the attribute service, on this client's session
-
localizedAttributes
Translated attribute values.- Returns:
- the localized attribute service, on this client's session
-
cubes
-
views
-
cellsets
-
cells
-
memberSets
Member sets.- Returns:
- the member set service, on this client's session
-
sandboxes
Sandboxes.- Returns:
- the sandboxe service, on this client's session
-
changeSets
Change sets.- Returns:
- the change set service, on this client's session
-
drillthrough
Drillthrough.- Returns:
- the drillthrough service, on this client's session
-
processes
Processes.- Returns:
- the processe service, on this client's session
-
processDebugging
Process debugging.- Returns:
- the process debug service, on this client's session
-
chores
-
users
-
groups
-
sessions
Server sessions.- Returns:
- the session service, on this client's session
-
threads
Server threads.- Returns:
- the thread service, on this client's session
-
server
-
logs
The server's logs.- Returns:
- the the server's log service, on this client's session
-
contents
The contents tree.- Returns:
- the the contents tree service, on this client's session
-
annotations
Annotations on cube cells.- Returns:
- the annotations on cube cell service, on this client's session
-
git
-
encryption
Encryption at rest.- Returns:
- the encryption at rest service, on this client's session
-
oidcKeys
The cached OpenID Connect keys.- Returns:
- the the cached openid connect key service, on this client's session
-
sqlDataSources
The ODBC data sources on TM1's host.- Returns:
- the the odbc data sources on tm1's host service, on this client's session
-
batch
Starts a JSON$batchon this client's session: calls made throughTm1Batch.client()are queued, andTm1Batch.run()sends them together.- Returns:
- the batch
-
withAsync
A client on an async view of this client's session (Tm1Session.withAsync(Duration)): every service's methods work as usual, but TM1 runs each request asynchronously and the client polls for the result, so a long process or chore holds no request open. Cancelling a subscription before its result stops the work on TM1.- Parameters:
every- how long to wait between polls- Returns:
- the client
-
withoutAsync
A client on a synchronous view of this client's session (Tm1Session.withoutAsync()).- Returns:
- the client
-
withSandbox
-
withChangeSet
A client on a view of this client's session whose writes are recorded in change setid(Tm1Session.withChangeSet(String));ChangeSetService.withinmakes one for the length of some work.- Parameters:
id- the change set's ID- Returns:
- the client
-
connect
Logs in now rather than on the first request, and completes with this client.- Returns:
- a
Monoemitting this client once logged in
-
close
Closes the session; seeTm1Session.close().- Returns:
- a
Monocompleting when the session is closed
-
toString
-