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 JMeterContext
threadContext
public transient String
threadName
public final static TestElement.Companion
Companion
public final static String
NAME
public final static String
GUI_CLASS
public final static String
ENABLED
public final static String
TEST_CLASS
public final static String
COMMENTS
-
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 void
addConfigElement(ConfigElement config)
String
getValue()
get the value for this object. void
setValue(String value)
set the value for this object. String
getDomain()
get the domain for this object. void
setDomain(String domain)
set the domain for this object. long
getExpires()
get the expiry time for the cookie long
getExpiresMillis()
get the expiry time for the cookie void
setExpires(long expires)
set the expiry time for the cookie boolean
getSecure()
get the secure for this object. void
setSecure(boolean secure)
set the secure for this object. String
getPath()
get the path for this object. void
setPath(String path)
set the path for this object. void
setPathSpecified(boolean b)
boolean
isPathSpecified()
void
setDomainSpecified(boolean b)
boolean
isDomainSpecified()
String
toString()
creates a string representation of this cookie int
getVersion()
void
setVersion(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
-
-
-
-