public class AuthManager extends ConfigTestElement implements TestStateListener, TestIterationListener, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
AuthManager.Mechanism |
| Modifier and Type | Field and Description |
|---|---|
static int |
COL_DOMAIN |
static int |
COL_MECHANISM |
static int |
COL_PASSWORD |
static int |
COL_REALM |
static int |
COL_URL |
static int |
COL_USERNAME |
static boolean |
STRIP_PORT
Decides whether port should be omitted from SPN for kerberos spnego authentication
|
static boolean |
USE_CANONICAL_HOST_NAME
Decides whether port should be omitted from SPN for kerberos spnego authentication
|
PASSWORD, USERNAMECOMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS| Constructor and Description |
|---|
AuthManager()
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAuth() |
void |
addAuth(Authorization newAuthorization)
Add newAuthorization if it does not already exist
|
void |
addConfigElement(ConfigElement config)
Add a configuration element to this one.
|
void |
addFile(String authFile)
Add authentication data from a file.
|
void |
clear()
Clear the TestElement of all data.
|
boolean |
expectsModification()
If your config element expects to be modified in the process of a test
run, and you want those modifications to carry over from sample to sample
(as in a cookie manager - you want to save all cookies that get set
throughout the test), then return true for this method.
|
Authorization |
get(int i)
Return the record at index i
|
int |
getAuthCount()
Return the number of records.
|
Authorization |
getAuthForURL(URL url) |
String |
getAuthHeaderForURL(URL url) |
Authorization |
getAuthObjectAt(int row) |
CollectionProperty |
getAuthObjects() |
boolean |
getClearEachIteration() |
Class<?> |
getColumnClass(int column) |
int |
getColumnCount() |
String |
getColumnName(int column) |
boolean |
getControlledByThread() |
Subject |
getSubjectForUrl(URL url)
Get a
Subject for a given URL, if available |
boolean |
hasAuthForURL(URL url)
Tests whether an authorization record is available for a given URL
|
boolean |
isEditable() |
void |
remove(int index)
Remove an authentication record.
|
void |
save(String authFile)
Save the authentication data to a file.
|
void |
set(int index,
String url,
String user,
String pass,
String domain,
String realm,
AuthManager.Mechanism mechanism)
Update an authentication record.
|
void |
setClearEachIteration(boolean clear) |
void |
setControlledByThread(boolean control) |
void |
setupCredentials(Authorization auth,
URL url,
org.apache.http.client.protocol.HttpClientContext localContext,
org.apache.http.client.CredentialsProvider credentialsProvider,
String localhost)
Configure credentials and auth scheme on client if an authorization is
|
void |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(String host)
Called once for all threads after the end of a test.
|
void |
testIterationStart(LoopIterationEvent event)
Each time through a Thread Group's test script, an iteration event is
fired for each thread.
|
void |
testStarted()
Called just before the start of the test from the main engine thread.
|
void |
testStarted(String host)
Called just before the start of the test from the main engine thread.
|
addTestElementaddPropertiesValues, addProperty, addProperty, canRemove, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traversePropertyfinalize, getClass, notify, notifyAll, toString, wait, wait, waitcloneremovedpublic static final int COL_URL
public static final int COL_USERNAME
public static final int COL_PASSWORD
public static final int COL_DOMAIN
public static final int COL_REALM
public static final int COL_MECHANISM
public static final boolean STRIP_PORT
public static final boolean USE_CANONICAL_HOST_NAME
public void clear()
clear in interface TestElementclear in class AbstractTestElementpublic void set(int index,
String url,
String user,
String pass,
String domain,
String realm,
AuthManager.Mechanism mechanism)
index - index at which position the record should be seturl - url for which the authentication record should be useduser - name of the userpass - password of the userdomain - domain of the userrealm - realm of the sitemechanism - authentication AuthManager.Mechanism to usepublic CollectionProperty getAuthObjects()
public int getColumnCount()
public String getColumnName(int column)
public Class<?> getColumnClass(int column)
public Authorization getAuthObjectAt(int row)
public boolean isEditable()
public Authorization get(int i)
i - index of the record to getipublic Authorization getAuthForURL(URL url)
public boolean hasAuthForURL(URL url)
url - URL for which an authorization record should be
availabletrue if an authorization is setup for url,
false otherwisepublic Subject getSubjectForUrl(URL url)
Subject for a given URL, if availableurl - URL for which the subject was askedurl, null otherwisepublic void addConfigElement(ConfigElement config)
addConfigElement in interface ConfigElementaddConfigElement in class ConfigTestElementconfig - the element to be added to this ConfigElementpublic void addAuth(Authorization newAuthorization)
newAuthorization - authorization to be addedpublic void addAuth()
public boolean expectsModification()
expectsModification in interface ConfigElementexpectsModification in class ConfigTestElementpublic void save(String authFile) throws IOException
authFile - path of the file to save the authentication data toIOException - when writing to the file failspublic void addFile(String authFile) throws IOException
authFile - path to the file to read the authentication data fromIOException - when reading the data failspublic void remove(int index)
index - index of the authentication record to removepublic boolean getClearEachIteration()
public void setClearEachIteration(boolean clear)
public int getAuthCount()
public void setupCredentials(Authorization auth, URL url, org.apache.http.client.protocol.HttpClientContext localContext, org.apache.http.client.CredentialsProvider credentialsProvider, String localhost)
auth - information about the authorization to useurl - the URL for which the authorization info should be usedlocalContext - http client context which should be set upcredentialsProvider - provider which should be set uplocalhost - name of the workstation to be used for NTCredentialspublic void testStarted()
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
testStarted in interface TestStateListenerStandardJMeterEngine.run()public void testEnded()
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
testEnded in interface TestStateListenerStandardJMeterEngine.stopTest()public void testStarted(String host)
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
testStarted in interface TestStateListenerhost - name of hostStandardJMeterEngine.run()public void testEnded(String host)
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
testEnded in interface TestStateListenerhost - name of hostStandardJMeterEngine.stopTest()public void testIterationStart(LoopIterationEvent event)
testIterationStart in interface TestIterationListenerevent - the iteration eventpublic boolean getControlledByThread()
public void setControlledByThread(boolean control)
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.