com.sun.slamd.isw
Class ADLatencyCheckConsumerThread

java.lang.Object
  extended by java.lang.Thread
      extended by com.sun.slamd.isw.ADLatencyCheckConsumerThread
All Implemented Interfaces:
java.lang.Runnable

public class ADLatencyCheckConsumerThread
extends java.lang.Thread

This class defines a thread that watches for changes to a specified entry in Active Directory and notifies another thread responsible for making changes against the Sun ONE Directory that the change was pushed across.

Author:
Neil A. Wilson

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String AD_USN_ATTR
          The name of the attribute in active directory that contains the USN value indicating the current change level of the entry.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ADLatencyCheckConsumerThread(ISWLatencyCheckJobClass jobClass)
          Creates a new instance of this consumer thread, including establishing a connection to Active Directory and reading the USN from the monitor entry.
 
Method Summary
 java.lang.String getEntryUSN()
          Retrieves the USN value from the monitor entry.
 void run()
          Loop, watching for changes in Active Directory until requested to stop.
 void startChecking()
          Indicates that this producer thread should start the work of measuring latency by periodically polling an entry in the Active Directory server.
 void stopAndWait()
          Indicates that this consumer thread should stop running and that it should wait until verification has been provided that the thread has stopped.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AD_USN_ATTR

public static final java.lang.String AD_USN_ATTR
The name of the attribute in active directory that contains the USN value indicating the current change level of the entry.

See Also:
Constant Field Values
Constructor Detail

ADLatencyCheckConsumerThread

public ADLatencyCheckConsumerThread(ISWLatencyCheckJobClass jobClass)
                             throws netscape.ldap.LDAPException
Creates a new instance of this consumer thread, including establishing a connection to Active Directory and reading the USN from the monitor entry.

Parameters:
jobClass - The job class instance with which this consumer thread is associated.
Throws:
netscape.ldap.LDAPException - If a problem occurs while establishing the connection to Active Directory or reading the USN from the monitor entry.
Method Detail

getEntryUSN

public java.lang.String getEntryUSN()
                             throws netscape.ldap.LDAPException
Retrieves the USN value from the monitor entry.

Returns:
The USN value from the monitor entry, or null if it does not have one.
Throws:
netscape.ldap.LDAPException - If a problem occurs while performing the search.

startChecking

public void startChecking()
Indicates that this producer thread should start the work of measuring latency by periodically polling an entry in the Active Directory server.


stopAndWait

public void stopAndWait()
Indicates that this consumer thread should stop running and that it should wait until verification has been provided that the thread has stopped.


run

public void run()
Loop, watching for changes in Active Directory until requested to stop.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread