Package de.dlr.proseo.usermgr.rest
Klasse GroupControllerImpl
java.lang.Object
de.dlr.proseo.usermgr.rest.GroupControllerImpl
- Alle implementierten Schnittstellen:
GroupController
Spring MVC controller for the prosEO User Manager; implements the services
required to manage user groups.
- Autor:
- Dr. Thomas Bassler
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungaddGroupMember
(Long id, String username) Add a member to the given user grouporg.springframework.http.ResponseEntity
<String> countGroups
(String missionCode) Count the groups matching the specified mission.org.springframework.http.ResponseEntity
<RestGroup> createGroup
(@Valid RestGroup restGroup) Create a new user grouporg.springframework.http.ResponseEntity
<?> deleteGroupById
(Long id) Delete a user group by IDorg.springframework.http.ResponseEntity
<RestGroup> getGroupById
(Long id) Get a user group by IDgetGroupMembers
(Long id) Get all members of the given user groupGet user groups by mission and optionally by group nameorg.springframework.http.ResponseEntity
<RestGroup> modifyGroup
(Long id, RestGroup restGroup) Update a user group by IDremoveGroupMember
(Long id, String username) Delete a member from the given user group
-
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 SchnittstelleGroupController
- Parameter:
mission
- the mission code and optionally by group namegroupName
- the group name (optional)recordFrom
- first record of filtered and ordered result to returnrecordTo
- 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 SchnittstelleGroupController
- 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
Get a user group by ID- Angegeben von:
getGroupById
in SchnittstelleGroupController
- 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
Delete a user group by ID- Angegeben von:
deleteGroupById
in SchnittstelleGroupController
- 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
Update a user group by ID- Angegeben von:
modifyGroup
in SchnittstelleGroupController
- Parameter:
id
- the ID of the group to updaterestGroup
- 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
Get all members of the given user group- Angegeben von:
getGroupMembers
in SchnittstelleGroupController
- 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 SchnittstelleGroupController
- Parameter:
id
- the ID of the group to updateusername
- 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 SchnittstelleGroupController
- Parameter:
id
- the group IDusername
- 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
Count the groups matching the specified mission.- Angegeben von:
countGroups
in SchnittstelleGroupController
- 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
-