com.filenet.wcm.toolkit.server.base
Class WcmSignInPolicy

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.base.WcmSignInPolicy
All Implemented Interfaces:
WcmSignInPolicyInterface

public class WcmSignInPolicy
extends java.lang.Object
implements WcmSignInPolicyInterface

This is the basic toolkit sign in policy.


Field Summary
protected  WcmBootstrapPrefs bootstrap
           
protected  java.lang.String bootstrapPage
           
protected  boolean bootstrapRequired
           
protected  WcmController controller
           
protected  WcmDataStore dataStore
           
protected static java.lang.String FIRST_PAGE_KEY
           
protected  java.lang.Boolean isTokenEnabled
           
static java.lang.String USER_TOKEN_APPID
           
 
Constructor Summary
protected WcmSignInPolicy()
           
  WcmSignInPolicy(WcmController c, java.lang.String sslProtocolValue, java.lang.String sslHostValue, java.lang.String guestUserValue, java.util.Vector routerInfoValues, java.lang.String bootstrapPageValue)
          The constructor.
 
Method Summary
protected  void configureServerCredentials(WcmServerCredentials sc)
          Deprecated. Use configureServerCredentials(WcmServerCredentials sc, WcmRequestMap extraParameters)
protected  void configureServerCredentials(WcmServerCredentials sc, WcmRequestMap extraParameters)
          Configures the newly created WcmServerCredentials object with workflow router info, and guest user information.
protected  WcmServerCredentials createServerCredentials(WcmDataStore ds, java.lang.String appId, java.lang.String user, java.lang.String password)
          Deprecated. Use createServerCredentials(dataStore, appId, user, password, verify)
protected  WcmServerCredentials createServerCredentials(WcmDataStore ds, java.lang.String appId, java.lang.String user, java.lang.String password, boolean verify)
          Create a new WcmServerCredentials object based on the specified parameters.
protected  WcmServerCredentials createServerCredentials(WcmDataStore ds, java.lang.String appId, java.lang.String user, java.lang.String password, java.lang.String domain)
          Deprecated. Use createServerCredentials(dataStore, appId, user, password, verify)
 boolean doSignIn(javax.servlet.http.HttpServletResponse response, java.lang.String requestedPage)
          Do SignIn action.
protected  java.lang.String encodeTokenException(java.lang.String url)
           
 WcmDataStore getDataStore()
          Convenience method to get the WcmDataStore instance.
protected  java.lang.String getDestinationPage()
          On successful sign in, determine the page that the user should be routed to.
protected  java.lang.String getEncodedSessionId()
          Deprecated. - Use WcmController.getEncodedSessionId()
protected  java.lang.String getHttpsUrl(java.lang.String baseUrl, java.lang.String sslHost, java.lang.String urlRoot, java.lang.String signInPage, java.lang.String targetUrl, java.lang.String sessionId, java.lang.String localIP, java.lang.String localPort)
          Construct the secure signin URL request that will be used to redirect to the secure signin page.
protected  java.lang.String getHttpUrl(java.lang.String baseUrl, java.lang.String signInPage, java.lang.String targetUrl, java.lang.String sessionId, java.lang.String localIP, java.lang.String localPort)
          Construct the non-secure signin URL request that will be used to redirect to the signin page.
 java.lang.String getLocalIP()
          Returns the local IP value for this machine.
 java.lang.String getLocalPort()
          Returns the local port value for this machine.
 java.lang.String getLoginRoutingInfo()
          Deprecated. - Use WcmController.getLoginRoutingInfo()
protected  java.lang.String getSignInURL(java.lang.String requestedPage)
           
 boolean isSignedIn()
          Detects whether or not the user is signed in.
 java.lang.String setCredentials(java.lang.String user, java.lang.String password, WcmRequestMap extraParameters)
          Set the credentials.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_TOKEN_APPID

public static final java.lang.String USER_TOKEN_APPID
See Also:
Constant Field Values

FIRST_PAGE_KEY

protected static final java.lang.String FIRST_PAGE_KEY
See Also:
Constant Field Values

controller

protected WcmController controller

dataStore

protected WcmDataStore dataStore

bootstrapPage

protected java.lang.String bootstrapPage

bootstrapRequired

protected boolean bootstrapRequired

isTokenEnabled

protected java.lang.Boolean isTokenEnabled

bootstrap

protected WcmBootstrapPrefs bootstrap
Constructor Detail

WcmSignInPolicy

protected WcmSignInPolicy()

WcmSignInPolicy

public WcmSignInPolicy(WcmController c,
                       java.lang.String sslProtocolValue,
                       java.lang.String sslHostValue,
                       java.lang.String guestUserValue,
                       java.util.Vector routerInfoValues,
                       java.lang.String bootstrapPageValue)
                throws java.lang.Exception
The constructor. It contains several configuration parameters described below.

Parameters:
c - - The instance of WcmController instaniating this object.
sslProtocolValue - - The ssl protocol string (i.e. https).
sslHostValue - - The ssl host value. Specify null if you're not doing secure sign-in. Otherwise specify a "host:port".
guestUserValue - - The guest user name or null if no guest is specified.
routerInfoValues - - A vector containing any workflow router host:port values that should be tried for connecting to workflow.
bootstrapPageValue - - Optional. If your application requires bootstrap setup, specify the Java™Server Pages (JSP) page here. Otherwise, specify null.
Throws:
java.lang.Exception
Method Detail

getLocalIP

public java.lang.String getLocalIP()
Returns the local IP value for this machine.

Returns:
The local IP.

getLocalPort

public java.lang.String getLocalPort()
Returns the local port value for this machine.

Returns:
The local port.

getDataStore

public WcmDataStore getDataStore()
Convenience method to get the WcmDataStore instance.

Returns:
The data store.

