|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.scripting.engine.Variable
com.sun.slamd.scripting.http.HTTPRequestVariable
This class defines a variable that can be used to encapsulate a request to send to an HTTP server. An HTTP request variable offers the following methods:
| Field Summary | |
static int |
ADD_PARAMETER_1_METHOD_NUMBER
The method number for the first "addParameter" method. |
static int |
ADD_PARAMETER_2_METHOD_NUMBER
The method number for the second "addParameter" method. |
static java.lang.String |
ADD_PARAMETER_METHOD_NAME
The name of the method that can be used to add a parameter value or set of values to this request. |
static int |
ASSIGN_1_METHOD_NUMBER
The method number for the first "assign" method. |
static int |
ASSIGN_2_METHOD_NUMBER
The method number for the second "assign" method. |
static java.lang.String |
ASSIGN_METHOD_NAME
The name of the method that can be used to initialize this request. |
static java.lang.String |
CLEAR_HEADERS_METHOD_NAME
The name of the method that can be used to remove all header information from this request. |
static int |
CLEAR_HEADERS_METHOD_NUMBER
The method number for the "clearHeaders" method. |
static java.lang.String |
GET_HEADER_METHOD_NAME
The name of the method that can be used to retrieve the value of a specified header from this request. |
static int |
GET_HEADER_METHOD_NUMBER
The method number for the "getHeader" method. |
static java.lang.String |
GET_HEADER_NAMES_METHOD_NAME
The name of the method that can be used to retrieve the names of the headers associated with this request. |
static int |
GET_HEADER_NAMES_METHOD_NUMBER
The method number for the "getHeaderNames" method. |
static java.lang.String |
GET_METHOD_METHOD_NAME
The name of the method that can be used to retrieve the request method for this request. |
static int |
GET_METHOD_METHOD_NUMBER
The method number for the "getMethod" method. |
static java.lang.String |
GET_PARAMETER_METHOD_NAME
The name of the method that can be used to retrieve the value of the specified parameter from this request. |
static int |
GET_PARAMETER_METHOD_NUMBER
The method number for the "getParameter" method. |
static java.lang.String |
GET_PARAMETER_NAMES_METHOD_NAME
The name of the method that can be used to retrieve the names of the parameters associated with this request. |
static int |
GET_PARAMETER_NAMES_METHOD_NUMBER
The method number for the "getParameterNames" method. |
static java.lang.String |
GET_PARAMETER_VALUES_METHOD_NAME
The name of the method that can be used to retrieve the set of values for the specified parameter from this request. |
static int |
GET_PARAMETER_VALUES_METHOD_NUMBER
The method number for the "getParameterValues" method. |
static java.lang.String |
GET_URL_METHOD_NAME
The name of the method that can be used to retrieve the URL associated with this request. |
static int |
GET_URL_METHOD_NUMBER
The method number for the "getURL" method. |
static Method[] |
HTTP_REQUEST_VARIABLE_METHODS
The set of methods associated with HTTP request variables. |
static java.lang.String |
HTTP_REQUEST_VARIABLE_TYPE
The name that will be used for the data type of HTTP request variables. |
static java.lang.String |
REMOVE_ALL_PARAMETERS_METHOD_NAME
The name of the method that can be used to remove all parameter information associated with this request. |
static int |
REMOVE_ALL_PARAMETERS_METHOD_NUMBER
The method number for the "removeAllParameters" method. |
static java.lang.String |
REMOVE_HEADER_METHOD_NAME
The name of the method that can be used to remove the specified header from this request. |
static int |
REMOVE_HEADER_METHOD_NUMBER
The method number for the "removeHeader" method. |
static int |
REMOVE_PARAMETER_1_METHOD_NUMBER
The method number for the first "removeParameter" method. |
static int |
REMOVE_PARAMETER_2_METHOD_NUMBER
The method number for the second "removeParameter" method. |
static java.lang.String |
REMOVE_PARAMETER_METHOD_NAME
The name of the method that can be used to remove the specified parameter or parameter value from this request. |
static int |
REPLACE_PARAMETER_1_METHOD_NUMBER
The method number for the first "replaceParameter" method. |
static int |
REPLACE_PARAMETER_2_METHOD_NUMBER
The method number for the second "replaceParameter" method. |
static java.lang.String |
REPLACE_PARAMETER_METHOD_NAME
The name of the method that can be used to replace the set of values for the specified parameter in this request. |
static java.lang.String |
SET_HEADER_METHOD_NAME
The name of the method that can be used to set the value of a header for this request. |
static int |
SET_HEADER_METHOD_NUMBER
The method number for the "setHeader" method. |
| Constructor Summary | |
HTTPRequestVariable()
Creates a new variable with no name, to be used only when creating a variable with Class.newInstance(), and only when
setName() is called after that to set the name. |
|
| Method Summary | |
void |
assign(Argument argument)
Assigns the value of the provided argument to this variable. |
Variable |
executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
Executes the specified method, using the provided variables as arguments to the method, and makes the return value available to the caller. |
int |
getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the method number for the method that has the specified name and argument types, or -1 if there is no such method. |
Method[] |
getMethods()
Retrieves a list of all methods defined for this variable. |
java.lang.String |
getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the return type for the method with the specified name and argument types. |
java.lang.String |
getValueAsString()
Retrieves a string representation of the value of this argument. |
java.lang.String |
getVariableTypeName()
Retrieves the name of the variable type for this variable. |
boolean |
hasMethod(java.lang.String methodName)
Indicates whether this variable type has a method with the specified name. |
| Methods inherited from class com.sun.slamd.scripting.engine.Variable |
getArgumentAsString, getArgumentType, getArgumentValue, getName, getStatTrackers, isValidIdentifier, setName, startStatTrackers, stopStatTrackers |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String HTTP_REQUEST_VARIABLE_TYPE
public static final java.lang.String ADD_PARAMETER_METHOD_NAME
public static final int ADD_PARAMETER_1_METHOD_NUMBER
public static final int ADD_PARAMETER_2_METHOD_NUMBER
public static final java.lang.String ASSIGN_METHOD_NAME
public static final int ASSIGN_1_METHOD_NUMBER
public static final int ASSIGN_2_METHOD_NUMBER
public static final java.lang.String CLEAR_HEADERS_METHOD_NAME
public static final int CLEAR_HEADERS_METHOD_NUMBER
public static final java.lang.String GET_HEADER_METHOD_NAME
public static final int GET_HEADER_METHOD_NUMBER
public static final java.lang.String GET_HEADER_NAMES_METHOD_NAME
public static final int GET_HEADER_NAMES_METHOD_NUMBER
public static final java.lang.String GET_METHOD_METHOD_NAME
public static final int GET_METHOD_METHOD_NUMBER
public static final java.lang.String GET_PARAMETER_METHOD_NAME
public static final int GET_PARAMETER_METHOD_NUMBER
public static final java.lang.String GET_PARAMETER_NAMES_METHOD_NAME
public static final int GET_PARAMETER_NAMES_METHOD_NUMBER
public static final java.lang.String GET_PARAMETER_VALUES_METHOD_NAME
public static final int GET_PARAMETER_VALUES_METHOD_NUMBER
public static final java.lang.String GET_URL_METHOD_NAME
public static final int GET_URL_METHOD_NUMBER
public static final java.lang.String REMOVE_ALL_PARAMETERS_METHOD_NAME
public static final int REMOVE_ALL_PARAMETERS_METHOD_NUMBER
public static final java.lang.String REMOVE_HEADER_METHOD_NAME
public static final int REMOVE_HEADER_METHOD_NUMBER
public static final java.lang.String REMOVE_PARAMETER_METHOD_NAME
public static final int REMOVE_PARAMETER_1_METHOD_NUMBER
public static final int REMOVE_PARAMETER_2_METHOD_NUMBER
public static final java.lang.String REPLACE_PARAMETER_METHOD_NAME
public static final int REPLACE_PARAMETER_1_METHOD_NUMBER
public static final int REPLACE_PARAMETER_2_METHOD_NUMBER
public static final java.lang.String SET_HEADER_METHOD_NAME
public static final int SET_HEADER_METHOD_NUMBER
public static final Method[] HTTP_REQUEST_VARIABLE_METHODS
| Constructor Detail |
public HTTPRequestVariable()
throws ScriptException
Class.newInstance(), and only when
setName() is called after that to set the name.
ScriptException - If a problem occurs while initializing the new
variable.| Method Detail |
public java.lang.String getVariableTypeName()
getVariableTypeName in class Variablepublic Method[] getMethods()
getMethods in class Variablepublic boolean hasMethod(java.lang.String methodName)
hasMethod in class VariablemethodName - The name of the method.
true if this variable has a method with the specified
name, or false if it does not.
public int getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
getMethodNumber in class VariablemethodName - The name of the method.argumentTypes - The list of argument types for the method.
public java.lang.String getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
getReturnTypeForMethod in class VariablemethodName - The name of the method.argumentTypes - The set of argument types for the method.
null if there is
no such method defined.
public Variable executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
throws ScriptException
executeMethod in class VariablelineNumber - The line number of the script in which the method
call occurs.methodNumber - The method number of the method to execute.arguments - The set of arguments to use for the method.
null if it
does not return a value.
ScriptException - If the specified method does not exist, or if a
problem occurs while attempting to execute it.
public void assign(Argument argument)
throws ScriptException
assign in class Variableargument - The argument whose value should be assigned to this
variable.
ScriptException - If a problem occurs while performing the
assignment.public java.lang.String getValueAsString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||