## org.mortbay.terracotta.servlet
Class TerracottaSessionIdManager

    java.lang.Object
      org.mortbay.component.AbstractLifeCycle
          org.mortbay.terracotta.servlet.TerracottaSessionIdManager

All Implemented Interfaces:
  LifeCycle, SessionIdManager

    public class TerracottaSessionIdManager

extends AbstractLifeCycle
implements SessionIdManager

A specialized SessionIdManager to be used with Terracotta. See the `TerracottaSessionManager` javadocs for implementation notes.

See Also:
  `TerracottaSessionManager`

Nested Class Summary

Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle
`LifeCycle.Listener`

Field Summary

Fields inherited from class org.mortbay.component.AbstractLifeCycle
`_listeners`

Constructor Summary
`TerracottaSessionIdManager(Server server)`

Method Summary
`void` `addSession(javax.servlet.http.HttpSession session)` Add a session to the list of known sessions for a given ID.
`void` `doStart()`
`void` `doStop()`
`java.lang.String` `getClusterId(java.lang.String nodeId)` Get a cluster ID from a node ID.
`java.lang.String` `getNodeId(java.lang.String clusterId, javax.servlet.http.HttpServletRequest request)` Get a node ID from a cluster ID and a request
`java.lang.String` `getWorkerName()`
`boolean` `idInUse(java.lang.String clusterId)`
`void` `invalidateAll(java.lang.String clusterId)` When told to invalidate all session instances that share the same id, we must tell all contexts on the server for which it is defined to delete any session object they might have matching the id.
`java.lang.String` `newSessionId(javax.servlet.http.HttpServletRequest request, long created)`
`void` `removeSession(javax.servlet.http.HttpSession session)` Remove session from the list of known sessions for a given ID.
`void` `setWorkerName(java.lang.String workerName)`

Methods inherited from class org.mortbay.component.AbstractLifeCycle
`addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.mortbay.component.LifeCycle
`addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

Constructor Detail

### TerracottaSessionIdManager

    public TerracottaSessionIdManager(Server server)

Method Detail

### doStart

    public void doStart()

  Overrides:
    `doStart` in class `AbstractLifeCycle`

### doStop

    public void doStop()

  Overrides:
    `doStop` in class `AbstractLifeCycle`

### addSession

    public void addSession(javax.servlet.http.HttpSession session)

  Description copied from interface: `SessionIdManager`
  Add a session to the list of known sessions for a given ID.

  Specified by:
    `addSession` in interface `SessionIdManager`
  Parameters:
    `session` - The session

### getWorkerName

    public java.lang.String getWorkerName()

  Specified by:
    `getWorkerName` in interface `SessionIdManager`

### setWorkerName

    public void setWorkerName(java.lang.String workerName)

### idInUse

    public boolean idInUse(java.lang.String clusterId)

  Specified by:
    `idInUse` in interface `SessionIdManager`
  Parameters:
    `clusterId` - The session ID without any cluster node extension
  Returns:
    True if the session ID is in use by at least one context.

### invalidateAll

    public void invalidateAll(java.lang.String clusterId)

  When told to invalidate all session instances that share the same id, we must tell all contexts on the server for which it is defined to delete any session object they might have matching the id.

  Specified by:
    `invalidateAll` in interface `SessionIdManager`
  Parameters:
    `clusterId` - The session ID without any cluster node extension

### newSessionId

    public java.lang.String newSessionId(javax.servlet.http.HttpServletRequest request,
                                         long created)

  Specified by:
    `newSessionId` in interface `SessionIdManager`
  Returns:

### removeSession

    public void removeSession(javax.servlet.http.HttpSession session)

  Description copied from interface: `SessionIdManager`
  Remove session from the list of known sessions for a given ID.

  Specified by:
    `removeSession` in interface `SessionIdManager`

### getClusterId

    public java.lang.String getClusterId(java.lang.String nodeId)

  Description copied from interface: `SessionIdManager`
  Get a cluster ID from a node ID. Strip node identifier from a located session ID.

  Specified by:
    `getClusterId` in interface `SessionIdManager`
  Returns:

### getNodeId

    public java.lang.String getNodeId(java.lang.String clusterId,
                                      javax.servlet.http.HttpServletRequest request)

  Description copied from interface: `SessionIdManager`
  Get a node ID from a cluster ID and a request

  Specified by:
    `getNodeId` in interface `SessionIdManager`
  Parameters:
    `clusterId` - The ID of the session
    `request` - The request that for the session (or null)
  Returns:
    The session ID qualified with the node ID.

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.