com.sun.slamd.example
Class CalendarInitialPageRateJobClass

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.sun.slamd.job.JobClass
          extended bycom.sun.slamd.example.CalendarInitialPageRateJobClass
All Implemented Interfaces:
java.lang.Runnable

public class CalendarInitialPageRateJobClass
extends JobClass

This class defines a SLAMD job that interacts with the Sun ONE Calendar Express. It does so by performing the following operations:

  1. Retrieve the login page.
  2. Submit the login form containing the user ID and password.
  3. Read and follow a redirect (containing a session cookie) to a page containing a frameset.
  4. Retrieve the page contained at the top of the frameset.
  5. Retrieve a page contained at the bottom of the frameset.


Field Summary
static java.lang.String EOL
          The end-of-line character that will be used for HTTP requests.
static java.lang.String GENERIC_POST_DATA
          The remaining string that will be included in the HTTP POST in addition to the user ID and password.
static java.lang.String HTTP_PARAM_USER_ID
          The name of the HTTP request parameter that specifies the user ID of the user that is authenticating.
static java.lang.String HTTP_PARAM_USER_PW
          The name of the HTTP request parameter that specifies the password of the user that is authenticating.
static java.lang.String LOGIN_FORM_SUBMIT_FILE
          The location to which the login form should be POSTed.
static java.lang.String STAT_TRACKER_AUTH_ATTEMPTS
          The display name of the stat tracker that is used to count the number of authentication attempts.
static java.lang.String STAT_TRACKER_AUTH_TIME
          The display name of the stat tracker that is used to determine the time required to perform an authentication.
static java.lang.String STAT_TRACKER_BOTTOM_FRAME_GET_TIME
          The display name of the stat tracker that is used to determine how much time was required to retrieve the contents of the bottom frame after a successful authentication.
static java.lang.String STAT_TRACKER_FAILURE_REASONS
          The display name of the stat tracker that is used to categorize the reasons for failed authentications.
static java.lang.String STAT_TRACKER_FAILURES
          The display name of the stat tracker that is used to count the number of failed authentications.
static java.lang.String STAT_TRACKER_LOGIN_PAGE_TIME
          The display name of the stat tracker that is used to determine how much time was requried to retrieve the login page.
static java.lang.String STAT_TRACKER_LOGIN_POST_TIME
          The display name of the stat tracker that is used to determine how much time was requried to retrieve a response after posting the login form.
static java.lang.String STAT_TRACKER_SUCCESSES
          The display name of the stat tracker that is used to count the number of successful authentications.
static java.lang.String STAT_TRACKER_TOP_FRAME_GET_TIME
          The display name of the stat tracker that is used to determine how much time was required to retrieve the contents of the top frame after a successful authentication.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CalendarInitialPageRateJobClass()
          The default constructor used to create a new instance of the job class.
 
Method Summary
 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.
 ParameterList getParameterStubs()
          Retrieve a parameter list that can be used to determine all of the customizeable 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.
 java.lang.String getUserID()
          Chooses a user ID based on the criteria provided in the job parameters.
 void initializeClient(java.lang.String clientID, ParameterList parameters)
          Performs initialization for this job on each client immediately before each thread is created to actually run the job.
 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 runJob()
          Perform the work of this job thread by executing the specified command.
 
Methods inherited from class com.sun.slamd.job.JobClass
destroy, enableRealTimeStats, finalizeClient, finalizeJob, finalizeThread, getActiveThreadCount, getClientID, getClientNumber, getClientSideJob, getClientSideParameterStubs, getCollectionInterval, getJobID, getScheduledDuration, getShouldStopTime, getStatReporter, getThreadID, getThreadNumber, indicateCompletedWithErrors, indicateStoppedDueToError, initializeJob, initializeJobThread, isDeprecated, isRunning, logMessage, overrideCollectionInterval, overrideNumClients, overrideThreadsPerClient, providesParameterTest, run, setClientNumber, setClientSideJob, setThreadNumber, shouldStop, stackTraceToString, startJob, stopAndWait, stopJob, stopRequested, testJobParameters, validateJobInfo, writeVerbose
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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

EOL

public static final java.lang.String EOL
The end-of-line character that will be used for HTTP requests.

See Also:
Constant Field Values

HTTP_PARAM_USER_ID

public static final java.lang.String HTTP_PARAM_USER_ID
The name of the HTTP request parameter that specifies the user ID of the user that is authenticating.

See Also:
Constant Field Values

HTTP_PARAM_USER_PW

public static final java.lang.String HTTP_PARAM_USER_PW
The name of the HTTP request parameter that specifies the password of the user that is authenticating.

See Also:
Constant Field Values

GENERIC_POST_DATA

public static final java.lang.String GENERIC_POST_DATA
The remaining string that will be included in the HTTP POST in addition to the user ID and password.

See Also:
Constant Field Values

LOGIN_FORM_SUBMIT_FILE

public static final java.lang.String LOGIN_FORM_SUBMIT_FILE
The location to which the login form should be POSTed.

See Also:
Constant Field Values

STAT_TRACKER_AUTH_ATTEMPTS

public static final java.lang.String STAT_TRACKER_AUTH_ATTEMPTS
The display name of the stat tracker that is used to count the number of authentication attempts.

See Also:
Constant Field Values

