Class LevelService

java.lang.Object
io.skipcheck.tm1.client.service.dimension.LevelService

public final class LevelService extends Object
Levels: /Dimensions('d')/Hierarchies('h')/Levels, keyed by number, and their members. Read only: TM1 derives levels from the hierarchy's structure.

List a hierarchy's levels, with how many members each has:

// Each level's number and how many members it has, as "1: 2"
return tm1.levels()
	.list("Region", "Region", ODataQuery.none())
	.map(level -> level.number() + ": " + level.cardinality());

Read a level's members. Levels are numbered from the top, so level 0 holds the roots:

// Levels count from the top: level 0 holds the roots, level 1 their children
return tm1.levels().members("Region", "Region", 1, ODataQuery.none().select(Member.NAME)).map(Member::name);
  • Constructor Details

    • LevelService

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

    • list

      @Tm1Endpoint("Navigation Hierarchy/Levels") public reactor.core.publisher.Flux<Level> list(String dimension, String hierarchy, ODataQuery query)
      GET …/Hierarchies('h')/Levels, streamed.
      Parameters:
      dimension - the dimension's name
      hierarchy - the hierarchy's name
      query - what to select, expand, filter and order
      Returns:
      the hierarchy's levels
    • get

      @Tm1Endpoint("Navigation Hierarchy/Levels") public reactor.core.publisher.Mono<Level> get(String dimension, String hierarchy, int number, ODataQuery query)
      GET …/Levels(n).
      Parameters:
      dimension - the dimension's name
      hierarchy - the hierarchy's name
      number - the level's number, from 0
      query - what to select and expand
      Returns:
      the level, or a Tm1NotFoundException if there's none
    • members

      @Tm1Endpoint("Navigation Level/Members") public reactor.core.publisher.Flux<Member> members(String dimension, String hierarchy, int number, ODataQuery query)
      GET …/Levels(n)/Members, streamed.
      Parameters:
      dimension - the dimension's name
      hierarchy - the hierarchy's name
      number - the level's number
      query - what to select, expand, filter and order
      Returns:
      the level's members
    • hierarchy

      @Tm1Endpoint("Navigation Level/Hierarchy") public reactor.core.publisher.Mono<Hierarchy> hierarchy(String dimension, String hierarchy, int number, ODataQuery query)
      GET …/Levels(n)/Hierarchy.
      Parameters:
      dimension - the dimension's name
      hierarchy - the hierarchy's name
      number - the level's number
      query - what to select and expand
      Returns:
      the level's hierarchy