com.filenet.wcm.toolkit.server.util
Class WcmSignInProcessor

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.WcmSignInProcessor

public class WcmSignInProcessor
extends java.lang.Object

An instance of this object will deliver credentials to the target session specified in the constructor, using the credentials servlet if necessary, provided that the target session information is current and valid.


Field Summary
protected  WcmController controller
           
protected  boolean disableInternalToken
           
protected  java.lang.String encodedSessionId
           
protected  java.lang.String errorMessage
           
protected  java.lang.Exception lastException
           
protected  java.lang.Boolean localSession
          localSession is no longer used.
protected  int maxErrorLength
           
protected  boolean noSession
           
protected  java.lang.String originIP
           
protected  java.lang.String originPort
           
protected  java.lang.String originScheme
           
protected  java.lang.String originSessionId
           
protected  WcmException sessionInvalidException
           
protected  java.lang.String targetBase
           
protected  java.lang.String targetUrl
           
protected  java.lang.String userId
           
 
Constructor Summary
WcmSignInProcessor(WcmController c, java.lang.String originIPValue, java.lang.String originPortValue, java.lang.String originSessionIdValue, java.lang.String originSchemeValue, java.lang.String encodedSessionIdValue)
           
WcmSignInProcessor(WcmController c, java.lang.String originIPValue, java.lang.String originPortValue, java.lang.String originSessionIdValue, java.lang.String targetBaseValue, java.lang.String targetUrlValue, java.lang.String encodedSessionIdValue)
           
 
Method Summary
 void clearStatus()
          Clears out the last userId and errorMessage values.
