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 LdapServer. This class is used primarily by the LdapProtocolHandler to manage sessions and is created by the LdapServer 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 LdapServer.
 LdapSession getLdapSession(org.apache.mina.core.session.IoSession session)
          Gets the LdapSession associated with the MINA session.
 LdapSession[] getSessions()
          Gets the active sessions managed by the LdapServer.
 LdapSession removeLdapSession(org.apache.mina.core.session.IoSession session)
          Removes an LdapSession managed by the LdapServer.
 
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 LdapServer.


addLdapSession

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

Parameters:
ldapSession - the newly created LdapSession

removeLdapSession

public LdapSession removeLdapSession(org.apache.mina.core.session.IoSession session)
Removes an LdapSession managed by the LdapServer. 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.core.session.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-2011 Apache Software Foundation. All Rights Reserved.