Apache JMeter
1.9

org.apache.jmeter.protocol.http.control
Class AuthManager

java.lang.Object
  |
  +--org.apache.jmeter.testelement.AbstractTestElement
        |
        +--org.apache.jmeter.config.ConfigTestElement
              |
              +--org.apache.jmeter.protocol.http.control.AuthManager
All Implemented Interfaces:
Cloneable, ConfigElement, Serializable, TestElement

public class AuthManager
extends ConfigTestElement
implements ConfigElement, Serializable

This class provides a way to provide Authorization in jmeter requests. The format of the authorization file is: URL user pass where URL is an HTTP URL, user a username to use and pass the appropriate password.

Version:
0.9
Author:
Raphael Luta
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jmeter.config.ConfigTestElement
PASSWORD, USERNAME
 
Fields inherited from class org.apache.jmeter.testelement.AbstractTestElement
log
 
Fields inherited from interface org.apache.jmeter.testelement.TestElement
ENABLED, GUI_CLASS, NAME, TEST_CLASS
 
Constructor Summary
AuthManager()
          Default Constructor
 
Method Summary
 void addAuth()
          !
 void addAuth(Authorization auth)
          !
 void addConfigElement(ConfigElement config)
          !
 void addFile(String authFile)
          add authentication data from a file
 void clear()
          Clear the TestElement of all data.
 boolean expectsModification()
          !
 Authorization get(int i)
          return the record at index i
 Collection getAddList()
          !
 String getAuthHeaderForURL(URL url)
          !
 Authorization getAuthObjectAt(int row)
          !
 CollectionProperty getAuthObjects()
          !
 String getClassLabel()
          !
 Class getColumnClass(int column)
          !
 int getColumnCount()
          !
 String getColumnName(int column)
          !
 Class getGuiClass()
          !
 String getName()
          !
 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)
          update an authentication record
 void setName(String newName)
          !
 int size()
          return the number of records
 void uncompile()
          !
 
Methods inherited from class org.apache.jmeter.config.ConfigTestElement
addTestElement
 
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addProperty, clone, equals, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, isRunningVersion, logProperties, mergeIn, nextIsNull, propertyIterator, recoverRunningVersion, removeProperty, setProperty, setProperty, setRunningVersion, traverse, traverseCollection, traverseMap, traverseProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jmeter.config.ConfigElement
clone
 

Constructor Detail

AuthManager

public AuthManager()
Default Constructor

Method Detail

clear

public void clear()
Description copied from interface: TestElement
Clear the TestElement of all data.

Specified by:
clear in interface TestElement
Overrides:
clear in class AbstractTestElement

set

public void set(int index,
                String url,
                String user,
                String pass)
update an authentication record

Parameters:
index - !ToDo (Parameter description)
url - !ToDo (Parameter description)
user - !ToDo (Parameter description)
pass - !ToDo (Parameter description)

setName

public void setName(String newName)
!ToDo (Method description)

Overrides:
setName in class AbstractTestElement
Parameters:
newName - !ToDo (Parameter description)

getAuthObjects

public CollectionProperty getAuthObjects()
!ToDoo (Method description)

Returns:
!ToDo (Return description)

getColumnCount

public int getColumnCount()
!ToDoo (Method description)

Returns:
!ToDo (Return description)

getColumnName

public String getColumnName(int column)
!ToDoo (Method description)

Parameters:
column - !ToDo (Parameter description)
Returns:
!ToDo (Return description)

getColumnClass

public Class getColumnClass(int column)
!ToDoo (Method description)

Parameters:
column - !ToDo (Parameter description)
Returns:
!ToDo (Return description)

getAuthObjectAt

public Authorization getAuthObjectAt(int row)
!ToDoo (Method description)

Parameters:
row - !ToDo (Parameter description)
Returns:
!ToDo (Return description)

isEditable

public boolean isEditable()
!ToDoo (Method description)

Returns:
!ToDo (Return description)

getClassLabel

public String getClassLabel()
!ToDoo (Method description)

Returns:
!ToDo (Return description)

getGuiClass

public Class getGuiClass()
!ToDoo (Method description)

Returns:
!ToDo (Return description)

getAddList

public Collection getAddList()
!ToDoo (Method description)

Returns:
!ToDo (Return description)

get

public Authorization get(int i)
return the record at index i

Parameters:
i - !ToDo (Parameter description)
Returns:
!ToDo (Return description)

getAuthHeaderForURL

public String getAuthHeaderForURL(URL url)
!ToDoo (Method description)

Parameters:
url - !ToDo (Parameter description)
Returns:
!ToDo (Return description)

getName

public String getName()
!ToDoo (Method description)

Overrides:
getName in class AbstractTestElement
Returns:
!ToDo (Return description)

addConfigElement

public void addConfigElement(ConfigElement config)
!ToDo

Specified by:
addConfigElement in interface ConfigElement
Parameters:
config - !ToDo

addAuth

public void addAuth(Authorization auth)
!ToDo

Parameters:
auth - !ToDo

addAuth

public void addAuth()
!ToDo


expectsModification

public boolean expectsModification()
!ToDo (Method description)

Specified by:
expectsModification in interface ConfigElement
Returns:
!ToDo (Return description)

uncompile

public void uncompile()
!ToDo (Method description)


save

public void save(String authFile)
          throws IOException
save the authentication data to a file

Parameters:
authFile - !ToDo (Parameter description)
Throws:
IOException - !ToDo (Exception description)

addFile

public void addFile(String authFile)
             throws IOException
add authentication data from a file

Parameters:
authFile - !ToDo
Throws:
IOException - !ToDo (Exception description)

remove

public void remove(int index)
remove an authentication record

Parameters:
index - !ToDo (Parameter description)

size

public int size()
return the number of records

Returns:
!ToDo (Return description)

Apache JMeter
1.9

Copyright © 1998-2003 Apache Software Foundation. All Rights Reserved.