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


public interface UserCommServiceAsync

Asynchronous Comm Service Interface for everything related to User Management.

Version:
$LastChangedRevision: 260 $
Author:
Enrico Homann

Method Summary
 void getUserList(com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<User>> callback)
          Will return a list of all User objects in the system.
 void hardDeleteUser(User user, com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> callback)
          A hard delete means the complete deletion of a user, his creations and dependencies from the database.
 void isSessionLoggedIn(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> callback)
          Tests whether the current session holds a valid User object.
 void login(java.lang.String loginName, java.lang.String loginPassword, com.google.gwt.user.client.rpc.AsyncCallback<User> callback)
          Tries to login the callee with String loginName and String loginPassword.
 void logout(com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> callback)
          Tries to logout the caller.
 void registerNewUser(User user, java.lang.String password, java.lang.String authorizedClientSecret, com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> callback)
          Registers a new User user.
 void updateUser(User user, java.lang.String newPassword, com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> callback)
          Updates the User user object.
 

Method Detail

login

void login(java.lang.String loginName,
           java.lang.String loginPassword,
           com.google.gwt.user.client.rpc.AsyncCallback<User> callback)
Tries to login the callee with String loginName and String loginPassword. Where loginPassword is the clear text password.

Parameters:
loginName - String
loginPassword - String
callback - AsyncCallback of User

logout

void logout(com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> callback)
Tries to logout the caller. Invalidates the session.

Parameters:
callback - AsyncCallback of ResponseStatusEnum

isSessionLoggedIn

void isSessionLoggedIn(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> callback)
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.

Parameters:
callback - AsyncCallback of Boolean

getUserList

void getUserList(com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<User>> callback)
Will return a list of all User objects in the system. Caller must be in role of the Administrator to actually get the list.

Parameters:
callback - AsyncCallback of List of User

updateUser

void updateUser(User user,
                java.lang.String newPassword,
                com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> callback)
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
callback - AsyncCallback of ResponseStatusEnum.

hardDeleteUser

void hardDeleteUser(User user,
                    com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> callback)
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
callback - AsyncCallback with ResponseStatusEnum

registerNewUser

void registerNewUser(User user,
                     java.lang.String password,
                     java.lang.String authorizedClientSecret,
                     com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> callback)
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
callback - AsyncCallback with ResponseStatusEnum