Class Cookie
-
- All Implemented Interfaces:
-
java.io.Serializable,java.lang.Cloneable,org.apache.jmeter.gui.Searchable,org.apache.jmeter.testelement.TestElement
public class Cookie extends AbstractTestElement implements Serializable
This class is a Cookie encapsulator.
-
-
Field Summary
Fields Modifier and Type Field Description public transient JMeterContextthreadContextpublic transient StringthreadNamepublic final static TestElement.CompanionCompanionpublic final static StringNAMEpublic final static StringGUI_CLASSpublic final static StringENABLEDpublic final static StringTEST_CLASSpublic final static StringCOMMENTS
-
Constructor Summary
Constructors Constructor Description Cookie()create the cookie Cookie(String name, String value, String domain, String path, boolean secure, long expires)create the cookie Cookie(String name, String value, String domain, String path, boolean secure, long expires, boolean hasPath, boolean hasDomain)create the cookie Cookie(String name, String value, String domain, String path, boolean secure, long expires, boolean hasPath, boolean hasDomain, int version)Create a JMeter Cookie.
-
Method Summary
Modifier and Type Method Description voidaddConfigElement(ConfigElement config)StringgetValue()get the value for this object. voidsetValue(String value)set the value for this object. StringgetDomain()get the domain for this object. voidsetDomain(String domain)set the domain for this object. longgetExpires()get the expiry time for the cookie longgetExpiresMillis()get the expiry time for the cookie voidsetExpires(long expires)set the expiry time for the cookie booleangetSecure()get the secure for this object. voidsetSecure(boolean secure)set the secure for this object. StringgetPath()get the path for this object. voidsetPath(String path)set the path for this object. voidsetPathSpecified(boolean b)booleanisPathSpecified()voidsetDomainSpecified(boolean b)booleanisDomainSpecified()StringtoString()creates a string representation of this cookie intgetVersion()voidsetVersion(int version)-
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse -
Methods inherited from class org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProps, getSchema, getString, removed, set -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Cookie
Cookie()
create the cookie
-
Cookie
Cookie(String name, String value, String domain, String path, boolean secure, long expires)
create the cookie- Parameters:
name- name of the cookievalue- value of the cookiedomain- domain for which the cookie is validpath- path for which the cookie is validsecure- flag whether cookie is to be handled as 'secure'expires- - this is in seconds
-
Cookie
Cookie(String name, String value, String domain, String path, boolean secure, long expires, boolean hasPath, boolean hasDomain)
create the cookie- Parameters:
name- name of the cookievalue- value of the cookiedomain- domain for which the cookie is validpath- path for which the cookie is validsecure- flag whether cookie is to be handled as 'secure'expires- - this is in secondshasPath- - was the path explicitly specified?hasDomain- - was the domain explicitly specified?
-
Cookie
Cookie(String name, String value, String domain, String path, boolean secure, long expires, boolean hasPath, boolean hasDomain, int version)
Create a JMeter Cookie.- Parameters:
name- name of the cookievalue- value of the cookiedomain- domain for which the cookie is validpath- path for which the cookie is validsecure- flag whether cookie is to be handled as 'secure'expires- - this is in secondshasPath- - was the path explicitly specified?hasDomain- - was the domain explicitly specified?version- - cookie spec.
-
-
Method Detail
-
addConfigElement
void addConfigElement(ConfigElement config)
-
setValue
void setValue(String value)
set the value for this object.
- Parameters:
value- the value of this cookie
-
setDomain
void setDomain(String domain)
set the domain for this object.
- Parameters:
domain- the domain for which this cookie is valid
-
getExpires
long getExpires()
get the expiry time for the cookie
-
getExpiresMillis
long getExpiresMillis()
get the expiry time for the cookie
-
setExpires
void setExpires(long expires)
set the expiry time for the cookie
- Parameters:
expires- - expiry time in seconds since the Java epoch
-
getSecure
boolean getSecure()
get the secure for this object.
-
setSecure
void setSecure(boolean secure)
set the secure for this object.
- Parameters:
secure- flag whether this cookie should be treated as a 'secure' cookie
-
setPath
void setPath(String path)
set the path for this object.
- Parameters:
path- the path for which this cookie is valid
-
setPathSpecified
void setPathSpecified(boolean b)
-
isPathSpecified
boolean isPathSpecified()
-
setDomainSpecified
void setDomainSpecified(boolean b)
-
isDomainSpecified
boolean isDomainSpecified()
-
getVersion
int getVersion()
-
setVersion
void setVersion(int version)
- Parameters:
version- the version to set
-
-
-
-