protected  void configure(WcmController c, java.lang.String originIP, java.lang.String originPort, java.lang.String originSessionId, java.lang.String originScheme, java.lang.String encodedSessionId)
          Configure the sign in processor with the information required to set credentials in the target session.
 boolean doSignInWork(java.lang.String userId, java.lang.String password, WcmRequestMap extraParameters, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Sets the credentials in the target session whether it is remote or local.
 java.lang.String getErrorMessage()
          Get the current sign in error message, if it exists.
 java.lang.Exception getException()
          Get the last sign in exception, if it exists.
 java.lang.String getLocalSessionId(javax.servlet.http.HttpServletRequest request)
          Gets the current local session ID for the specified request.
 int getMaxErrorLength()
          Gets the maxErrorLength property value.
 boolean getNoSession()
          Return true if the last sign in attempt could not find the target session.
 java.lang.String getTargetBase()
          Get the target base URL path.
 java.lang.String getTargetUrl()
          Get the target URL page.
 java.lang.String getUserID()
          Get the current sign in user ID.
 boolean isServerLocal()
          Discern whether or not the current local session is also the target session.
 boolean isSessionLocal(javax.servlet.http.HttpServletRequest request)
          Discern whether or not the current local session is also the target session.
 void setDisableInternalToken(boolean value)
          Disable sign-in attempt via internal user token even if internal tokens are configured enabled.
 int setMaxErrorLength(int newValue)
          Set the max error length to a value other than the initial default.
 java.lang.String signIn(javax.servlet.http.HttpServletRequest request, java.lang.String userId, java.lang.String password, WcmRequestMap extraParameters)
          Sets the credentials in the target session whether it is remote or local.
 java.lang.String signInLocal(java.lang.String user, java.lang.String password, WcmRequestMap extraParameters)
          Sets the credentials in the local target session.
protected  java.lang.String signInRemote(java.lang.String userId, java.lang.String password, WcmRequestMap extraParameters)
          Sets the credentials in the remote target session.
protected  java.lang.String signInViaToken(java.lang.String userId, java.lang.String password, WcmRequestMap extraParameters)
          Sets the credentials in the remote target session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controller

protected WcmController controller

originSessionId

protected java.lang.String originSessionId

encodedSessionId

protected java.lang.String encodedSessionId

originScheme

protected java.lang.String originScheme

originIP

protected java.lang.String originIP

originPort

protected java.lang.String originPort

userId

protected java.lang.String userId

errorMessage

protected java.lang.String errorMessage

lastException

protected java.lang.Exception lastException

noSession

protected boolean noSession

targetUrl

protected java.lang.String targetUrl

targetBase

protected java.lang.String targetBase

disableInternalToken

protected boolean disableInternalToken

localSession

protected java.lang.Boolean localSession
localSession is no longer used.


sessionInvalidException

protected WcmException sessionInvalidException

maxErrorLength

protected int maxErrorLength
Constructor Detail

WcmSignInProcessor

public WcmSignInProcessor(WcmController c,
                          java.lang.String originIPValue,
                          java.lang.String originPortValue,
                          java.lang.String originSessionIdValue,
                          java.lang.String targetBaseValue,
                          java.lang.String targetUrlValue,
                          java.lang.String encodedSessionIdValue)

WcmSignInProcessor

public WcmSignInProcessor(WcmController c,
                          java.lang.String originIPValue,
                          java.lang.String originPortValue,
                          java.lang.String originSessionIdValue,
                          java.lang.String originSchemeValue,
                          java.lang.String encodedSessionIdValue)
Method Detail

configure

protected void configure(WcmController c,
                         java.lang.String originIP,
                         java.lang.String originPort,
                         java.lang.String originSessionId,
                         java.lang.String originScheme,
                         java.lang.String encodedSessionId)
Configure the sign in processor with the information required to set credentials in the target session. All constructors call this method.

Parameters:
c - - The controller object from the calling module.
originIP - - The origin IP for where the target session is located.
originPort - - The origin port for where the target session is located.
originSessionId - - The origin session ID for where the target session is located.
originScheme - - The origin scheme for where the target session is located. Typically "http".
encodedSessionId - - (optional) The URL encoded session as returned from response.encodeURL("")

setDisableInternalToken

public void setDisableInternalToken(boolean value)
Disable sign-in attempt via internal user token even if internal tokens are configured enabled.


getMaxErrorLength

public int getMaxErrorLength()
Gets the maxErrorLength property value. By default, this is set to the calculated length required to show the server.WcmSignInModule.noSession WcmException localized string. Minimum default value is 32. This default is set during construction.

Returns:
maxErrorLength

setMaxErrorLength

public int setMaxErrorLength(int newValue)
Set the max error length to a value other than the initial default.

Returns:
the previous maxErrorLength value.

getUserID

public java.lang.String getUserID()
Get the current sign in user ID.

Returns:
userId. If undefined, an empty string is returned.

getErrorMessage

public java.lang.String getErrorMessage()
Get the current sign in error message, if it exists.

Returns:
errorMessage or null if undefined.

getException

public java.lang.Exception getException()
Get the last sign in exception, if it exists.

Returns:
The exception, or null if undefined.

getNoSession

public boolean getNoSession()
Return true if the last sign in attempt could not find the target session.

Returns:
The exception, or null if undefined.

getTargetBase

public java.lang.String getTargetBase()
Get the target base URL path.

Returns:
targetBase

getTargetUrl

public java.lang.String getTargetUrl()
Get the target URL page.

Returns:
targetUrl

clearStatus

public void clearStatus()
Clears out the last userId and errorMessage values.


getLocalSessionId

public java.lang.String getLocalSessionId(javax.servlet.http.HttpServletRequest request)
Gets the current local session ID for the specified request.

Parameters:
request - - The current HttpServletRequest object.
Returns:
The session ID.

doSignInWork

public boolean doSignInWork(java.lang.String userId,
                            java.lang.String password,
                            WcmRequestMap extraParameters,
                            javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws java.lang.Exception
Sets the credentials in the target session whether it is remote or local. Catches exceptions, and sets the userId, errorMessage and lastException properties when an exception is thrown during the sign in process.

Parameters:
userId - - The user ID to sign in as.
password - - The password to use to sign in.
extraParameters - - Any additional parameters to send to the sign in policy object.
request - - The current HttpServletRequest object.
response - - The current HttpServletResponse object.
Returns:
true if the sign in was successful.
Throws:
java.lang.Exception

isSessionLocal

public boolean isSessionLocal(javax.servlet.http.HttpServletRequest request)
                       throws java.lang.Exception
Discern whether or not the current local session is also the target session. If true, the credentials can be set directly rather than going through the credentials servlet.

Returns:
true if the session is local.
Throws:
java.lang.Exception

isServerLocal

public boolean isServerLocal()
                      throws java.lang.Exception
Discern whether or not the current local session is also the target session. If true, the credentials can be set directly rather than going through the credentials servlet.

Returns:
true if the session is local.
Throws:
java.lang.Exception

signIn

public java.lang.String signIn(javax.servlet.http.HttpServletRequest request,
                               java.lang.String userId,
                               java.lang.String password,
                               WcmRequestMap extraParameters)
                        throws java.lang.Exception
Sets the credentials in the target session whether it is remote or local. Throws an exception if sign-in was not successful.

Parameters:
request - - The current HttpServletRequest object.
userId - - The user ID to sign in as.
password - - The password to use to sign in.
extraParameters - - Any additional parameters to send to the sign in policy object.
Returns:
The URL to redirect to, if sign in was successful. Otherwise null.
Throws:
java.lang.Exception

signInRemote

protected java.lang.String signInRemote(java.lang.String userId,
                                        java.lang.String password,
                                        WcmRequestMap extraParameters)
                                 throws java.lang.Exception
Sets the credentials in the remote target session. Throws an exception if sign-in was not successful.

Parameters:
userId - - The user ID to sign in as.
password - - The password to use to sign in.
extraParameters - - Any additional parameters to send to the sign in policy object.
Returns:
The URL to redirect to, if sign in was successful. Otherwise null.
Throws:
java.lang.Exception

signInViaToken

protected java.lang.String signInViaToken(java.lang.String userId,
                                          java.lang.String password,
                                          WcmRequestMap extraParameters)
                                   throws java.lang.Exception
Sets the credentials in the remote target session. Throws an exception if sign-in was not successful.

Parameters:
userId - - The user ID to sign in as.
password - - The password to use to sign in.
extraParameters - - Any additional parameters to send to the sign in policy object.
Returns:
The URL to redirect to, if sign in was successful. Otherwise null.
Throws:
java.lang.Exception

signInLocal

public java.lang.String signInLocal(java.lang.String user,
                                    java.lang.String password,
                                    WcmRequestMap extraParameters)
                             throws java.lang.Exception
Sets the credentials in the local target session. Throws an exception if sign-in was not successful.

Parameters:
user - - The user ID to sign in as.
password - - The password to use to sign in.
extraParameters - - Any additional parameters to send to the sign in policy object.
Returns:
The URL to redirect to, if sign in was successful. Otherwise null.
Throws:
java.lang.Exception


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.