|
|||||||||
| 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.WeightedAuthRateJobClass
public class WeightedAuthRateJobClass
This class defines a SLAMD job that repeatedly performs authentications against an LDAP directory server. It will find the user's entry based on a login ID, attempt to bind as that user, and optionally verify whether that user is a member of a static group, dynamic group, or role. The query to find the user may be weighted to more accurately simulate production usage.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_LOG_ID_ATTR
The default attribute used as the login ID. |
static int |
MEMBERSHIP_TYPE_DYNAMIC
The value used to indicate that an attempt will be made to determine whether the user is a member of a dynamic group. |
static int |
MEMBERSHIP_TYPE_NONE
The value used to indicate that no membership determination will be made. |
static int |
MEMBERSHIP_TYPE_ROLE
The value used to indicate that an attempt will be made to determine whether the user is a member of a role. |
static int |
MEMBERSHIP_TYPE_STATIC
The value used to indicate that an attempt will be made to determine whether the user is a member of a static group. |
static java.lang.String[] |
NO_ATTRS
The set of attributes to retrieve if there aren't any attributes to retrieve. |
static java.lang.String |
ROLE_ATTR
The name of the LDAP attribute that contains the DNs of the roles to which a user belongs. |
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_ATTEMPTS_1
The name of the stat tracker that will be used to count the number of authentication attempts using login ID value 1. |
static java.lang.String |
STAT_TRACKER_AUTHENTICATION_ATTEMPTS_2
The name of the stat tracker that will be used to count the number of authentication attempts using login ID value 2. |
static java.lang.String |
STAT_TRACKER_AUTHENTICATION_ATTEMPTS_OVERALL
The name of the stat tracker that will be used to count the overall number of authentication attempts. |
static java.lang.String |
STAT_TRACKER_AUTHENTICATION_CATEGORIES
The categorized number of authentication attempts. |
static java.lang.String |
STAT_TRACKER_AUTHENTICATION_TIME_1
The name of the stat tracker that will be used to keep track of the time required to perform each authentication using login ID value 1. |
static java.lang.String |
STAT_TRACKER_AUTHENTICATION_TIME_2
The name of the stat tracker that will be used to keep track of the time required to perform each authentication using login ID value 2. |
static java.lang.String |
STAT_TRACKER_AUTHENTICATION_TIME_OVERALL
The name of the stat tracker that will be used to keep track of the overall time required to perform each authentication. |
static java.lang.String |
STAT_TRACKER_FAILED_AUTHENTICATIONS_1
The name of the stat tracker that will be used to count the number of failed authentications using login ID value 1. |
static java.lang.String |
STAT_TRACKER_FAILED_AUTHENTICATIONS_2
The name of the stat tracker that will be used to count the number of failed authentications using login ID value 2. |
static java.lang.String |
STAT_TRACKER_FAILED_AUTHENTICATIONS_OVERALL
The name of the stat tracker that will be used to count the overall number of failed authentications. |
static java.lang.String |
STAT_TRACKER_SUCCESSFUL_AUTHENTICATIONS_1
The name of the stat tracker that will be used to count the number of successful authentications using login ID value 1. |
static java.lang.String |
STAT_TRACKER_SUCCESSFUL_AUTHENTICATIONS_2
The name of the stat tracker that will be used to count the number of successful authentications using login ID value 2. |
static java.lang.String |
STAT_TRACKER_SUCCESSFUL_AUTHENTICATIONS_OVERALL
The name of the stat tracker that will be used to count the overall number of successful authentications. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
WeightedAuthRateJobClass()
Creates a new instance of this job thread. |
|
| Method Summary | |
|---|---|
void |
destroy()
Attempts to force this thread to exit by closing the connections to the directory server and setting them to null. |
void |
finalizeClient()
Performs any per-client finalization that should be done for this job. |
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()
Returns the set of parameters whose value may be specified by the end user. |
StatTracker[] |
getStatTrackers()
Retrieves the set of stat trackers that are maintained by this job class. |
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 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 class with the information that it will use when actually running the job. |
boolean |
isMember(netscape.ldap.LDAPEntry userEntry)
Determines whether the provided user is a member of the membership DN. |
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()
Performs the work of actually running the job. |
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 int MEMBERSHIP_TYPE_NONE
public static final int MEMBERSHIP_TYPE_STATIC
public static final int MEMBERSHIP_TYPE_DYNAMIC
public static final int MEMBERSHIP_TYPE_ROLE
public static final java.lang.String DEFAULT_LOG_ID_ATTR
public static final java.lang.String ROLE_ATTR
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_AUTHENTICATION_ATTEMPTS_OVERALL
public static final java.lang.String STAT_TRACKER_AUTHENTICATION_ATTEMPTS_1
public static final java.lang.String STAT_TRACKER_AUTHENTICATION_ATTEMPTS_2
public static final java.lang.String STAT_TRACKER_AUTHENTICATION_CATEGORIES
public static final java.lang.String STAT_TRACKER_AUTHENTICATION_TIME_OVERALL
public static final java.lang.String STAT_TRACKER_AUTHENTICATION_TIME_1
public static final java.lang.String STAT_TRACKER_AUTHENTICATION_TIME_2
public static final java.lang.String STAT_TRACKER_FAILED_AUTHENTICATIONS_OVERALL
public static final java.lang.String STAT_TRACKER_FAILED_AUTHENTICATIONS_1
public static final java.lang.String STAT_TRACKER_FAILED_AUTHENTICATIONS_2
public static final java.lang.String STAT_TRACKER_SUCCESSFUL_AUTHENTICATIONS_OVERALL
public static final java.lang.String STAT_TRACKER_SUCCESSFUL_AUTHENTICATIONS_1
public static final java.lang.String STAT_TRACKER_SUCCESSFUL_AUTHENTICATIONS_2
public static final java.lang.String[] NO_ATTRS
| Constructor Detail |
|---|
public WeightedAuthRateJobClass()
| 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 running this job.parameters - The set of parameters provided to this job that can be
used to customize its behavior.
UnableToRunException - If the client initialization could not be
completed successfully and the job is unable
to run.
public void initializeThread(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval,
ParameterList parameters)
throws UnableToRunException
initializeThread in class JobClassclientID - The thread ID for this thread.threadID - The thread ID for this thread.collectionInterval - The collection interval to use for gathering
statistics while processing the job.parameters - The st of parameters that contain the
information used to customize the way this job
is processed.
UnableToRunException - If a problem occurs that prevents the thread
from being able to run properly.public void runJob()
runJob in class JobClasspublic void destroy()
null.
destroy in class JobClasspublic void finalizeClient()
finalizeClient in class JobClasspublic boolean isMember(netscape.ldap.LDAPEntry userEntry)
userEntry - The user entry for which to make the determination.
true if it is determined that the user is a member,
or false if the membership could not be determined.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||