org.apache.beehive.netui.pageflow
Interface ServletContainerAdapter

All Superinterfaces:
Adapter
All Known Implementing Classes:
DefaultServletContainerAdapter

public interface ServletContainerAdapter
extends Adapter


Method Summary
 void beginRequest(HttpServletRequest request, HttpServletResponse response)
          Called at the beginning of each processed request.
 ControlBeanContext createControlBeanContext(HttpServletRequest request, HttpServletResponse response)
          Get a context object to support Java Controls.
 boolean doSecurityRedirect(String uri, HttpServletRequest request, HttpServletResponse response)
          Cause the server to do a security check for the given URI.
 void endRequest(HttpServletRequest request, HttpServletResponse response)
          Called at the end of each processed request.
 void ensureFailover(String attrName, Object attrVal, HttpServletRequest request)
          Ensure that the given session attribute is replicated in a cluster for session failover.
 PageFlowEventReporter getEventReporter()
          Get an event reporter, which will be notified of events like "page flow created", "action raised", etc.
 String getFullContextPath(HttpServletRequest request)
          Return the webapp context path for the given request.
 int getListenPort(HttpServletRequest request)
          Get the port on which the server is listening for unsecure connections.
 String getPlatformName()
          Get the name of the platform, which may be used to find platform-specific configuration files.
 int getSecureListenPort(HttpServletRequest request)
          Get the port on which the server is listening for secure connections.
 SecurityProtocol getSecurityProtocol(String uri, HttpServletRequest request)
          Tell whether a web application resource requires a secure transport protocol.
 boolean isInProductionMode()
          Tell whether the server is running in production mode.
 void login(String username, String password, HttpServletRequest request, HttpServletResponse response)
          Log in the user, using "weak" username/password authentication.
 void logout(boolean invalidateSessions, HttpServletRequest request, HttpServletResponse response)
          Log out the current user.
 
Methods inherited from interface Adapter
accept, setContext
 

Method Detail

isInProductionMode

boolean isInProductionMode()
Tell whether the server is running in production mode. This is server-dependent, but by default it should return false only if the System property pageflow:devmode is set.

Returns:
true if the server is running in production mode.

getSecurityProtocol

SecurityProtocol getSecurityProtocol(String uri,
                                     HttpServletRequest request)
Tell whether a web application resource requires a secure transport protocol. This is determined from web.xml; for example, the following block specifies that all resources under /login require a secure transport protocol.
    <security-constraint>
        <web-resource-collection>
          <web-resource-name>Secure PageFlow - begin</web-resource-name> 
          <url-pattern>/login/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
           <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
 

Parameters:
uri - a webapp-relative URI for a resource.
request - the current HttpServletRequest.
Returns:
Boolean.TRUE if a transport-guarantee of CONFIDENTIAL or INTEGRAL is associated with the given resource; Boolean.FALSE a transport-guarantee of NONE is associated with the given resource; or null if there is no transport-guarantee associated with the given resource.

doSecurityRedirect

boolean doSecurityRedirect(String uri,
                           HttpServletRequest request,
                           HttpServletResponse response)
Cause the server to do a security check for the given URI. If required, it does a redirect to change the scheme (http/https).

Parameters:
uri - the URI on which to run security checks.
request - the current HttpServletRequest.
response - the current HttpServletResponse.
Returns:
true if a redirect occurred.

getListenPort

int getListenPort(HttpServletRequest request)
Get the port on which the server is listening for unsecure connections.

Parameters:
request - the current HttpServletRequest.
Returns:
the port on which the server is listening for unsecure connections.

getSecureListenPort

int getSecureListenPort(HttpServletRequest request)
Get the port on which the server is listening for secure connections.

Parameters:
request - the current HttpServletRequest.
Returns:
the port on which the server is listening for secure connections.

login

void login(String username,
           String password,
           HttpServletRequest request,
           HttpServletResponse response)
           throws LoginException
Log in the user, using "weak" username/password authentication.

Parameters:
username - the user's login name.
password - the user's password.
request - the current HttpServletRequest.
response - the current HttpServletResponse.
Throws:
LoginException - if the authentication failed

logout

void logout(boolean invalidateSessions,
            HttpServletRequest request,
            HttpServletResponse response)
Log out the current user.

Parameters:
invalidateSessions - if true, the session is invalidated (on all single-signon webapps); otherwise the session and its data are left intact. To invalidate the session in only the current webapp, set this parameter to false and call invalidate() on the HttpSession.
request - the current HttpServletRequest.
response - the current HttpServletResponse.

getFullContextPath

String getFullContextPath(HttpServletRequest request)
Return the webapp context path for the given request. This differs from HttpServletRequest.getContextPath() only in that it will return a valid value even if the request is for the default webapp.

Parameters:
request - the current HttpServletRequest.

ensureFailover

void ensureFailover(String attrName,
                    Object attrVal,
                    HttpServletRequest request)
Ensure that the given session attribute is replicated in a cluster for session failover. This method does not need to be implemented for servers that do not support clustering and session failover.

Parameters:
attrName - the name of the session attribute for which failover should be ensured.
attrVal - the value of the given session attribute.
request - the current HttpServletRequest.

beginRequest

void beginRequest(HttpServletRequest request,
                  HttpServletResponse response)
Called at the beginning of each processed request.

Parameters:
request - the current HttpServletRequest.
response - the current HttpServletResponse.

endRequest

void endRequest(HttpServletRequest request,
                HttpServletResponse response)
Called at the end of each processed request.

Parameters:
request - the current HttpServletRequest.
response - the current HttpServletResponse.

createControlBeanContext

ControlBeanContext createControlBeanContext(HttpServletRequest request,
                                            HttpServletResponse response)
Get a context object to support Java Controls.

Parameters:
request - the current HttpServletRequest.
response - the current HttpServletResponse.
Returns:
a new ControlBeanContext.

getPlatformName

String getPlatformName()
Get the name of the platform, which may be used to find platform-specific configuration files.

Returns:
the name of the platform

getEventReporter

PageFlowEventReporter getEventReporter()
Get an event reporter, which will be notified of events like "page flow created", "action raised", etc.