com.ibm.b2bi.im.ams
Class AMSBean

java.lang.Object
  |
  +--com.ibm.b2bi.im.ams.AMSBean

public class AMSBean
extends java.lang.Object
implements java.io.Serializable

This bean verifies the user authentication and gets the appropriate user credentials. The AMSBean acts as an interface between the Interaction Manager and Access Manager. This talks to the Access Manager to authenticate the current user and if successful holds the user's context and user credentials.

See Also:
Serialized Form

Field Summary
static java.lang.String copyrightNotice
           
 
Constructor Summary
AMSBean()
          Default constructor.
AMSBean(java.lang.String machine, java.lang.String amsID)
          Constructor.
 
Method Summary
 boolean authenticate(java.lang.String user)
           
 boolean authenticate(java.lang.String user, java.lang.String password)
          Bean Method to verify user authentication.
 void clientLogout(java.lang.String user)
          Logout the given user on the AMS server.
 UserCredentialsBean getCredentials()
          User credentials property.
 java.util.Hashtable getProcessDefinitions(java.lang.String solutionName)
           
 java.lang.String isAuthorized(javax.servlet.http.HttpServletRequest request)
          Verifies if the user is authorized to use the solution desktop or not.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyrightNotice

public static final java.lang.String copyrightNotice
Constructor Detail

AMSBean

public AMSBean()
Default constructor.

AMSBean

public AMSBean(java.lang.String machine,
               java.lang.String amsID)
        throws AMSClientException
Constructor. Use this constructor to properly create the bean.
Parameters:
machine - The name of the machine where the Access Manager server is running.
amsID - Name for the instance of the AMS server object.
Method Detail

authenticate

public boolean authenticate(java.lang.String user)
                     throws AMSClientException

authenticate

public boolean authenticate(java.lang.String user,
                            java.lang.String password)
                     throws AMSClientException
Bean Method to verify user authentication. Use this method to validate the user id and password. On successful validation, it defines the context and user credentials for the logged on user. You can use the getCredentials() properties to access these values. Exposed for backward compatibility.
Parameters:
user - The user ID.
password - The password of the user.
Returns:
If successful it returns true, false otherwise
Throws:
AMSClientException - if any other error occurs.

clientLogout

public void clientLogout(java.lang.String user)
Logout the given user on the AMS server.

getCredentials

public UserCredentialsBean getCredentials()
                                   throws AMSClientException
User credentials property. Returns the credentials of the currently logged in user.
Parameters:
None. -  
Returns:
The UserCredentialsBean object attached to this user.
Throws:
AMSClientException - Thrown if no user credentials are available.

getProcessDefinitions

public java.util.Hashtable getProcessDefinitions(java.lang.String solutionName)
                                          throws IMException

isAuthorized

public java.lang.String isAuthorized(javax.servlet.http.HttpServletRequest request)
                              throws AMSClientException
Verifies if the user is authorized to use the solution desktop or not. If authorized/authenticated, it will return the user name ortherwise null. From the HTTPServletRequest object, it identifies if LTPA cookie is defined for SSO environments. If not, it tries to get the User name from request object or the HTTP header.
Parameters:
request - HTTPServletRequest object.
Returns:
If successful it returns user id, null otherwise.
Throws:
AMSClientException - if any other error occurs.