Class GruppenbildungsService


  • @Service
    @Profile("prod")
    public class GruppenbildungsService
    extends java.lang.Object
    Service to call REST-API from Gruppenbildung.
    • Constructor Summary

      Constructors 
      Constructor Description
      GruppenbildungsService​(org.springframework.web.client.RestTemplate restTemplate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean doesGroupExist​(java.util.UUID groupId)
      Does a group exist.
      java.util.List<UserDTO> getMembers​(java.util.UUID groupId)
      Gets all members of a given group.
      UpdatedGroupsDTO getUpdatedGroups​(long lastEventId)
      Gets all updated groups since the last event timestamp.
      java.util.List<GroupDTO> getUserGroups​(java.lang.String userName)
      Gets all groups of a given user.
      boolean isUserAdminInGroup​(java.lang.String userName, java.util.UUID groupId)
      Is a user admin in a group.
      boolean isUserInGroup​(java.lang.String userName, java.util.UUID groupId)
      Is a user member in a group.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GruppenbildungsService

        public GruppenbildungsService​(org.springframework.web.client.RestTemplate restTemplate)
    • Method Detail

      • doesGroupExist

        public boolean doesGroupExist​(java.util.UUID groupId)
                               throws MopsException
        Does a group exist.
        Parameters:
        groupId - group id to test
        Returns:
        true if it exists
        Throws:
        MopsException
      • isUserInGroup

        public boolean isUserInGroup​(java.lang.String userName,
                                     java.util.UUID groupId)
                              throws MopsException
        Is a user member in a group.
        Parameters:
        userName - user name
        groupId - group id
        Returns:
        true if the user is a member in the given group
        Throws:
        MopsException
      • isUserAdminInGroup

        public boolean isUserAdminInGroup​(java.lang.String userName,
                                          java.util.UUID groupId)
                                   throws MopsException
        Is a user admin in a group.
        Parameters:
        userName - user name
        groupId - group id
        Returns:
        true if the user is an admin in the given group
        Throws:
        MopsException
      • getUpdatedGroups

        public UpdatedGroupsDTO getUpdatedGroups​(long lastEventId)
                                          throws MopsException
        Gets all updated groups since the last event timestamp.
        Parameters:
        lastEventId - last event timestamp
        Returns:
        object that contains all updated groups
        Throws:
        MopsException
      • getMembers

        public java.util.List<UserDTO> getMembers​(java.util.UUID groupId)
                                           throws MopsException
        Gets all members of a given group.
        Parameters:
        groupId - group id
        Returns:
        list of members
        Throws:
        MopsException
      • getUserGroups

        public java.util.List<GroupDTO> getUserGroups​(java.lang.String userName)
                                               throws MopsException
        Gets all groups of a given user.
        Parameters:
        userName - user name
        Returns:
        list of groups
        Throws:
        MopsException