com.lightdev.app.trec.server.sam
Class SAMAuthorizer

java.lang.Object
  extended by com.lightdev.app.trec.server.sam.SAMAuthorizer

public class SAMAuthorizer
extends Object

SAMAuthorizer exposes methods login, logout and changeOwnPassword of a given Gatekeeper object as remote methods so that an XmlRpcServer can use the Authorizer as a handler for respective client requests.

Version:
2, 25.12.2005
Author:
Ulrich Hilger, Light Development, http://www.lightdev.com, info@lightdev.com, published under the terms and conditions of the BSD License, for details see file license.txt in the distribution package of this software

Field Summary
static String DEFAULT_NAME
          default name this object is addressed as a TREC agent under
static String METHOD_CHG_PW
          name of change own password method
static String METHOD_LOGIN
          name of login method
static String METHOD_LOGOUT
          name of logout method
static String RID_CHANGE_OWN_PASSWORD
           
 
Constructor Summary
SAMAuthorizer(Gatekeeper gatekeeper)
          constructor
 
Method Summary
 boolean changeOwnPassword(String sid, String oldPw, String newPw)
          change the password of the user logged in via a given session
 String login(String userId, String pw)
          log in a given user with a given password
 boolean logout(String sessionId)
          log out the user with the given session id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAME

public static final String DEFAULT_NAME
default name this object is addressed as a TREC agent under

See Also:
Constant Field Values

METHOD_LOGIN

public static final String METHOD_LOGIN
name of login method

See Also:
Constant Field Values

METHOD_LOGOUT

public static final String METHOD_LOGOUT
name of logout method

See Also:
Constant Field Values

METHOD_CHG_PW

public static final String METHOD_CHG_PW
name of change own password method

See Also:
Constant Field Values

RID_CHANGE_OWN_PASSWORD

public static final String RID_CHANGE_OWN_PASSWORD
See Also:
Constant Field Values
Constructor Detail

SAMAuthorizer

public SAMAuthorizer(Gatekeeper gatekeeper)
constructor

Parameters:
gatekeeper - the gatekeeper to use for authentication
Method Detail

logout

public boolean logout(String sessionId)
log out the user with the given session id

Parameters:
sessionId - the session id string to log out

login

public String login(String userId,
                    String pw)
             throws Exception
log in a given user with a given password

Parameters:
userId - the user id
pw - the password
Returns:
a session id String or null if login failed
Throws:
Exception

changeOwnPassword

public boolean changeOwnPassword(String sid,
                                 String oldPw,
                                 String newPw)
                          throws Exception
change the password of the user logged in via a given session

Parameters:
sid - id of session the password is to be changed for
oldPw - current password of user
newPw - new password to set
Throws:
Exception - if something goes wrong, e.g. oldPW not matching, etc.