isSignedIn

public boolean isSignedIn()
                   throws java.lang.Exception
Detects whether or not the user is signed in.

Specified by:
isSignedIn in interface WcmSignInPolicyInterface
Returns:
true if the session is authenticated, otherwise false.
Throws:
java.lang.Exception

getEncodedSessionId

protected java.lang.String getEncodedSessionId()
Deprecated. - Use WcmController.getEncodedSessionId()


getHttpUrl

protected java.lang.String getHttpUrl(java.lang.String baseUrl,
                                      java.lang.String signInPage,
                                      java.lang.String targetUrl,
                                      java.lang.String sessionId,
                                      java.lang.String localIP,
                                      java.lang.String localPort)
                               throws java.lang.Exception
Construct the non-secure signin URL request that will be used to redirect to the signin page. Overrideable.

Parameters:
baseUrl - - The base URL.
signInPage - - The signin page retrieved from the controller.
targetUrl - - The target URL to go to after signin.
sessionId - - The current JSP session identifier.
localIP - - The local IP of this machine.
localPort - - The local port of this machine.
Returns:
The signin URL request.
Throws:
java.lang.Exception

getHttpsUrl

protected java.lang.String getHttpsUrl(java.lang.String baseUrl,
                                       java.lang.String sslHost,
                                       java.lang.String urlRoot,
                                       java.lang.String signInPage,
                                       java.lang.String targetUrl,
                                       java.lang.String sessionId,
                                       java.lang.String localIP,
                                       java.lang.String localPort)
                                throws java.lang.Exception
Construct the secure signin URL request that will be used to redirect to the secure signin page. Overrideable.

Parameters:
baseUrl - - The base URL.
sslHost - - The SSL hostname.
urlRoot - - The URL root retrieved from the data store.
signInPage - - The signin page retrieved from the controller.
targetUrl - - The target URL to go to after signin.
sessionId - - The current JSP session identifier.
localIP - - The local IP of this machine.
localPort - - The local port of this machine.
Returns:
The secure signin URL request.
Throws:
java.lang.Exception

doSignIn

public boolean doSignIn(javax.servlet.http.HttpServletResponse response,
                        java.lang.String requestedPage)
                 throws java.lang.Exception
Do SignIn action. Redirects to the sign in page when credentials are needed.

Specified by:
doSignIn in interface WcmSignInPolicyInterface
Parameters:
response - - The current HttpServletResponse object.
requestedPage - - The page name that the user was attempting to use. Pathing should be relative to the application root.
Returns:
boolean value of whether or not there was a redirect.
Throws:
java.lang.Exception

getSignInURL

protected java.lang.String getSignInURL(java.lang.String requestedPage)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

encodeTokenException

protected java.lang.String encodeTokenException(java.lang.String url)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

configureServerCredentials

protected void configureServerCredentials(WcmServerCredentials sc)
                                   throws java.lang.Exception
Deprecated. Use configureServerCredentials(WcmServerCredentials sc, WcmRequestMap extraParameters)

Throws:
java.lang.Exception

configureServerCredentials

protected void configureServerCredentials(WcmServerCredentials sc,
                                          WcmRequestMap extraParameters)
                                   throws java.lang.Exception
Configures the newly created WcmServerCredentials object with workflow router info, and guest user information.

Parameters:
sc - - The new server credentials object.
extraParameters - - Extra parameters that were supplied with the user/password information (optional).
Throws:
java.lang.Exception

createServerCredentials

protected WcmServerCredentials createServerCredentials(WcmDataStore ds,
                                                       java.lang.String appId,
                                                       java.lang.String user,
                                                       java.lang.String password,
                                                       java.lang.String domain)
                                                throws java.lang.Exception
Deprecated. Use createServerCredentials(dataStore, appId, user, password, verify)

Throws:
java.lang.Exception

createServerCredentials

protected WcmServerCredentials createServerCredentials(WcmDataStore ds,
                                                       java.lang.String appId,
                                                       java.lang.String user,
                                                       java.lang.String password)
                                                throws java.lang.Exception
Deprecated. Use createServerCredentials(dataStore, appId, user, password, verify)

Throws:
java.lang.Exception

createServerCredentials

protected WcmServerCredentials createServerCredentials(WcmDataStore ds,
                                                       java.lang.String appId,
                                                       java.lang.String user,
                                                       java.lang.String password,
                                                       boolean verify)
                                                throws java.lang.Exception
Create a new WcmServerCredentials object based on the specified parameters.

Parameters:
ds -
appId -
user -
password -
Returns:
Throws:
java.lang.Exception

setCredentials

public java.lang.String setCredentials(java.lang.String user,
                                       java.lang.String password,
                                       WcmRequestMap extraParameters)
                                throws java.lang.Exception
Set the credentials. After this call completes, isSignedIn should return true.

Specified by:
setCredentials in interface WcmSignInPolicyInterface
Parameters:
user - - The user name.
password - - The user's password.
extraParameters - - Any additional parameters such as appId or domain, or others.
Returns:
String value of the page to redirect to, if successful.
Throws:
java.lang.Exception

getLoginRoutingInfo

public java.lang.String getLoginRoutingInfo()
                                     throws java.lang.Exception
Deprecated. - Use WcmController.getLoginRoutingInfo()

Specified by:
getLoginRoutingInfo in interface WcmSignInPolicyInterface
Throws:
java.lang.Exception

getDestinationPage

protected java.lang.String getDestinationPage()
                                       throws java.lang.Exception
On successful sign in, determine the page that the user should be routed to. First, the requested page is evaluated. If it is not valid, the user is either directed to the bootstrap URL if bootstrap is required, or to the value returned from getConfiguredHome().

Returns:
The page to redirect to.
Throws:
java.lang.Exception


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