|
|||||||||
| 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.ISJobClass
public class ISJobClass
This class implements a SLAMD job class for benchmarking Identity Server. All of the configuration for this job class can be provided through parameters.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static int |
BUFFER_SIZE
The size of the buffer that will be used to read the response from the HTTP server. |
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_AUTHENTICATION_RESULTS
The display name for the authentication results stat tracker. |
static java.lang.String |
STAT_TRACKER_AUTHN_PERFORMED
The display name for the authentication attempts stat tracker. |
static java.lang.String |
STAT_TRACKER_AUTHN_TIME
The display name for the authentication time stat tracker. |
static java.lang.String |
STAT_TRACKER_AUTHORIZATION_RESULTS
The display name for the authorization results stat tracker. |
static java.lang.String |
STAT_TRACKER_AUTHZ_PERFORMED
The display name for the authorization attempts stat tracker. |
static java.lang.String |
STAT_TRACKER_AUTHZ_TIME
The display name for the authorization time stat tracker. |
static java.lang.String |
STAT_TRACKER_COMPLETE_TRANSACTIONS
The display name for the completed transactions stat tracker. |
static java.lang.String |
STAT_TRACKER_EXCEPTIONS_CAUGHT
The display name for the exceptions caught stat tracker. |
static java.lang.String |
STAT_TRACKER_LOGOUT_RESULTS
The display name for the logout results stat tracker. |
static java.lang.String |
STAT_TRACKER_LOGOUT_TIME
The display name for the logout time stat tracker. |
static java.lang.String |
STAT_TRACKER_LOGOUTS_PERFORMED
The display name for the logout attempts stat tracker. |
static java.lang.String |
STAT_TRACKER_PREAUTH_TIME
The display name for the preauth transaction time stat tracker. |
static java.lang.String |
STAT_TRACKER_TRANSACTION_TIME
The display name for the complete transaction time stat tracker. |
static java.lang.String |
STAT_TRACKER_UNAUTHD_PERFORMED
The display name for the unauthenticated URLs stat tracker. |
static java.lang.String |
STAT_TRACKER_UNAUTHD_RESULTS
The display name for the unauthenticated results stat tracker. |
static java.lang.String |
STAT_TRACKER_UNAUTHD_TIME
The display name for the unauthenticated time stat tracker. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ISJobClass()
Creates a new instance of this HTTP Client job class. |
|
| Method Summary | |
|---|---|
void |
buildAuthZArray()
Builds the array to use for authorization. |
void |
destroy()
Attempts to force this thread to exit. |
HttpResponse |
doRequest(ParsedURL thisRequest,
java.util.HashMap cookieState,
boolean authenticate)
Issues the request to the HTTP server and reads the response. |
void |
doWriteVerbose(java.lang.String message)
Writes the provided message if the client is running in verbose mode. |
java.lang.String |
getJobCategoryName()
Retrieves the name of the category in which this job class exists. |
java.lang.String |
getJobDescription()
Retrieves a description of the job performed by this job thread. |
java.lang.String |
getJobName()
Retrieves the name of the job performed by this job thread. |
java.lang.String[] |
getLoginInfo()
Retrieves an array containing the login ID and password that should be used to authenticate to the directory. |
ParameterList |
getParameterStubs()
Retrieve a parameter list that can be used to determine all of the customizable options that are available for this job. |
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. |
void |
initializeThreadUsers(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval,
ParameterList parameters)
Initializes this job thread to be used to actually run the agent job on the client. |
void |
initializeUsers(java.lang.String clientID,
ParameterList parameters)
Performs client-level initialization for this agent job, including retrieving the values of all the parameters and reading the filter file (if one has been specified). |
static void |
main(java.lang.String[] args)
Perform a basic test of this job class. |
ParsedURL |
parseURL(java.lang.String urlToParse)
Parses the provided URL. |
void |
runJob()
Perform the work of this job thread by establishing the connection(s) to the server and issuing all the appropriate queries. |
boolean |
startsWithIgnoreCase(byte[] bytesToMatch,
int lineStartPos,
int lineEndPos,
byte[] buffer)
Compares the contents of the provided byte array with the contents of the specified portion of the buffer read from the input string. |
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 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 int BUFFER_SIZE
public static final java.lang.String STAT_TRACKER_TRANSACTION_TIME
public static final java.lang.String STAT_TRACKER_UNAUTHD_TIME
public static final java.lang.String STAT_TRACKER_PREAUTH_TIME
public static final java.lang.String STAT_TRACKER_AUTHN_TIME
public static final java.lang.String STAT_TRACKER_AUTHZ_TIME
public static final java.lang.String STAT_TRACKER_LOGOUT_TIME
public static final java.lang.String STAT_TRACKER_COMPLETE_TRANSACTIONS
public static final java.lang.String STAT_TRACKER_UNAUTHD_PERFORMED
public static final java.lang.String STAT_TRACKER_AUTHN_PERFORMED
public static final java.lang.String STAT_TRACKER_AUTHZ_PERFORMED
public static final java.lang.String STAT_TRACKER_LOGOUTS_PERFORMED
public static final java.lang.String STAT_TRACKER_EXCEPTIONS_CAUGHT
public static final java.lang.String STAT_TRACKER_UNAUTHD_RESULTS
public static final java.lang.String STAT_TRACKER_AUTHENTICATION_RESULTS
public static final java.lang.String STAT_TRACKER_AUTHORIZATION_RESULTS
public static final java.lang.String STAT_TRACKER_LOGOUT_RESULTS
| Constructor Detail |
|---|
public ISJobClass()
| Method Detail |
|---|
public void doWriteVerbose(java.lang.String message)
message - The message to be written.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 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 during initialization.public void destroy()
destroy in class JobClass
public HttpResponse doRequest(ParsedURL thisRequest,
java.util.HashMap cookieState,
boolean authenticate)
throws java.io.IOException
thisRequest - The URL to include in the request.cookieState - The cookie information to include in the request.authenticate - Indicates whether to authenticate to the server.
java.io.IOException - If an I/O problem occurred while reading from or
writing to the server.
public boolean startsWithIgnoreCase(byte[] bytesToMatch,
int lineStartPos,
int lineEndPos,
byte[] buffer)
bytesToMatch - The byte array containing the bytes to compare
against the contents of the input buffer. This byte
array should contain an encoded string whose
characters are all uppercase.lineStartPos - The position in the input buffer at which the line
starts.lineEndPos - The position in the input buffer at which the line
ends.buffer - The buffer with the data to compare against the given
byte array.
true if the specified portion of the buffer starts
with the contents of the given byte array, or false
if not.
public ParsedURL parseURL(java.lang.String urlToParse)
throws UnableToRunException
urlToParse - The URL to be parsed.
UnableToRunException - If an error occurs while attempting to
parse the provided URL.public java.lang.String[] getLoginInfo()
public void buildAuthZArray()
public void initializeUsers(java.lang.String clientID,
ParameterList parameters)
throws UnableToRunException
clientID - 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 initializeThreadUsers(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval,
ParameterList parameters)
throws UnableToRunException
clientID - 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 while initializing
the thread information.public void runJob()
runJob in class JobClass
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - The command-line arguments provided to this program.
java.lang.Exception - If a problem occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||