STAT_TRACKER_AUTH_TIME

public static final java.lang.String STAT_TRACKER_AUTH_TIME
The display name of the stat tracker that is used to determine the time required to perform an authentication.

See Also:
Constant Field Values

STAT_TRACKER_LOGIN_PAGE_TIME

public static final java.lang.String STAT_TRACKER_LOGIN_PAGE_TIME
The display name of the stat tracker that is used to determine how much time was requried to retrieve the login page.

See Also:
Constant Field Values

STAT_TRACKER_LOGIN_POST_TIME

public static final java.lang.String STAT_TRACKER_LOGIN_POST_TIME
The display name of the stat tracker that is used to determine how much time was requried to retrieve a response after posting the login form.

See Also:
Constant Field Values

STAT_TRACKER_TOP_FRAME_GET_TIME

public static final java.lang.String STAT_TRACKER_TOP_FRAME_GET_TIME
The display name of the stat tracker that is used to determine how much time was required to retrieve the contents of the top frame after a successful authentication.

See Also:
Constant Field Values

STAT_TRACKER_BOTTOM_FRAME_GET_TIME

public static final java.lang.String STAT_TRACKER_BOTTOM_FRAME_GET_TIME
The display name of the stat tracker that is used to determine how much time was required to retrieve the contents of the bottom frame after a successful authentication.

See Also:
Constant Field Values

STAT_TRACKER_SUCCESSES

public static final java.lang.String STAT_TRACKER_SUCCESSES
The display name of the stat tracker that is used to count the number of successful authentications.

See Also:
Constant Field Values

STAT_TRACKER_FAILURES

public static final java.lang.String STAT_TRACKER_FAILURES
The display name of the stat tracker that is used to count the number of failed authentications.

See Also:
Constant Field Values

STAT_TRACKER_FAILURE_REASONS

public static final java.lang.String STAT_TRACKER_FAILURE_REASONS
The display name of the stat tracker that is used to categorize the reasons for failed authentications.

See Also:
Constant Field Values
Constructor Detail

CalendarInitialPageRateJobClass

public CalendarInitialPageRateJobClass()
The default constructor used to create a new instance of the job class. The only thing it should do is to invoke the superclass constructor. All other initialization should be performed in the initialize method.

Method Detail

getJobName

public java.lang.String getJobName()
Retrieves the name of the job performed by this job thread.

Specified by:
getJobName in class JobClass
Returns:
The name of the job performed by this job thread.

getJobDescription

public java.lang.String getJobDescription()
Retrieves a description of the job performed by this job thread.

Specified by:
getJobDescription in class JobClass
Returns:
A description of the job performed by this job thread.

getJobCategoryName

public java.lang.String getJobCategoryName()
Retrieves the name of the category in which this job class exists. This is used to help arrange the job classes in the administrative interface.

Overrides:
getJobCategoryName in class JobClass
Returns:
The name of the category in which this job class exists.

getParameterStubs

public ParameterList getParameterStubs()
Retrieve a parameter list that can be used to determine all of the customizeable options that are available for this job.

Specified by:
getParameterStubs in class JobClass
Returns:
A parameter list that can be used to determine all of the customizeable options that are available for this job.

getStatTrackerStubs

public 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. The stat trackers returned by this method do not have to actually contain any statistics -- the display name and stat tracker class should be the only information that callers of this method should rely upon. Note that this list can be different from the list of statistics actually collected by the job in some cases (e.g., if the job may not return all the stat trackers it advertises in all cases, or if the job may return stat trackers that it did not advertise), but it is a possibility that only the stat trackers returned by this method will be accessible for some features in the SLAMD server.

Specified by:
getStatTrackerStubs in class JobClass
Parameters:
clientID - 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.
Returns:
The set of stat trackers that will be maintained by this job class.

getStatTrackers

public StatTracker[] getStatTrackers()
Retrieves the stat trackers that are maintained for this job thread.

Specified by:
getStatTrackers in class JobClass
Returns:
The stat trackers that are maintained for this job thread.

initializeClient

public void initializeClient(java.lang.String clientID,
                             ParameterList parameters)
                      throws UnableToRunException
Performs initialization for this job on each client immediately before each thread is created to actually run the job.

Overrides:
initializeClient in class JobClass
Parameters:
clientID - The ID assigned to the client running this job.
parameters - The set of parameters provided to this job that can be used to customize its behavior.
Throws:
UnableToRunException - If the client initialization could not be completed successfully and the job is unable to run.

initializeThread

public void initializeThread(java.lang.String clientID,
                             java.lang.String threadID,
                             int collectionInterval,
                             ParameterList parameters)
                      throws UnableToRunException
Initializes this job thread to be used to actually run the job on the client. The provided parameter list should be processed to customize the behavior of this job thread, and any other initialization that needs to be done in order for the job to run should be performed here as well.

Specified by:
initializeThread in class JobClass
Parameters:
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.
Throws:
UnableToRunException - If a problem occurs that prevents the thread from being able to run properly.

runJob

public void runJob()
Perform the work of this job thread by executing the specified command.

Specified by:
runJob in class JobClass

getUserID

public java.lang.String getUserID()
Chooses a user ID based on the criteria provided in the job parameters.

Returns:
The user ID that should be used for this attempt.