LDAP Classes
Implements Java LDAP

com.novell.ldap.events
Class LDAPEventSource

java.lang.Object
  extended bycom.novell.ldap.events.LDAPEventSource
Direct Known Subclasses:
EdirEventSource, PsearchEventSource

public abstract class LDAPEventSource
extends java.lang.Object

The base Class which is used by all Ldap Event Generator. This class is defined abstract so that it cannot be used directly. But it needs to be subclassed to define a EventSource which can also classify events.Since Event Classification is not handled completely in this class.


Nested Class Summary
protected  class LDAPEventSource.EventsGenerator
          This inner Thread is used to notify the Registered Listener when an LDAPResponse occurs.
 
Constructor Summary
LDAPEventSource()
           
 
Method Summary
protected  LDAPEventSource.EventsGenerator createListeningThread(LDAPMessageQueue queue, LDAPConnection conn, LDAPEventListener alistener, int msgid, LDAPEventSource source)
          This method creates the instance of EventsGenerator Thread, which transforms the ldapresponse received into events.
 long getSleepTime()
          This method returns the time to sleep (or wait) between two calls to check the ldap message queue for response.
protected  void pollforevents(LDAPMessageQueue queue, LDAPConnection conn, LDAPEventListener alistener, int msgid, LDAPEventSource source)
          This method is to register for LDAPEvents generated from a specific LDAPMessageQueue.
 void setSleepTime(long l)
          This method is used to set the time(in milliseconds) to sleep between two calls to check the ldap messsage queue for response.
protected  void stopeventpolling(LDAPEventListener alistener)
          Stops and removes the polling Thread for this listener from receiving LDAP events fired by this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPEventSource

public LDAPEventSource()
Method Detail

stopeventpolling

protected void stopeventpolling(LDAPEventListener alistener)
                         throws LDAPException
Stops and removes the polling Thread for this listener from receiving LDAP events fired by this class. The listener can only register once once with this LDAPEventSource. After this method is invoked, the listener will no longer receive events with this LDAPEventSource instance as the event source (except for those events already in the process of being dispatched). If the listener was not, or is no longer, registered with this instance, this method does not do anything.

Parameters:
alistener - Removes the listener from receiving the events fired by this LDAPEventSource.
Throws:
LDAPException - If problem is encountered while removing the listener.

pollforevents

protected void pollforevents(LDAPMessageQueue queue,
                             LDAPConnection conn,
                             LDAPEventListener alistener,
                             int msgid,
                             LDAPEventSource source)
This method is to register for LDAPEvents generated from a specific LDAPMessageQueue.

Parameters:
queue - LDAPMessageQueue for checking the events.
conn - LDAPConnection used to create this MessageQueue , required to abandon the message.
alistener - The listener which would get the event.
msgid - The message id for the Message send.
source - The object which would be used as for LDAPEvents Generated.

createListeningThread

protected LDAPEventSource.EventsGenerator createListeningThread(LDAPMessageQueue queue,
                                                                LDAPConnection conn,
                                                                LDAPEventListener alistener,
                                                                int msgid,
                                                                LDAPEventSource source)
This method creates the instance of EventsGenerator Thread, which transforms the ldapresponse received into events.

Parameters:
queue - LDAPMessageQueue for checking the events.
conn - LDAPConnection used to create this MessageQueue , required to abandon the message.
alistener - The listener which would get the event.
msgid - The message id for the Message send.
source - The object which would be used as for LDAPEvents Generated.
Returns:
instance of EventsGenerator

getSleepTime

public long getSleepTime()
This method returns the time to sleep (or wait) between two calls to check the ldap message queue for response.

Returns:
time in milliseconds

setSleepTime

public void setSleepTime(long l)
This method is used to set the time(in milliseconds) to sleep between two calls to check the ldap messsage queue for response. The value of sleep time cannot be zero or negative. Note: If the time is set to very high value, the events would not be received. Recommended value is 1 second (Default).

Parameters:
l - Sleep Time in MilliSeconds.

LDAP Classes
Implements Java LDAP

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000