org.apache.directory.server.ldap
Class LdapSessionManager

java.lang.Object
  extended by org.apache.directory.server.ldap.LdapSessionManager

public class LdapSessionManager
extends java.lang.Object

Manages sessions in a thread safe manner for the LdapService. This class is used primarily by the LdapProtocolHandler to manage sessions and is created by the LdapService which makes it available to the handler. It's job is simple and this class was mainly created to be able to expose the session manager safely to things like the LdapProtocolHandler.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
LdapSessionManager()
           
 
Method Summary
 void addLdapSession(LdapSession ldapSession)
          Adds a new LdapSession to the LdapService.
 LdapSession getLdapSession(org.apache.mina.common.IoSession session)
          Gets the LdapSession associated with the MINA session.
 LdapSession[] getSessions()
          Gets the active sessions managed by the LdapService.
 LdapSession removeLdapSession(org.apache.mina.common.IoSession session)
          Removes an LdapSession managed by the LdapService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapSessionManager

public LdapSessionManager()
Method Detail

getSessions

public LdapSession[] getSessions()
Gets the active sessions managed by the LdapService.


addLdapSession

public void addLdapSession(LdapSession ldapSession)
Adds a new LdapSession to the LdapService.

Parameters:
ldapSession - the newly created LdapSession

removeLdapSession

public LdapSession removeLdapSession(org.apache.mina.common.IoSession session)
Removes an LdapSession managed by the LdapService. This method has no side effects: meaning it does not perform cleanup tasks after removing the session. This task is handled by the callers.

Parameters:
session - the MINA session of the LdapSession to be removed
Returns:
the LdapSession to remove

getLdapSession

public LdapSession getLdapSession(org.apache.mina.common.IoSession session)
Gets the LdapSession associated with the MINA session.

Parameters:
session - the MINA session of the LdapSession to retrieve
Returns:
the LdapSession associated with the MINA IoSession


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.