com.ibm.portal.state.service
Interface PortalStateManagerServiceHome


public interface PortalStateManagerServiceHome

Home interface that can be looked up in JNDI and that provides access to the portal state manager service.
Example:

     PortalStateManagerServiceHome psh;
     javax.naming.Context ctx = new javax.naming.InitialContext();
     try {
          psh = (PortalStateManagerServiceHome) 
             ctx.lookup("portal:service/state/PortalStateManager");
     } catch(javax.naming.NameNotFoundException ex) {
          ... error handling ...
     }
     ...
     // request the service via the home interface
     PortalStateManagerService service = psh.getPortalStateManagerService(request, response);

 
NOTE: This API may only be used in the scope of an HTTP request in WebSphere Portal, i.e. within a theme. The API can not be invoked directly by a custom servlet.

Since:
5.1.0.1

Field Summary
static java.lang.String JNDI_NAME
           
 
Method Summary
 PortalStateManagerService getPortalStateManagerService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Returns a PortalStateManagerService instance which is valid within the scope of one request.
 PortalStateManagerService getPortalStateManagerService(ServerContext context, java.util.Locale locale, javax.ccpp.Profile profile, boolean isProtected, boolean isSecure)
          Returns a PortalStateManagerService instance.
 

Field Detail

JNDI_NAME

static final java.lang.String JNDI_NAME
Since:
6.1.0.1
See Also:
Constant Field Values
Method Detail

getPortalStateManagerService

PortalStateManagerService getPortalStateManagerService(javax.servlet.http.HttpServletRequest request,
                                                       javax.servlet.http.HttpServletResponse response)
                                                       throws StateManagerException
Returns a PortalStateManagerService instance which is valid within the scope of one request. Storing the instance across requests causes errors.

Parameters:
request - The current servlet request. Must not be null.
response - The current servlet response. Must not be null.
Returns:
A configured PortalStateManagerService instance. Not null.
Throws:
StateManagerException - In case that the service cannot be retrieved.

getPortalStateManagerService

PortalStateManagerService getPortalStateManagerService(ServerContext context,
                                                       java.util.Locale locale,
                                                       javax.ccpp.Profile profile,
                                                       boolean isProtected,
                                                       boolean isSecure)
                                                       throws StateManagerException
Returns a PortalStateManagerService instance. Note that the returned service instance is not tied to a servlet request or response. Use this method in server-side artifacts (e.g. EJBs) that do not have access to the current servlet request and servlet response.

Parameters:
context - ServerContext providing information about the server (e.g. hostname, context path, server port etc.). Must not be null.
locale - A Locale object which is needed to create resource URLs that address locale-specific resources (e.g. icons). May be null.
profile - CCPP profile that characterizes the capabilities of a certain user agent. May be null.
isProtected - Boolean flag that indicates whether URLs generated with the returned service should point to the protected area by default.
isSecure - Boolean flag that indicates whether URLs generated with the returned service should result in a secure https connection by default.
Returns:
A configured PortalStateManagerService instance. Not null.
Throws:
StateManagerException - In case that the service cannot be retrieved.