com.sun.slamd.example
Class LatencyCheckMasterThread

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

public class LatencyCheckMasterThread
extends java.lang.Thread

This class defines a thread that will periodically make changes to an LDAP directory server so that another thread can watch for those changes to appear on a replica. This makes it possible to measure the replication latency between the master and the replica.

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
LatencyCheckMasterThread(ReplicaLatencyCheckJobClass jobThread, java.lang.String masterHost, int masterPort, java.lang.String bindDN, java.lang.String bindPW, java.lang.String entryDN, java.lang.String attributeName, int latencyDelay)
          Creates a new latency check master thread based on the provided information.
 
Method Summary
 void run()
          Periodically makes changes to the specified entry in the directory.
 void startChecking()
          Indicates that this thread should start performing modifications against the directory server.
 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

LatencyCheckMasterThread

public LatencyCheckMasterThread(ReplicaLatencyCheckJobClass jobThread,
                                java.lang.String masterHost,
                                int masterPort,
                                java.lang.String bindDN,
                                java.lang.String bindPW,
                                java.lang.String entryDN,
                                java.lang.String attributeName,
                                int latencyDelay)
                         throws netscape.ldap.LDAPException
Creates a new latency check master thread based on the provided information.

Parameters:
jobThread - The job thread with which this check thread is associated.
masterHost - The address of the directory server.
masterPort - The port of the directory server.
bindDN - The DN to use to bind to the directory.
bindPW - The password to use to bind to the directory.
entryDN - The DN of the entry to be modified.
attributeName - The name of the attribute to modify.
latencyDelay - The minimum length of time that should pass between modifications.
Throws:
netscape.ldap.LDAPException - If a problem occurs while establishing the connection to the directory server.
Method Detail

startChecking

public void startChecking()
Indicates that this thread should start performing modifications against the directory server.


run

public void run()
Periodically makes 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.