de.hs_rm.cs.lecturenotes.client.core.transport.service
Interface UserCommService

All Superinterfaces:
com.google.gwt.user.client.rpc.RemoteService
All Known Implementing Classes:
UserCommServiceImpl

@RemoteServiceRelativePath(value="UserCommService")
public interface UserCommService
extends com.google.gwt.user.client.rpc.RemoteService

Comm Service Interface for everything related to User Management.

Version:
$LastChangedRevision: 260 $
Author:
Enrico Homann

Nested Class Summary
static class UserCommService.Util
          Utility class for simplifying access to the instance of async service.
 
Method Summary
 java.util.List<User> getUserList()
          Will return a list of all User objects in the system.
 ResponseStatusEnum hardDeleteUser(User user)
          A hard delete means the complete deletion of a user, his creations and dependencies from the database.
 java.lang.Boolean isSessionLoggedIn()
          Tests whether the current session holds a valid User object.
 User login(java.lang.String loginName, java.lang.String loginPassword)
          Tries to login the callee with String loginName and String loginPassword.
 ResponseStatusEnum logout()
          Tries to logout the caller.
 ResponseStatusEnum registerNewUser(User user, java.lang.String password, java.lang.String authorizedClientSecret)
          Registers a new User user.
 ResponseStatusEnum updateUser(User user, java.lang.String newPassword)
          Updates the User user object.
 

Method Detail

login

User login(java.lang.String loginName,
           java.lang.String loginPassword)
Tries to login the callee with String loginName and String loginPassword. Where loginPassword is the clear text password.

Parameters:
loginName - String
loginPassword - String
Returns:
User object

logout

ResponseStatusEnum logout()
Tries to logout the caller. Invalidates the session.

Returns:
ResponseStatusEnum where SUCCESS stands for a successful operation, and FAILURE stands for a failure while processing

isSessionLoggedIn

java.lang.Boolean isSessionLoggedIn()
Tests whether the current session holds a valid User object. Returns true if there is a user logged in for the session, returns false otherwise.

Returns:
Boolean

getUserList

java.util.List<User> getUserList()
                                 throws InvalidPermissionException
Will return a list of all User objects in the system. Caller must be in role of the Administrator to actually get the list.

Returns:
List of User objects.
Throws:
InvalidPermissionException - Will be thrown in case when a callee has no sufficient permissions

updateUser

ResponseStatusEnum updateUser(User user,
                              java.lang.String newPassword)
                              throws InvalidPermissionException
Updates the User user object. You may set String newPassword as clear new password, otherwise set null to not change the password. Returns SUCCESS if the operation was successful, or returns FAILURE if the operation failed.

Parameters:
user - User
newPassword - String or null if no new password shall be set
Returns:
ResponseStatusEnum
Throws:
InvalidPermissionException - Thrown if caller has not the correct permissions

hardDeleteUser

ResponseStatusEnum hardDeleteUser(User user)
                                  throws InvalidPermissionException
A hard delete means the complete deletion of a user, his creations and dependencies from the database. This can't be undone. Will return SUCCESS if the operation was successful or FAILURE if there occurred an error.

Parameters:
user - User
Returns:
ResponseStatusEnum
Throws:
InvalidPermissionException - Thrown if the caller holds not the correct permissions.

registerNewUser

ResponseStatusEnum registerNewUser(User user,
                                   java.lang.String password,
                                   java.lang.String authorizedClientSecret)
                                   throws InvalidPermissionException
Registers a new User user. Will return SUCCESS if the operation was succesful, or FAILURE otherwise. The client needs to send the secret for authorized clients.

Parameters:
user - User
password - String clear text password
authorizedClientSecret - String
Returns:
ResponseStatusEnum
Throws:
InvalidPermissionException - Thrown if the caller holds not the correct permissions.