Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.portal.portletservice.rememberme
Interface RememberMeCookieService

All Superinterfaces:
  PortletService

    public interface RememberMeCookieService

extends PortletService

Portlet service for JSR compliant portlets to leverage the remember me cookie functionality of WebSphere Portal.
The following sample shows how to perform the JNDI lookup to acquire a service object:

              com.ibm.portal.portlet.service.PortletServiceHome psh;
              javax.naming.Context ctx = new javax.naming.InitialContext();

              try {
                  psh = (PortletServiceHome) ctx.lookup(RememberMeCookieService.JNDI_NAME);
              } catch(javax.naming.NameNotFoundException ex) {
                  // error handling
              }

              // obtain the service object and use the service
              RememberMeCookieService rememberMeCookieService = (RememberMeCookieService) psh.getPortletService(RememberMeCookieService.class);
              if (rememberMeCookieService.isRememberMeCookieEnabled()) {
                  // ...
              }

Since:
  6.1

Field Summary
`static java.lang.String` | `JNDI_NAME`

Method Summary
`DisposableURL` | `getInvalidateCookieURL(RenderRequest renderReq, RenderResponse renderResp)` Returns a URL that triggers the invalidation of the remember me cookie.
`java.lang.String` | `getUserID(PortletRequest portletReq)` Returns the user ID that is extracted from the remember me cookie.
`boolean` | `isCookieSet(PortletRequest portletReq)` Returns `false` if the remember me cookie does not exist in the current request, `true` if the remember me cookie exists in the current request. This method does not validate cookie content, instead it checks the sheer existence in the passed request.
`boolean` | `isRememberMeCookieEnabled()` Returns `true` if the remember me cookie functionality is enabled and all components started successfully, `false` if the remember me cookie functionality is not available.

Field Detail

### JNDI_NAME

    static final java.lang.String JNDI_NAME

See Also:
  Constant Field Values

Method Detail

### isRememberMeCookieEnabled

    boolean isRememberMeCookieEnabled()

  Returns
  - `true` if the remember me cookie functionality is enabled and all components started successfully,
  - `false` if the remember me cookie functionality is not available.

### isCookieSet

    boolean isCookieSet(PortletRequest portletReq)
                        throws SecurityException

  Returns
  - `false` if the remember me cookie does not exist in the current request,
  - `true` if the remember me cookie exists in the current request.
  This method does not validate cookie content, instead it checks the sheer existence in the passed request.

  Parameters:
    `portletReq` - The current `PortletRequest`.
  Returns:
    A `boolean` indicating whether a remember me cookie is found in the current request.
  Throws:
    `SecurityException` - If an unrecoverable problem occurs.
    `java.lang.UnsupportedOperationException` - If the remember me cookie functionality is not available.

### getUserID

    java.lang.String getUserID(PortletRequest portletReq)
                               throws SecurityException

  Returns the user ID that is extracted from the remember me cookie. Returns `null` if the cookie does not exist in the current request.

  Parameters:
    `portletReq` - The current `PortletRequest`.
  Returns:
    The DN of the remembered user.
  Throws:
    `SecurityException` - If an unrecoverable problem occurs.
    `java.lang.UnsupportedOperationException` - If the remember me cookie functionality is not available.

### getInvalidateCookieURL

    DisposableURL getInvalidateCookieURL(RenderRequest renderReq,
                                         RenderResponse renderResp)
                                         throws SecurityException

  Returns a URL that triggers the invalidation of the remember me cookie. May return `null` in the case that it was not possible to create the URL.
  After the remember me cookie was invalidated using the returned URL, a redirection is made to the same portal page from which the URL was invoked. In the course of this redirection the cookie will be revoked.

  Parameters:
    `renderReq` - The current `RenderRequest`.
    `renderResp` - The current `RenderResponse`.
  Returns:
    The URL to trigger the invalidation of the remember me cookie or `null.`
  Throws:
    `java.lang.UnsupportedOperationException` - If the remember me cookie functionality is not available.
    `SecurityException` - If an unrecoverable problem occurs.

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD