|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
com.sun.slamd.job.JobClass
com.sun.slamd.example.WeightedLDAPLoadJobClass
public class WeightedLDAPLoadJobClass
This class implements a SLAMD job class that has the ability to generate various kinds of load against an LDAP directory server. It can perform search, compare, add, delete, modify, and modify RDN operations. The relative frequencies of each kind of operation may be specified by the user scheduling the job for execution. It can also use a weighting mechanism to target one set of entries more frequently than another, and this weighting can differ based on the type of operation to perform (i.e., one weighting for searches and another for modifies and compares). Adds, deletes, and modify DN operations will not be impacted.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static char[] |
ALPHABET
The set of characters that will make up randomly-generated strings. |
static java.lang.String |
SSL_KEY_PASSWORD_PROPERTY
The system property used to specify the password for the JSSE key store. |
static java.lang.String |
SSL_KEY_STORE_PROPERTY
The system property used to specify the location of the JSSE key store. |
static java.lang.String |
SSL_TRUST_PASSWORD_PROPERTY
The system property used to specify the password for the JSSE trust store. |
static java.lang.String |
SSL_TRUST_STORE_PROPERTY
The system property used to specify the location of the JSSE trust store. |
static java.lang.String |
STAT_TRACKER_ADD_ATTEMPTS
The name of the stat tracker that counts the number of attempted adds. |
static java.lang.String |
STAT_TRACKER_ADD_TIME
The name of the stat tracker that times add operations. |
static java.lang.String |
STAT_TRACKER_COMPARE_ATTEMPTS
The name of the stat tracker that counts the number of attempted compares. |
static java.lang.String |
STAT_TRACKER_COMPARE_TIME
The name of the stat tracker that times compare operations. |
static java.lang.String |
STAT_TRACKER_DELETE_ATTEMPTS
The name of the stat tracker that counts the number of attempted deletes. |
static java.lang.String |
STAT_TRACKER_DELETE_TIME
The name of the stat tracker that times delete operations. |
static java.lang.String |
STAT_TRACKER_DN_PERCENTAGES
The display name of the stat tracker that will be used to track the percentages of each type of DN used. |
static java.lang.String |
STAT_TRACKER_FILTER_PERCENTAGES
The display name of the stat tracker that will be used to track the percentages of each type of filter used. |
static java.lang.String |
STAT_TRACKER_MODIFY_ATTEMPTS
The name of the stat tracker that counts the number of attempted modifies. |
static java.lang.String |
STAT_TRACKER_MODIFY_RDN_ATTEMPTS
The name of the stat tracker that counts the number of attempted modify RDN operations. |
static java.lang.String |
STAT_TRACKER_MODIFY_RDN_TIME
The name of the stat tracker that times modify RDN operations. |
static java.lang.String |
STAT_TRACKER_MODIFY_TIME
The name of the stat tracker that times modify operations. |
static java.lang.String |
STAT_TRACKER_OPERATION_ATTEMPTS
The name of the stat tracker that counts the number of attempted operations. |
static java.lang.String |
STAT_TRACKER_OPERATION_ATTEMPTS_BY_CATEGORY
The name of the stat tracker that categorizes the attempted operations. |
static java.lang.String |
STAT_TRACKER_OPERATION_TIME
The name of the stat tracker that times attempted operations. |
static java.lang.String |
STAT_TRACKER_RESULT_CODES
The name of the stat tracker that categorizes the result codes received from the operations. |
static java.lang.String |
STAT_TRACKER_SEARCH_ATTEMPTS
The name of the stat tracker that counts the number of attempted searches. |
static java.lang.String |
STAT_TRACKER_SEARCH_TIME
The name of the stat tracker that times search operations. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
WeightedLDAPLoadJobClass()
Creates a new instance of this job thread. |
|
| Method Summary | |
|---|---|
void |
addDNToDelete(java.lang.String entryDN)
Adds the specified DN to the list of DNs to be deleted and/or renamed. |
void |
destroy()
Attempts to force this thread to exit by closing the connection to the directory server and setting it to null. |
int |
doAdd()
Performs an add operation in the directory. |
int |
doCompare()
Performs a compare operation in the directory. |
int |
doDelete()
Performs a delete operation in the directory. |
int |
doModify()
Performs a modify operation in the directory. |
int |
doModifyRDN()
Performs a modify RDN (i.e., rename) operation in the directory. |
int |
doSearch()
Performs a search operation in the directory. |
void |
finalizeClient()
Performs any per-client finalization that should be done for this job. |
java.lang.String |
getDNToDelete()
Retrieves the DN of an entry to be deleted or renamed. |
netscape.ldap.LDAPEntry |
getEntry()
Retrieves a randomly-generated entry that may be added to the directory. |
java.lang.String |
getEntryDN()
Retrieves the DN of an entry on which a compare or modify operation may be performed. |
java.lang.String |
getJobCategoryName()
Retrieves the name of the category in which this job class exists. |
java.lang.String |
getJobDescription()
Returns a description of this job that can be seen in the administrative interface. |
java.lang.String |
getJobName()
Returns the user-friendly name that is to be used for this job class in the administrative interface. |
ParameterList |
getParameterStubs()
Retrieve a parameter list that can be used to determine all of the customizable options that are available for this job. |
java.lang.String |
getRandomString(int length)
Retrieves a randomly-generated string with the specified number of characters. |
netscape.ldap.LDAPRebindAuth |
getRebindAuthentication(java.lang.String host,
int port)
Specifies the credentials that will be used to bind to the target server if a referral is encountered. |
java.lang.String |
getSearchFilter()
Retrieves a filter that may be used to perform a search. |
StatTracker[] |
getStatTrackers()
Retrieves the stat trackers that are maintained for this job thread. |
StatTracker[] |
getStatTrackerStubs(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval)
Retrieves the set of stat trackers that will be maintained by this job class. |
void |
initializeClient(java.lang.String clientID,
ParameterList parameters)
Performs client-level initialization for this job, including retrieving the values of all the parameters and reading the filter file (if one has been specified). |
void |
initializeThread(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval,
ParameterList parameters)
Initializes this job thread to be used to actually run the job on the client. |
boolean |
providesParameterTest()
Indicates whether this job class implements logic that makes it possible to test the validity of job parameters before scheduling the job for execution (e.g., to see if the server is reachable using the information provided). |
void |
runJob()
Perform the work of this job thread by establishing the connection(s) to the directory server and issuing all the appropriate queries. |
boolean |
testJobParameters(ParameterList parameters,
java.util.ArrayList outputMessages)
Provides a means of testing the provided job parameters to determine whether they are valid (e.g., to see if the server is reachable) before scheduling the job for execution. |
void |
validateJobInfo(int numClients,
int threadsPerClient,
int threadStartupDelay,
java.util.Date startTime,
java.util.Date stopTime,
int duration,
int collectionInterval,
ParameterList parameters)
Provides a means of validating the information used to schedule the job, including the scheduling information and list of parameters. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, 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 |
|---|
public static final char[] ALPHABET
public static final java.lang.String SSL_KEY_STORE_PROPERTY
public static final java.lang.String SSL_KEY_PASSWORD_PROPERTY
public static final java.lang.String SSL_TRUST_STORE_PROPERTY
public static final java.lang.String SSL_TRUST_PASSWORD_PROPERTY
public static final java.lang.String STAT_TRACKER_ADD_ATTEMPTS
public static final java.lang.String STAT_TRACKER_ADD_TIME
public static final java.lang.String STAT_TRACKER_COMPARE_ATTEMPTS
public static final java.lang.String STAT_TRACKER_COMPARE_TIME
public static final java.lang.String STAT_TRACKER_DELETE_ATTEMPTS
public static final java.lang.String STAT_TRACKER_DELETE_TIME
public static final java.lang.String STAT_TRACKER_MODIFY_ATTEMPTS
public static final java.lang.String STAT_TRACKER_MODIFY_TIME
public static final java.lang.String STAT_TRACKER_MODIFY_RDN_ATTEMPTS
public static final java.lang.String STAT_TRACKER_MODIFY_RDN_TIME
public static final java.lang.String STAT_TRACKER_OPERATION_ATTEMPTS
public static final java.lang.String STAT_TRACKER_OPERATION_ATTEMPTS_BY_CATEGORY
public static final java.lang.String STAT_TRACKER_OPERATION_TIME
public static final java.lang.String STAT_TRACKER_RESULT_CODES
public static final java.lang.String STAT_TRACKER_SEARCH_ATTEMPTS
public static final java.lang.String STAT_TRACKER_SEARCH_TIME
public static final java.lang.String STAT_TRACKER_DN_PERCENTAGES
public static final java.lang.String STAT_TRACKER_FILTER_PERCENTAGES
| Constructor Detail |
|---|
public WeightedLDAPLoadJobClass()
| Method Detail |
|---|
public java.lang.String getJobName()
getJobName in class JobClasspublic java.lang.String getJobDescription()
getJobDescription in class JobClasspublic java.lang.String getJobCategoryName()
getJobCategoryName in class JobClasspublic ParameterList getParameterStubs()
getParameterStubs in class JobClass
public StatTracker[] getStatTrackerStubs(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval)
getStatTrackerStubs in class JobClassclientID - The client ID that should be used for the
returned stat trackers.threadID - The thread ID that should be used for the
returned stat trackers.collectionInterval - The collection interval that should be used for
the returned stat trackers.
public StatTracker[] getStatTrackers()
getStatTrackers in class JobClass
public void validateJobInfo(int numClients,
int threadsPerClient,
int threadStartupDelay,
java.util.Date startTime,
java.util.Date stopTime,
int duration,
int collectionInterval,
ParameterList parameters)
throws InvalidValueException
validateJobInfo in class JobClassnumClients - The number of clients that should be used to
run the job.threadsPerClient - The number of threads that should be created on
each client to run the job.threadStartupDelay - The delay in milliseconds that should be used
when starting the client threads.startTime - The time that the job should start running.stopTime - The time that the job should stop running.duration - The maximum length of time in seconds that the
job should be allowed to run.collectionInterval - The collection interval that should be used
when gathering statistics for the job.parameters - The set of parameters provided to this job that
can be used to customize its behavior.
InvalidValueException - If the provided information is not
appropriate for running this job.public boolean providesParameterTest()
providesParameterTest in class JobClasstrue if this job provides a means of testing the job
parameters, or false if not.
public boolean testJobParameters(ParameterList parameters,
java.util.ArrayList outputMessages)
testJobParameters in class JobClassparameters - The job parameters to be tested.outputMessages - The lines of output that were generated as part of
the testing process. Each line of output should
be added to this list as a separate string, and
empty strings (but not null values)
are allowed to provide separation between
different messages. No formatting should be
provided for these messages, however, since they
may be displayed in either an HTML or plain text
interface.
true if the test completed successfully, or
false if not. Note that even if the test did not
complete successfully, the user will be presented with a warning
but will still be allowed to schedule the job using the provided
parameters. This is necessary because the parameters may still be
valid even if the server couldn't validate them at the time the
job was scheduled (e.g., if the server wasn't running or could not
be reached by the SLAMD server even though it could be by the
clients).
public void initializeClient(java.lang.String clientID,
ParameterList parameters)
throws UnableToRunException
initializeClient in class JobClassclientID - The ID assigned to the client that will be running the
job.parameters - The list of parameters defined for this job.
UnableToRunException - If the initialization fails for some reason.
public void initializeThread(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval,
ParameterList parameters)
throws UnableToRunException
initializeThread in class JobClassclientID - The client ID for this job thread.threadID - The thread ID for this job thread.collectionInterval - The length of time in seconds to use as the
statistics collection interval.parameters - The set of parameters provided to this job that
can be used to customize its behavior.
UnableToRunException - If a problem occurs that prevents the thread
from being able to run properly.public void runJob()
runJob in class JobClasspublic void finalizeClient()
finalizeClient in class JobClasspublic void destroy()
null.
destroy in class JobClasspublic int doAdd()
public int doCompare()
public int doDelete()
public int doModify()
public int doModifyRDN()
public int doSearch()
public netscape.ldap.LDAPEntry getEntry()
public java.lang.String getRandomString(int length)
length - The number of characters to include in the string.
public java.lang.String getEntryDN()
public void addDNToDelete(java.lang.String entryDN)
entryDN - The DN to be added to the list.public java.lang.String getDNToDelete()
null will be returned.public java.lang.String getSearchFilter()
public netscape.ldap.LDAPRebindAuth getRebindAuthentication(java.lang.String host,
int port)
getRebindAuthentication in interface netscape.ldap.LDAPRebindhost - The address of the directory server targeted by the referral.port - The port of the directory server targeted by the referral.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||