directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 1364 - in incubator/directory/ldap/trunk/eve/frontend/common: . api api/src api/src/java api/src/java/org api/src/java/org/apache api/src/java/org/apache/eve api/src/java/org/apache/eve/event api/src/java/org/apache/eve/listener api/src/java/org/apache/eve/security api/src/java/org/apache/eve/session
Date Sat, 06 Dec 2003 00:30:32 GMT
Author: akarasulu
Date: Fri Dec  5 16:30:31 2003
New Revision: 1364

Added:
   incubator/directory/ldap/trunk/eve/frontend/common/
   incubator/directory/ldap/trunk/eve/frontend/common/api/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ClientEvent.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectEvent.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectSubscriber.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectEvent.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectSubscriber.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Event.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/EventType.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationEvent.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationSubscriber.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionEvent.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionListener.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Subscriber.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/ClientKey.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/KeyExpiryException.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/security/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/security/LdapPrincipal.java
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/session/
   incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/session/ClientSession.java
Log:
common classes used throughout the frontend

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ClientEvent.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ClientEvent.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,93 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+import org.apache.eve.listener.ClientKey ;
+
+
+/**
+ * An event associated with a specific client. 
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public abstract class ClientEvent extends Event
+{
+    /** the unique client identifier */
+    private final ClientKey m_clientKey ;
+    
+    
+    /**
+     * Creates a client based event using a unique client key.
+     * 
+     * @param a_source the source that generated this event
+     * @param a_type the event type
+     * @param a_clientKey the client's read client key
+     */
+    public ClientEvent( Object a_source, EventType a_type,  
+                        ClientKey a_clientKey )
+    {
+        super( a_source, a_type ) ;
+        m_clientKey = a_clientKey ;
+    }
+
+
+    /**
+     * Gets the unique identifier for the client associated with this event.
+     * 
+     * @return the client's unique key
+     */
+    public final ClientKey getClientKey()
+    {
+        return m_clientKey ;
+    }
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectEvent.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectEvent.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,77 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+import org.apache.eve.listener.ClientKey ;
+
+
+/**
+ * Represents the acceptance by the server of a new client socket connection.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public class ConnectEvent
+    extends ClientEvent
+{
+    /**
+     * Creates a connect event which represents a client socket connection 
+     * being established.
+     * 
+     * @param a_source the source that creates this event
+     * @param a_clientKey the unique client key
+     */
+    public ConnectEvent( Object a_source, ClientKey a_clientKey ) 
+    {
+        super( a_source, EventType.CONNECT_EVENT, a_clientKey ) ;
+    }
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectSubscriber.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/ConnectSubscriber.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,70 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+/**
+ * Type specific Subscriber interface for ConnectEvents which represent the 
+ * acceptance of client socket connections by a server.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public interface ConnectSubscriber extends Subscriber
+{
+    /**
+     * ConnectionEvent specific inform handler.
+     * 
+     * @param an_event the ConnectEvent to handle
+     */
+    void inform( ConnectEvent an_event ) ;
+}
+

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectEvent.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectEvent.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,78 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+import org.apache.eve.listener.ClientKey;
+
+
+/**
+ * Represents the acceptance by the server of a new client socket connection.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public class DisconnectEvent extends ClientEvent
+{
+    /**
+     * Creates a new disconnect event using the client key associated with the
+     * client socket connection that was lost or dropped. 
+     * 
+     * @param a_source the object that created this event which in a server
+     * would be a component reponsible for dropping or detecting client 
+     * disconnections
+     * @param a_clientKey the client socket connection
+     */
+    public DisconnectEvent( Object a_source, ClientKey a_clientKey )
+    {
+        super( a_source, EventType.DISCONNECT_EVENT, a_clientKey ) ;
+    }
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectSubscriber.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/DisconnectSubscriber.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,73 @@
+/*
+
+ ============================================================================
+				   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+	this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+	this list of conditions and the following disclaimer in the documentation
+	and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+	include  the following  acknowledgment:  "This product includes  software
+	developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+	Alternately, this  acknowledgment may  appear in the software itself,  if
+	and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+	products derived  from this  software without  prior written
+	permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+	"Apache" appear  in their name,  without prior written permission  of the
+	Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+import java.util.EventListener ;
+
+
+/**
+ * Subscriber interface for DisconnectEvents which represent the loss or drop
+ * of client socket connections by a server.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public interface DisconnectSubscriber extends EventListener
+{
+    /**
+     * DisconnectEvent handler for this Subscriber type.
+     * 
+     * @param an_event the connection drop or loss event to handle
+     */
+    void inform( DisconnectEvent an_event ) ;
+}
+

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Event.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Event.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,90 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+import java.util.EventObject ;
+
+
+/**
+ * Event heirarchy base class used to make EventNotifier pattern type safe.
+ *
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public class Event extends EventObject
+{
+	/** the type of client event */
+	private final EventType m_type ;
+
+	
+    /**
+     * Creates a simple typed event.
+     * 
+     * @param a_source the source generating this event
+     */
+    public Event( Object a_source, EventType a_type )
+    {
+        super( a_source ) ;
+        m_type = a_type ;
+    }
+
+
+	/**
+	 * Gets the type safe enumeration for this event type.
+	 * 
+	 * @return the type of this ClientEvent
+	 */
+	public final EventType getType() 
+	{
+		return m_type ;
+	}
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/EventType.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/EventType.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,105 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+import org.apache.avalon.framework.ValuedEnum ;
+
+
+/**
+ * A type safe event type enumeration.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public class EventType extends ValuedEnum
+{
+    /** connect event type value */
+    public static final int CONNECT_VAL = 0 ;
+
+    /** connect EventType */
+    public static final EventType CONNECT_EVENT =
+        new EventType( "Connect", CONNECT_VAL ) ;
+
+    /** disconnect event type value */
+    public static final int DISCONNECT_VAL = 1 ;
+
+    /** disconnect EventType */
+    public static final EventType DISCONNECT_EVENT =
+        new EventType( "Disconnect", DISCONNECT_VAL ) ;
+
+    /** session creation type value */
+    public static final int SESSION_CREATION_VAL = 2 ;
+
+    /** session creation EventType */
+    public static final EventType SESSION_CREATION_EVENT =
+        new EventType( "SessionCreation", SESSION_CREATION_VAL ) ;
+
+    /** type value */
+    public static final int _VAL = 0 ;
+
+    /** EventType */
+    public static final EventType _EVENT =
+        new EventType( "", _VAL ) ;
+
+
+    /**
+     * Private constructor so no other instances can be created other than the
+     * public static constants in this class.
+     *
+     * @param a_name a string name for the enumeration value.
+     * @param a_value the integer value of the enumeration.
+     */
+    private EventType( final String a_name, final int a_value )
+    {
+        super( a_name, a_value ) ;
+    }
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationEvent.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationEvent.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,97 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+import org.apache.eve.session.ClientSession ;
+
+
+/**
+ * Denotes the creation of a client session which does not necessarily coincide
+ * with the establishment of a new client connection.  Attempts to rebind to
+ * the directory may destroy an existing session and create another one without
+ * droping the socket connection.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public class SessionCreationEvent extends ClientEvent 
+{
+    /** the newly created client session */
+    private final ClientSession m_session ;
+    
+    
+    /**
+     * Creates a new event using a source, a client and the newly created 
+     * session object.
+     * 
+     * @param a_source the source that created this event
+     * @param a_session the newly created client session
+     */
+    public SessionCreationEvent( Object a_source, ClientSession a_session )
+    {
+        super( a_source, EventType.SESSION_CREATION_EVENT, 
+               a_session.getClientKey() ) ;
+        m_session = a_session ;
+    }
+
+
+    /**
+     * Gets the newly created session object.
+     * 
+     * @return the newly created session object
+     */
+    public ClientSession getClientSession()
+    {
+        return m_session ;
+    }
+}
+

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationSubscriber.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionCreationSubscriber.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,68 @@
+/*
+
+ ============================================================================
+				   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+	this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+	this list of conditions and the following disclaimer in the documentation
+	and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+	include  the following  acknowledgment:  "This product includes  software
+	developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+	Alternately, this  acknowledgment may  appear in the software itself,  if
+	and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+	products derived  from this  software without  prior written
+	permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+	"Apache" appear  in their name,  without prior written permission  of the
+	Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+/**
+ * Type safe Subscriber for session creation events for clients.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public interface SessionCreationSubscriber extends Subscriber
+{
+    /**
+     * Informs the Subscriber interested in SessionCreationEvents.
+     * 
+     * @param an_event the event to inform this Subscriber about.
+     */
+    public void inform( SessionCreationEvent an_event ) ;
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionEvent.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionEvent.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,97 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+import org.apache.eve.session.ClientSession ;
+
+
+/**
+ * Denotes the destruction of a client session which does not necessarily 
+ * coincide with the loss of a socket connection.  Attempts to rebind to
+ * the directory may destroy an existing session and create another one without
+ * droping the socket connection.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public class SessionDestructionEvent extends ClientEvent 
+{
+    /** the newly created client session */
+    private final ClientSession m_session ;
+    
+    
+    /**
+     * Creates a new event using a source, a client and the destroyed client
+     * session object.
+     * 
+     * @param a_source the source that created this event
+     * @param a_session the newly created client session
+     */
+    public SessionDestructionEvent( Object a_source, ClientSession a_session )
+    {
+        super( a_source, EventType.SESSION_CREATION_EVENT,  
+               a_session.getClientKey() ) ;
+        m_session = a_session ;
+    }
+
+
+    /**
+     * Gets the destroyed client session object.
+     * 
+     * @return the destroyed session object
+     */
+    public ClientSession getClientSession()
+    {
+        return m_session ;
+    }
+}
+

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionListener.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/SessionDestructionListener.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,68 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+/**
+ * Type safe Subscriber interested in session deletion events.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public interface SessionDestructionListener
+{
+    /**
+     * Informs this Subscriber of session destruction events.
+     * 
+     * @param an_event the destruction event to inform of
+     */
+    public void inform( SessionDestructionEvent an_event ) ;
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Subscriber.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/event/Subscriber.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,73 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.event ;
+
+
+import java.util.EventListener ;
+
+
+/**
+ * A Subscriber from the Event Notifier pattern. 
+ * 
+ * @see <a href="http://members.ispwest.com/jeffhartkopf/notifier">
+ * Event Notifier Pattern</a>
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public interface Subscriber extends EventListener
+{
+    /**
+     * Informs this Subscriber of an event.
+     * 
+     * @param a_event the event notified of 
+     */
+    void inform( Event a_event ) ;
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/ClientKey.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/ClientKey.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,334 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.listener ;
+
+
+import java.net.Socket ;
+
+import java.io.IOException ;
+
+
+/**
+ * Every client that successfully binds anonymously or with a valid identity
+ * has a unique client key represented by this class.  First and foremost the
+ * key is used to uniquely identify the client based on the interface and
+ * port used to connection on the server as well as the interface and port used
+ * by the client.
+ *
+ * The ClientKey plays a central role in coordinating activities with the
+ * server across various threads.  Threads within the same stage or across
+ * stages are synchronized on client resources using lock objects held by a
+ * ClientKey instance.  Socket IO is managed using a pair of lock objects
+ * specificially for this purpose.
+ *
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author: akarasulu $
+ * @version $Revision$
+ */
+public final class ClientKey
+{
+    // ----------------------------------------------
+    // Private members.
+    // ----------------------------------------------
+
+    /** Input channel synchronization object */
+    private final Object m_inputLock = new Object() ;
+    /** Output channel synchronization object */
+    private final Object m_outputLock = new Object() ;
+    /** Unique key or client id */
+    private final String m_clientId ;
+    /** Socket connection to client */
+    private final Socket m_socket ;
+    
+	/** Whether or not this key has expired: the client has disconnected. */
+    private boolean m_hasExpired = false ;
+
+
+    // ----------------------------------------------
+    // Constructors
+    // ----------------------------------------------
+
+
+    /**
+      * Generates a unique connection/client identifier String for a client
+      * socket connection.  The key is composed of the local server address
+      * and port attached to the remote client address and port.  If the
+      * server ip and port are 192.168.1.1:1389 and the client's ip and port are
+      * 34.23.12.1:5678 then the key string would be:
+      *
+      * 192.168.1.1:1389<-34.23.12.1:5678
+      *
+      * This makes the key unique at any single point in time.
+      *
+      * @param a_socket newly established client socket connection to the
+      * server.
+      */
+    ClientKey( final Socket a_socket )
+    {
+        // build the key ...
+        StringBuffer l_buf = new StringBuffer() ;
+        l_buf.append( a_socket.getLocalAddress().getHostAddress() ) ;
+        l_buf.append( ':' ) ;
+        l_buf.append( a_socket.getLocalPort() ).append( "<-" ) ;
+        l_buf.append( a_socket.getInetAddress().getHostAddress() ) ;
+        l_buf.append( ':' ) ;
+        l_buf.append( a_socket.getPort() ) ;
+        
+        // set finals ...
+        m_clientId = l_buf.toString() ;
+        m_socket = a_socket ;
+    }
+
+
+    // ----------------------------------------------
+    // Accessors of conn. parameters to client id
+    // ----------------------------------------------
+
+    
+    /**
+     * Get the unique client id for a connected client based on connection
+     * parameters.
+     *
+     * @return the unique id of the client connection
+     * @throws KeyExpiryException to force the handling of expired keys rather
+     * than depending on developers to maintain a convention of checking for
+     * key expiration before use in other modules.
+     */
+    public String getClientId() throws KeyExpiryException
+    {
+        checkExpiry() ;
+        return m_clientId ;
+    }
+    
+    
+    /**
+     * Gets the clients socket connection.
+     * 
+     * @return the client's socket connection
+     */
+    public Socket getSocket() throws KeyExpiryException
+    {
+        checkExpiry() ;
+        return m_socket ; 
+    }
+
+
+    /**
+     * Gets the client's IP address.
+     *
+     * @return the client's ip address.
+     * @throws KeyExpiryException to force the handling of expired keys
+     */
+    public String getClientAddress() throws KeyExpiryException
+    {
+        checkExpiry() ;
+		return m_socket.getInetAddress().getHostAddress() ; 
+    }
+
+
+    /**
+     * Gets the client's hostname.
+     *
+     * @return the client's hostname.
+     * @throws KeyExpiryException to force the handling of expired keys
+     */
+    public String getClientHost() throws KeyExpiryException
+    {
+        checkExpiry() ;
+        return m_socket.getInetAddress().getHostName() ;
+    }
+
+
+    // ----------------------------------------------
+    // ClientKey lock object accessors.
+    // ----------------------------------------------
+
+
+    /**
+     * Gets the client's output stream lock object.
+     *
+     * @return ouput lock object.
+     * @throws KeyExpiryException to force the handling of expired keys
+     */
+    public Object getOutputLock() throws KeyExpiryException
+    {
+        checkExpiry() ;
+        return m_outputLock ;
+    }
+
+
+    /**
+     * Gets the client's input stream lock object.
+     *
+     * @return input lock object.
+     * @throws KeyExpiryException to force the handling of expired keys
+     */
+    public Object getInputLock() throws KeyExpiryException
+    {
+        checkExpiry() ;
+        return m_inputLock ;
+    }
+
+
+    // ----------------------------------------------
+    // Key expiration methods.
+    // ----------------------------------------------
+
+
+    /**
+     * Determines if the client represented by this ClientKey is still
+     * connected to the server.  Once disconnected the ClientKey is expired
+     * by the server so processing on behalf of the client does not continue.
+     *
+     * @return true if the client is no longer connected to the server, false
+     * if the client is connected.
+     */
+    public boolean hasExpired()
+    {
+        return m_hasExpired ;
+    }
+
+
+    /**
+     * Expires this key to indicate the disconnection of the client represented
+     * by this key from the server.  It is intentionally package friendly to
+     * only allow access by the ClientModule.  Tries to close socket if it is
+     * still open.
+     */
+    void expire() throws IOException
+    {
+        m_hasExpired = true ;
+        
+        if ( null != m_socket )
+        {
+            m_socket.close() ;
+        }
+    }
+
+
+    /**
+     * Utility method to throw key expiration exception if this ClientKey has
+     * expired.  This method is called by most accessor methods within this
+     * class with <code>hasExpired()</code> being the only exception.  The
+     * purpose for this is to force ClientKey using modules to check for
+     * expiration rather rely upon them to check to see if the key is valid
+     * before use everytime.
+     * 
+     * @throws KeyExpiryException to force the handling of expired keys rather
+     * than depending on developers to maintain a convention of checking for
+     * key expiration before use in other modules.
+     */
+    void checkExpiry() throws KeyExpiryException
+    {
+        if( m_hasExpired ) 
+        {
+            throw new KeyExpiryException( this ) ;
+        }
+    }
+
+
+    // ----------------------------------------------
+    // Class java.lang.Object method overrides.
+    // ----------------------------------------------
+
+
+    /**
+     * For debugging returns the clientId string.
+     *
+     * @return the client id string.
+     */
+    public String toString()
+    {
+        return m_clientId ;
+    }
+
+
+    /**
+     * Gets the hashCode of the unique clientId String.  Overriden to correctly
+     * manage ClientKey's within Map based collections.
+     *
+     * @return the clientId hashCode value.
+     */
+    public int hashCode()
+    {
+        return m_clientId.hashCode() ;
+    }
+
+
+    /**
+     * Determines whether this ClientKey is equivalent to another.  If argument
+     * object is not the same reference the clientId String's are compared using
+     * the <code>String.equal()</code> method.  Required for containment within
+     * collections.  Also note that if Strings are supplied or other classes are
+     * supplied as arguments String equality checks are conducted on the client
+     * id String.
+     *
+     * @return true if an_obj equals this ClientKey, false otherwise.
+     */
+    public boolean equals( Object an_obj )
+    {
+        if( this == an_obj ) 
+        {
+            return true ;
+        } 
+        else if( an_obj instanceof String )
+        {
+            return m_clientId.equals( an_obj ) ;
+        }
+        else if( an_obj instanceof ClientKey ) 
+        {
+            return ( ( ClientKey ) an_obj ).m_clientId.equals( m_clientId ) ;
+        }
+        else
+        {
+            return m_clientId.equals( an_obj.toString() ) ;
+        }
+    }
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/KeyExpiryException.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/listener/KeyExpiryException.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,103 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.listener ;
+
+
+import java.io.IOException ;
+
+
+/**
+ * An exception that is raised when the accessor methods on an expired ClientKey
+ * are used.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public class KeyExpiryException extends IOException
+{
+    /** the key that caused this exception by being accessed after expiring */
+    private final ClientKey m_key ;
+    
+    /** 
+     * Constructs an Exception without a message.
+     * 
+     * @param a_key the unique key for the client which expired. 
+     */
+    public KeyExpiryException( ClientKey a_key ) 
+    {
+        super() ;
+        m_key = a_key ;
+    }
+
+    
+    /**
+     * Constructs an Exception with a detailed message.
+     * 
+     * @param a_key the unique key for the client which expired. 
+     * @param a_message The message associated with the exception.
+     */
+    public KeyExpiryException( ClientKey a_key, String a_message ) 
+    {
+        super( a_message );
+		m_key = a_key ;
+    }
+
+
+    /**
+     * Gets the expired key which caused this exception when it was accessed.
+     * 
+     * @return the expired ClientKey.
+     */
+    public ClientKey getClientKey()
+    {
+        return m_key ;
+    }
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/security/LdapPrincipal.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/security/LdapPrincipal.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,80 @@
+/*
+
+ ============================================================================
+                   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+    include  the following  acknowledgment:  "This product includes  software
+    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+    Alternately, this  acknowledgment may  appear in the software itself,  if
+    and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+    products derived  from this  software without  prior written
+    permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+    "Apache" appear  in their name,  without prior written permission  of the
+    Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.security ;
+
+
+import java.util.Locale ;
+import javax.naming.Name ;
+import java.security.Principal ;
+
+
+/**
+ * Principal with accessors to a Name and a Locale.
+ *
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public interface LdapPrincipal extends Principal
+{
+    /**
+     * Gets the distinguished name associated with this Principal as a Name.
+     * 
+     * @return the distinguished name of this Principal as a Name
+     */
+    Name getDn() ;
+    
+    /**
+     * Gets the Locale of this Principal.
+     * 
+     * @return the Locale of the Principal.
+     */
+    Locale getLocale() ;
+}

