Klasse GroupControllerImpl

java.lang.Object
de.dlr.proseo.usermgr.rest.GroupControllerImpl
Alle implementierten Schnittstellen:
GroupController

@Component public class GroupControllerImpl extends Object implements GroupController
Spring MVC controller for the prosEO User Manager; implements the services required to manage user groups.
Autor:
Dr. Thomas Bassler
  • Konstruktordetails

    • GroupControllerImpl

      public GroupControllerImpl()
  • Methodendetails

    • getGroups

      public org.springframework.http.ResponseEntity<List<RestGroup>> getGroups(String mission, String groupName, Integer recordFrom, Integer recordTo)
      Get user groups by mission and optionally by group name
      Angegeben von:
      getGroups in Schnittstelle GroupController
      Parameter:
      mission - the mission code and optionally by group name
      groupName - the group name (optional)
      recordFrom - first record of filtered and ordered result to return
      recordTo - last record of filtered and ordered result to return
      Gibt zurück:
      HTTP status "OK" and a list of Json objects representing groups authorized for the given mission or HTTP status "TOO MANY REQUESTS" if the result list exceeds a configured maximum HTTP status "NOT_FOUND" and an error message, if no groups matching the search criteria were found
    • createGroup

      public org.springframework.http.ResponseEntity<RestGroup> createGroup(@Valid @Valid RestGroup restGroup)
      Create a new user group
      Angegeben von:
      createGroup in Schnittstelle GroupController
      Parameter:
      restGroup - a Json representation of the new user group
      Gibt zurück:
      HTTP status "CREATED" and a response containing a Json object corresponding to the group after persistence (with ACL security identity ID) or HTTP status "BAD_REQUEST", if any of the input data was invalid
    • getGroupById

      public org.springframework.http.ResponseEntity<RestGroup> getGroupById(Long id)
      Get a user group by ID
      Angegeben von:
      getGroupById in Schnittstelle GroupController
      Parameter:
      id - the group ID
      Gibt zurück:
      HTTP status "OK" and a Json object corresponding to the group found or HTTP status "BAD_REQUEST" and an error message, if no group ID was given, or HTTP status "NOT_FOUND" and an error message, if no group with the given ID exists
    • deleteGroupById

      public org.springframework.http.ResponseEntity<?> deleteGroupById(Long id)
      Delete a user group by ID
      Angegeben von:
      deleteGroupById in Schnittstelle GroupController
      Parameter:
      id - the group ID
      Gibt zurück:
      a response entity with HTTP status "NO_CONTENT", if the deletion was successful, or HTTP status "NOT_FOUND", if the group did not exist, or HTTP status "NOT_MODIFIED", if the deletion was unsuccessful
    • modifyGroup

      public org.springframework.http.ResponseEntity<RestGroup> modifyGroup(Long id, RestGroup restGroup)
      Update a user group by ID
      Angegeben von:
      modifyGroup in Schnittstelle GroupController
      Parameter:
      id - the ID of the group to update
      restGroup - a Json object containing the modified (and unmodified) attributes
      Gibt zurück:
      HTTP status "OK" and a response containing a Json object corresponding to the user after modification or HTTP status "NOT_MODIFIED" and a warning message, if the input date was the same as the database data, or HTTP status "NOT_FOUND" and an error message, if no user group with the given ID exists, or HTTP status "BAD_REQUEST" and an error message, if any of the input data was invalid, or HTTP status "CONFLICT" and an error message, if the user has been modified since retrieval by the client
    • getGroupMembers

      public org.springframework.http.ResponseEntity<List<RestUser>> getGroupMembers(Long id)
      Get all members of the given user group
      Angegeben von:
      getGroupMembers in Schnittstelle GroupController
      Parameter:
      id - the ID of the user group
      Gibt zurück:
      HTTP status "OK" and a list of Json objects representing users, which are members of the given group or HTTP status "NOT_FOUND" and an error message, if the group has no members
    • addGroupMember

      public org.springframework.http.ResponseEntity<List<RestUser>> addGroupMember(Long id, String username)
      Add a member to the given user group
      Angegeben von:
      addGroupMember in Schnittstelle GroupController
      Parameter:
      id - the ID of the group to update
      username - the name of the user to add
      Gibt zurück:
      HTTP status "OK" and a response containing a Json object corresponding to the list of users after addition or HTTP status "NOT_MODIFIED" and a warning message, if the user is already a member of the group, or HTTP status "NOT_FOUND" and an error message, if no user group with the given ID or no user with the given name exists, or HTTP status "BAD_REQUEST" and an error message, if any of the input data was invalid
    • removeGroupMember

      public org.springframework.http.ResponseEntity<List<RestUser>> removeGroupMember(Long id, String username)
      Delete a member from the given user group
      Angegeben von:
      removeGroupMember in Schnittstelle GroupController
      Parameter:
      id - the group ID
      username - the name of the user to remove
      Gibt zurück:
      HTTP status "OK" and a response containing a Json object corresponding to the list of users after removal or HTTP status "NOT_MODIFIED" and a warning message, if the user is not a member of the group, or HTTP status "NOT_FOUND", if the group did not exist, or HTTP status "NOT_MODIFIED", if the deletion was unsuccessful
    • countGroups

      public org.springframework.http.ResponseEntity<String> countGroups(String missionCode)
      Count the groups matching the specified mission.
      Angegeben von:
      countGroups in Schnittstelle GroupController
      Parameter:
      missionCode - the mission code
      Gibt zurück:
      the number of matching groups as a String (may be zero) or HTTP status "BAD_REQUEST" if the request was not made by the root user or no mission was provided