com.sun.slamd.example
Class LatencyCheckReplicaThread

java.lang.Object
  extended by java.lang.Thread
      extended by com.sun.slamd.example.LatencyCheckReplicaThread
All Implemented Interfaces:
java.lang.Runnable

public class LatencyCheckReplicaThread
extends java.lang.Thread

This class defines a thread that will register a persistent search against an LDAP directory server and watch for any changes to a specified entry.

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
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LatencyCheckReplicaThread(ReplicaLatencyCheckJobClass jobThread, java.lang.String replicaHost, int replicaPort, java.lang.String bindDN, java.lang.String bindPW, java.lang.String entryDN)
          Creates a new latency check thread that registers a persistent search against a replica directory server and watches for changes to a specified entry.
 
Method Summary
 void run()
          Checks for and reports changes to the specified entry in the directory.
 void startChecking()
          Indicates that the thread should start watching for changes to the specified entry.
 void stopAndWait()
          Indicates that the check thread should stop running and waits for it to do so.
 
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
 

Constructor Detail

LatencyCheckReplicaThread

public LatencyCheckReplicaThread(ReplicaLatencyCheckJobClass jobThread,
                                 java.lang.String replicaHost,
                                 int replicaPort,
                                 java.lang.String bindDN,
                                 java.lang.String bindPW,
                                 java.lang.String entryDN)
                          throws netscape.ldap.LDAPException
Creates a new latency check thread that registers a persistent search against a replica directory server and watches for changes to a specified entry.

Parameters:
jobThread - The job thread with which this check thread is associated.
replicaHost - The address of the replica directory server.
replicaPort - The port number of the replica directory server.
bindDN - The DN to use to bind to the replica directory.
bindPW - The password to use to bind to the replica directory.
entryDN - The DN of the entry to watch for changes.
Throws:
netscape.ldap.LDAPException - If a problem occurs while establishing the connection to the directory server.
Method Detail

startChecking

public void startChecking()
Indicates that the thread should start watching for changes to the specified entry. This method will not return until the thread has actually seen the request to start.


run

public void run()
Checks for and reports changes to the specified entry in the directory.

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

stopAndWait

public void stopAndWait()
Indicates that the check thread should stop running and waits for it to do so.