de.hs_rm.cs.lecturenotes.server.core.transport.service
Class UserCommServiceImpl

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
              extended by com.google.gwt.user.server.rpc.RemoteServiceServlet
                  extended by de.hs_rm.cs.lecturenotes.server.core.transport.service.UserCommServiceImpl
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, UserCommService, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public final class UserCommServiceImpl
extends com.google.gwt.user.server.rpc.RemoteServiceServlet
implements UserCommService

GWT RPC Service Servlet for everything relevant to user handling.

Version:
$LastChangedRevision: 296 $
Author:
Enrico Homann
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.hs_rm.cs.lecturenotes.client.core.transport.service.UserCommService
UserCommService.Util
 
Constructor Summary
UserCommServiceImpl()
           
 
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.
 
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
getSerializationPolicy, processCall, processPost
 
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserCommServiceImpl

public UserCommServiceImpl()
Method Detail

login

public User login(java.lang.String loginName,
                  java.lang.String loginPassword)
Description copied from interface: UserCommService
Tries to login the callee with String loginName and String loginPassword. Where loginPassword is the clear text password.

Specified by:
login in interface UserCommService
Parameters:
loginName - String
loginPassword - String
Returns:
User object

logout

public ResponseStatusEnum logout()
Description copied from interface: UserCommService
Tries to logout the caller. Invalidates the session.

Specified by:
logout in interface UserCommService
Returns:
ResponseStatusEnum where SUCCESS stands for a successful operation, and FAILURE stands for a failure while processing

isSessionLoggedIn

public java.lang.Boolean isSessionLoggedIn()
Description copied from interface: UserCommService
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.

Specified by:
isSessionLoggedIn in interface UserCommService
Returns:
Boolean

getUserList

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

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

updateUser

public ResponseStatusEnum updateUser(User user,
                                     java.lang.String newPassword)
                              throws InvalidPermissionException
Description copied from interface: UserCommService
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.

Specified by:
updateUser in interface UserCommService
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

public ResponseStatusEnum hardDeleteUser(User user)
                                  throws InvalidPermissionException
Description copied from interface: UserCommService
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.

Specified by:
hardDeleteUser in interface UserCommService
Parameters:
user - User
Returns:
ResponseStatusEnum
Throws:
InvalidPermissionException - Thrown if the caller holds not the correct permissions.

registerNewUser

public ResponseStatusEnum registerNewUser(User user,
                                          java.lang.String password,
                                          java.lang.String authorizedClientSecret)
                                   throws InvalidPermissionException
Description copied from interface: UserCommService
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.

Specified by:
registerNewUser in interface UserCommService
Parameters:
user - User
password - String clear text password
authorizedClientSecret - String
Returns:
ResponseStatusEnum
Throws:
InvalidPermissionException - Thrown if the caller holds not the correct permissions.