Added: incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/session/ClientSession.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/frontend/common/api/src/java/org/apache/eve/session/ClientSession.java	Fri Dec  5 16:30:31 2003
@@ -0,0 +1,162 @@
+/*
+
+ ============================================================================
+				   The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of  source code must  retain the above copyright  notice,
+	this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+	this list of conditions and the following disclaimer in the documentation
+	and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+	include  the following  acknowledgment:  "This product includes  software
+	developed  by the  Apache Software Foundation  (http://www.apache.org/)."
+	Alternately, this  acknowledgment may  appear in the software itself,  if
+	and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" 
+	and "Apache Software Foundation"  must not be used to endorse or promote
+	products derived  from this  software without  prior written
+	permission. For written permission, please contact apache@apache.org.
+
+ 5. Products  derived from this software may not  be called "Apache", nor may
+	"Apache" appear  in their name,  without prior written permission  of the
+	Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
+ APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
+ ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
+ (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software  consists of voluntary contributions made  by many individuals
+ on  behalf of the Apache Software  Foundation. For more  information on the
+ Apache Software Foundation, please see <http://www.apache.org/>.
+
+*/
+package org.apache.eve.session ;
+
+
+import java.util.Locale ;
+import java.util.Iterator ;
+
+import java.security.Principal ;
+
+import org.apache.eve.listener.ClientKey ;
+
+
+/**
+ * Session interface for a client.
+ *
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Revision$
+ */
+public interface ClientSession
+{
+    /**
+     * Gets the unique client key associated with this session.
+     * 
+     * @return the unique client key
+     */
+    ClientKey getClientKey() ;
+
+    /**
+     * Gets whether or not this session is valid.  A valid session is one that
+     * corresponds to a connected client.  Sessions are invalidated once the
+     * client connection is lost or dropped or when sessions are destroyed to
+     * bind as a different user.
+     * 
+     * @return true if this session is still valid, false if it is not 
+     */
+    boolean isValid() ;
+
+    /**
+     * Gets an iterator over all the attribute names stored in this session.
+     * 
+     * @return an iterator of key names
+     */
+    Iterator getAttributeNames() ;
+
+    /**
+     * Gets the value for a session attribute name.
+     * 
+     * @param an_attrName the name of the session attribute key
+     * @return the value of the session attribute
+     */
+    Object getAttribute( String an_attrName ) ;
+
+    /**
+     * Removes a session attribute key and value from this session.
+     * 
+     * @param an_attrName the name of the session attribute key
+     */
+    void removeAttribute( String an_attrName ) ;
+
+    /**
+     * Sets the value of a session attribute.
+     * 
+     * @param an_attrName the name of the session attribute key
+     * @param a_attrValue the value to set for the session attribute
+     */
+    void setAttribute( String an_attrName, Object a_attrValue ) ;
+
+    /**
+     * Determines if this session is newly created before an appropriate 
+     * authenticated principal could be set.
+     * 
+     * @return true if the principal has yet to be authenticated
+     */
+    boolean isNew() ;
+
+    /**
+     * Gets the creation time of this session in milliseconds.
+     * 
+     * @return the creation time in milliseconds
+     */
+    long getCreationTime() ;
+
+    /**
+     * Gets the time this session was accessed in milliseconds.
+     * 
+     * @return the last access time in milliseconds
+     */
+    long getLastAccessedTime() ;
+
+    /**
+     * Gets the maximum inactivity time in seconds before timing out this 
+     * session.
+     * 
+     * @return the timeout period in seconds
+     */
+    int getMaxInactiveInterval() ;
+
+    /**
+     * Gets the locale of the session's client.
+     * 
+     * @return the locale of the client
+     */
+    Locale getLocale() ;
+
+    /**
+     * Gets the principal for the client this session belongs to.  If the 
+     * session is new or annonymous authentication is allowed then this 
+     * principal will return the empty string for getName().
+     * 
+     * @return the principal owning this session
+     */
+    Principal getPrincipal() ;
+}

Mime
View raw message