Package de.dlr.proseo.usermgr.rest
Klasse UserControllerImpl
java.lang.Object
de.dlr.proseo.usermgr.rest.UserControllerImpl
- Alle implementierten Schnittstellen:
UserController
Spring MVC controller for the prosEO User Manager; implements the services
required to manage user accounts.
- Autor:
- Dr. Thomas Bassler
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungorg.springframework.http.ResponseEntity
<String> countUsers
(String missionCode) Count the users matching the specified mission.org.springframework.http.ResponseEntity
<RestUser> createUser
(@Valid RestUser restUser) Create a new userorg.springframework.http.ResponseEntity
<?> deleteUserByName
(String username) Delete a user by user nameorg.springframework.http.ResponseEntity
<RestUser> getUserByName
(String username) Get a user by nameGet users by mission (may be null, if root user sends request)org.springframework.http.ResponseEntity
<RestUser> modifyUser
(String username, RestUser restUser) Update a user by name
-
Konstruktordetails
-
UserControllerImpl
public UserControllerImpl()
-
-
Methodendetails
-
getUsers
public org.springframework.http.ResponseEntity<List<RestUser>> getUsers(String mission, Integer recordFrom, Integer recordTo) Get users by mission (may be null, if root user sends request)- Angegeben von:
getUsers
in SchnittstelleUserController
- Parameter:
mission
- the mission coderecordFrom
- 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 users authorized for the given mission or HTTP status "NOT_FOUND" and an error message, if no users matching the search criteria were found HTTP status "TOO MANY REQUESTS" if the result list exceeds a configured maximum
-
createUser
public org.springframework.http.ResponseEntity<RestUser> createUser(@Valid @Valid RestUser restUser) Create a new user- Angegeben von:
createUser
in SchnittstelleUserController
- Parameter:
restUser
- a Json representation of the new user- Gibt zurück:
- HTTP status "CREATED" and a response containing a Json object corresponding to the user after persistence (with ACL security identity ID) or HTTP status "BAD_REQUEST", if any of the input data was invalid
-
getUserByName
Get a user by name- Angegeben von:
getUserByName
in SchnittstelleUserController
- Parameter:
username
- the user name- Gibt zurück:
- HTTP status "OK" and a Json object corresponding to the user found or HTTP status "BAD_REQUEST" and an error message, if no user name was given, or HTTP status "UNAUTHORIZED" and an error message, if a user (not user mgr) attempted to access the data of another user, or HTTP status "NOT_FOUND" and an error message, if no user with the given name exists
-
deleteUserByName
Delete a user by user name- Angegeben von:
deleteUserByName
in SchnittstelleUserController
- Parameter:
username
- the name of the user to delete- Gibt zurück:
- a response entity with HTTP status "NO_CONTENT", if the deletion was successful, or HTTP status "NOT_FOUND", if the user did not exist, or HTTP status "NOT_MODIFIED", if the deletion was unsuccessful
-
modifyUser
public org.springframework.http.ResponseEntity<RestUser> modifyUser(String username, RestUser restUser) Update a user by name- Angegeben von:
modifyUser
in SchnittstelleUserController
- Parameter:
username
- the name of the user to updaterestUser
- 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 with the given name exists, or HTTP status "BAD_REQUEST" and an error message, if any of the input data was invalid, or HTTP status "UNAUTHORIZED" and an error message, if a user (not user mgr) attempted to change anything but their own password, or HTTP status "CONFLICT"and an error message, if the user has been modified since retrieval by the client
-
countUsers
Count the users matching the specified mission.- Angegeben von:
countUsers
in SchnittstelleUserController
- Parameter:
missionCode
- the mission- Gibt zurück:
- the number of matching users 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
-