Class GroupService

java.lang.Object
io.skipcheck.tm1.client.service.security.GroupService

public final class GroupService extends Object
Security groups: /Groups and their users. A user's membership is set from the user's side, with UserService.setGroups(String, List).

List a group's members:

return tm1.groups().users("Planners", ODataQuery.none().select(User.NAME)).map(User::name);

Create a group and add a user to it, from the user's side:

// A new group, then alice added to it, from her side: her groups plus this one
return tm1.groups()
	.create("Planners")
	.then(tm1.users().groups("alice", ODataQuery.none().select(Group.NAME)).map(Group::name).collectList())
	.flatMap(groups -> tm1.users()
		.setGroups("alice", Stream.concat(groups.stream(), Stream.of("Planners")).toList()));
  • Constructor Details

    • GroupService

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

    • list

      @Tm1Endpoint("EntitySet Groups") public reactor.core.publisher.Flux<Group> list(ODataQuery query)
      GET Groups, streamed.
      Parameters:
      query - what to select, expand, filter and order
      Returns:
      the groups
    • get

      @Tm1Endpoint("EntitySet Groups") public reactor.core.publisher.Mono<Group> get(String name, ODataQuery query)
      GET Groups('name').
      Parameters:
      name - the group's name
      query - what to select and expand
      Returns:
      the group, or a Tm1NotFoundException if there's none
    • create

      @Tm1Endpoint("EntitySet Groups") public reactor.core.publisher.Mono<Group> create(String name)
      POST Groups: creates an empty group.
      Parameters:
      name - the group's name
      Returns:
      the group as created
    • delete

      @Tm1Endpoint("EntitySet Groups") public reactor.core.publisher.Mono<Void> delete(String name)
      DELETE Groups('name'): deletes the group; its users stay, without it.
      Parameters:
      name - the group's name
      Returns:
      completes when the group is deleted
    • users

      @Tm1Endpoint("Navigation Group/Users") public reactor.core.publisher.Flux<User> users(String name, ODataQuery query)
      GET Groups('name')/Users, streamed.
      Parameters:
      name - the group's name
      query - what to select
      Returns:
      the group's users