Class ServerService

java.lang.Object
io.skipcheck.tm1.client.service.server.ServerService

public final class ServerService extends Object
The server: what it is (Server), how it's configured, and its loggers.

The static configuration is tm1s.cfg's, and the one to change; the active one is what the server runs with now, read only.

Read the server's name and version:

return tm1.server()
	.server(ODataQuery.none().select(Server.NAME, Server.PRODUCT_VERSION))
	.map(server -> server.name() + " runs TM1 " + server.productVersion());

Read a setting the server runs with now:

// What the server runs with now, which can differ from tm1s.cfg until it restarts
return tm1.server()
	.activeConfiguration(ODataQuery.none())
	.mapNotNull(ServerSettings::administration)
	.mapNotNull(AdministrationSettings::dataBaseDirectory);

Change a logger's level:

// Takes effect at once, without a restart
return tm1.server().setLoggerLevel("TM1.Process", LogLevel.DEBUG);
  • Constructor Details

    • ServerService

      public ServerService(Tm1Session session)
      A service sending its requests through session.
      Parameters:
      session - the session
  • Method Details

    • server

      @Tm1Endpoint("Singleton Server") public reactor.core.publisher.Mono<Server> server(ODataQuery query)
      GET Server: the server's name, version and ports. TM1 (11.8) sends no ETag for it.
      Parameters:
      query - what to select
      Returns:
      the server
    • staticConfiguration

      @Tm1Endpoint("Singleton StaticConfiguration") public reactor.core.publisher.Mono<ServerSettings> staticConfiguration(ODataQuery query)
      GET StaticConfiguration: the settings the server started with, from tm1s.cfg.
      Parameters:
      query - what to select
      Returns:
      the settings
    • updateStaticConfiguration

      @Tm1Endpoint("Singleton StaticConfiguration") public reactor.core.publisher.Mono<Void> updateStaticConfiguration(ServerSettingsPatch patch)
      PATCH StaticConfiguration: changes tm1s.cfg; most settings take effect when the server next starts.
      Parameters:
      patch - the settings to change
      Returns:
      completes when they're written
    • activeConfiguration

      @Tm1Endpoint("Singleton ActiveConfiguration") public reactor.core.publisher.Mono<ServerSettings> activeConfiguration(ODataQuery query)
      GET ActiveConfiguration: the settings the server runs with now. Read only: TM1 (11.8) refuses a PATCH here ("PATCH not allowed on this resource"); settings change through updateStaticConfiguration(ServerSettingsPatch).
      Parameters:
      query - what to select
      Returns:
      the settings
    • configuration

      @Deprecated(since="11.0.0") @Tm1Endpoint("Singleton Configuration") public reactor.core.publisher.Mono<Configuration> configuration(ODataQuery query)
      Deprecated.
      Deprecated in TM1 schema 11.0.0: use staticConfiguration(ODataQuery) and activeConfiguration(ODataQuery).
      GET Configuration: the server's configuration in the older, flat form.
      Parameters:
      query - what to select
      Returns:
      the configuration
    • loggers

      @Tm1Endpoint("EntitySet Loggers") public reactor.core.publisher.Flux<Logger> loggers(ODataQuery query)
      GET Loggers, streamed: the server's loggers and their levels.
      Parameters:
      query - what to select, filter and order
      Returns:
      the loggers
    • logger

      @Tm1Endpoint("EntitySet Loggers") public reactor.core.publisher.Mono<Logger> logger(String name, ODataQuery query)
      GET Loggers('name').
      Parameters:
      name - the logger's name, such as TM1.Server
      query - what to select
      Returns:
      the logger, or a Tm1NotFoundException if there's none
    • setLoggerLevel

      @Tm1Endpoint("EntitySet Loggers") public reactor.core.publisher.Mono<Void> setLoggerLevel(String name, LogLevel level)
      PATCH Loggers('name'): changes a logger's level, at once.
      Parameters:
      name - the logger's name
      level - the new level
      Returns:
      completes when it's changed