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 class
Inner 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 void
abandonRequest
(int id) Abandon LDAP request with the specified message ID(package private) void
addListener
(LdapContextImpl ctx, String name, String filter, SearchControls jndiCtrls, NamingListener l) Add change event listenerprivate NamingEvent
createNamingEvent
(LdapContextImpl ctx, LDAPEntry entry, LDAPEntryChangeControl changeCtrl) Create naming event from a change controlprivate LDAPPersistSearchControl
createSrchCtrl
(NamingListener listener) Create a persistent search control.private void
dispatchEvent
(EventObject event, EventService.EventEntry eventEntry) Dispatch naming event to all listenersprivate EventService.EventEntry
getEventEntry
(int id) Find event entry by message IDprivate void
On network error, create NamingExceptionEvent and delever it to all listeners on all events.private void
Response message carries a LDAP error.private void
Process change notification attached as the change control to the messageprivate void
Search continuation messages are ignored.(package private) void
removeListener
(NamingListener listener) Remove change event listenervoid
run()
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
-