public class AuthManager
extends org.apache.jmeter.config.ConfigTestElement
implements org.apache.jmeter.testelement.TestStateListener, org.apache.jmeter.testelement.TestIterationListener, java.io.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
|
| 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(org.apache.jmeter.config.ConfigElement config) |
void |
addFile(java.lang.String authFile)
Add authentication data from a file.
|
void |
clear() |
boolean |
expectsModification() |
Authorization |
get(int i)
Return the record at index i
|
int |
getAuthCount()
Return the number of records.
|
Authorization |
getAuthForURL(java.net.URL url) |
java.lang.String |
getAuthHeaderForURL(java.net.URL url) |
Authorization |
getAuthObjectAt(int row) |
org.apache.jmeter.testelement.property.CollectionProperty |
getAuthObjects() |
boolean |
getClearEachIteration() |
java.lang.Class<?> |
getColumnClass(int column) |
int |
getColumnCount() |
java.lang.String |
getColumnName(int column) |
javax.security.auth.Subject |
getSubjectForUrl(java.net.URL url)
Get a
Subject for a given URL, if available |
boolean |
hasAuthForURL(java.net.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(java.lang.String authFile)
Save the authentication data to a file.
|
void |
set(int index,
java.lang.String url,
java.lang.String user,
java.lang.String pass,
java.lang.String domain,
java.lang.String realm,
AuthManager.Mechanism mechanism)
Update an authentication record.
|
void |
setClearEachIteration(boolean clear) |
void |
setupCredentials(Authorization auth,
java.net.URL url,
org.apache.http.client.protocol.HttpClientContext localContext,
org.apache.http.client.CredentialsProvider credentialsProvider,
java.lang.String localhost)
Configure credentials and auth scheme on client if an authorization is
|
void |
testEnded() |
void |
testEnded(java.lang.String host) |
void |
testIterationStart(org.apache.jmeter.engine.event.LoopIterationEvent event) |
void |
testStarted() |
void |
testStarted(java.lang.String host) |
addPropertiesValues, 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, traversePropertypublic 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 org.apache.jmeter.testelement.TestElementclear in class org.apache.jmeter.testelement.AbstractTestElementpublic void set(int index,
java.lang.String url,
java.lang.String user,
java.lang.String pass,
java.lang.String domain,
java.lang.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 org.apache.jmeter.testelement.property.CollectionProperty getAuthObjects()
public int getColumnCount()
public java.lang.String getColumnName(int column)
public java.lang.Class<?> getColumnClass(int column)
public Authorization getAuthObjectAt(int row)
public boolean isEditable()
public Authorization get(int i)
i - index of the record to getipublic java.lang.String getAuthHeaderForURL(java.net.URL url)
public Authorization getAuthForURL(java.net.URL url)
public boolean hasAuthForURL(java.net.URL url)
url - URL for which an authorization record should be
availabletrue if an authorization is setup for url,
false otherwisepublic javax.security.auth.Subject getSubjectForUrl(java.net.URL url)
Subject for a given URL, if availableurl - URL for which the subject was askedurl, null otherwisepublic void addConfigElement(org.apache.jmeter.config.ConfigElement config)
addConfigElement in interface org.apache.jmeter.config.ConfigElementaddConfigElement in class org.apache.jmeter.config.ConfigTestElementpublic void addAuth(Authorization newAuthorization)
newAuthorization - authorization to be addedpublic void addAuth()
public boolean expectsModification()
expectsModification in interface org.apache.jmeter.config.ConfigElementexpectsModification in class org.apache.jmeter.config.ConfigTestElementpublic void save(java.lang.String authFile)
throws java.io.IOException
authFile - path of the file to save the authentication data tojava.io.IOException - when writing to the file failspublic void addFile(java.lang.String authFile)
throws java.io.IOException
authFile - path to the file to read the authentication data fromjava.io.IOException - 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, java.net.URL url, org.apache.http.client.protocol.HttpClientContext localContext, org.apache.http.client.CredentialsProvider credentialsProvider, java.lang.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()
testStarted in interface org.apache.jmeter.testelement.TestStateListenerpublic void testEnded()
testEnded in interface org.apache.jmeter.testelement.TestStateListenerpublic void testStarted(java.lang.String host)
testStarted in interface org.apache.jmeter.testelement.TestStateListenerpublic void testEnded(java.lang.String host)
testEnded in interface org.apache.jmeter.testelement.TestStateListenerpublic void testIterationStart(org.apache.jmeter.engine.event.LoopIterationEvent event)
testIterationStart in interface org.apache.jmeter.testelement.TestIterationListenerCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.