Package com.netscape.jndi.ldap
Class EventService
java.lang.Object
com.netscape.jndi.ldap.EventService
- All Implemented Interfaces:
Runnable
Event Service monitors changes on the server
Implemented with the persistent search control. Uses ldapjdk asynchronous
interfaces so that multiple search requests can be processed by a single
thread
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classInner class that represents a binding between a change event, described with a set of search parameters, and a list of listeners -
Field Summary
FieldsModifier and TypeFieldDescription(package private) Vector<EventService.EventEntry>(package private) LdapService(package private) Thread(package private) LDAPSearchListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidabandonRequest(int id) Abandon LDAP request with the specified message ID(package private) voidaddListener(LdapContextImpl ctx, String name, String filter, SearchControls jndiCtrls, NamingListener l) Add change event listenerprivate NamingEventcreateNamingEvent(LdapContextImpl ctx, LDAPEntry entry, LDAPEntryChangeControl changeCtrl) Create naming event from a change controlprivate LDAPPersistSearchControlcreateSrchCtrl(NamingListener listener) Create a persistent search control.private voiddispatchEvent(EventObject event, EventService.EventEntry eventEntry) Dispatch naming event to all listenersprivate EventService.EventEntrygetEventEntry(int id) Find event entry by message IDprivate voidOn network error, create NamingExceptionEvent and delever it to all listeners on all events.private voidResponse message carries a LDAP error.private voidProcess change notification attached as the change control to the messageprivate voidSearch continuation messages are ignored.(package private) voidremoveListener(NamingListener listener) Remove change event listenervoidrun()Main monitor thread loop.
-
Field Details
-
m_ldapSvc
LdapService m_ldapSvc -
m_eventList
Vector<EventService.EventEntry> m_eventList -
m_monitorThread
Thread m_monitorThread -
m_msgQueue
LDAPSearchListener m_msgQueue
-
-
Constructor Details
-
EventService
Constructor
-
-
Method Details
-
addListener
void addListener(LdapContextImpl ctx, String name, String filter, SearchControls jndiCtrls, NamingListener l) throws NamingException Add change event listener- Throws:
NamingException
-
removeListener
Remove change event listener- Throws:
NamingException
-
abandonRequest
private void abandonRequest(int id) Abandon LDAP request with the specified message ID -
run
public void run()Main monitor thread loop. Wait for persistent search change notifications -
processNetworkError
On network error, create NamingExceptionEvent and delever it to all listeners on all events. -
processResponseMsg
Response message carries a LDAP error. Response with the code 0 (SUCCESS), should never be received as persistent search never completes, it has to be abandon. Referral messages are ignored -
processSearchResultMsg
Process change notification attached as the change control to the message -
processSearchResultRef
Search continuation messages are ignored. -
getEventEntry
Find event entry by message ID -
dispatchEvent
Dispatch naming event to all listeners -
createNamingEvent
private NamingEvent createNamingEvent(LdapContextImpl ctx, LDAPEntry entry, LDAPEntryChangeControl changeCtrl) throws NamingException Create naming event from a change control- Throws:
NamingException
-
createSrchCtrl
Create a persistent search control.- Throws:
NamingException
-