Class Cookie
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.protocol.http.control.Cookie
- All Implemented Interfaces:
Serializable
,Cloneable
,Searchable
,org.apache.jmeter.testelement.TestElement
This class is a Cookie encapsulator.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion
-
Field Summary
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
Constructor Summary
ConstructorDescriptionCookie()
create the cookiecreate the cookieCookie
(String name, String value, String domain, String path, boolean secure, long expires, boolean hasPath, boolean hasDomain) create the cookieCookie
(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 TypeMethodDescriptionvoid
addConfigElement
(ConfigElement config) get the domain for this object.long
get the expiry time for the cookielong
get the expiry time for the cookiegetPath()
get the path for this object.boolean
get the secure for this object.getValue()
get the value for this object.int
boolean
boolean
void
set the domain for this object.void
setDomainSpecified
(boolean b) void
setExpires
(long expires) set the expiry time for the cookievoid
set the path for this object.void
setPathSpecified
(boolean b) void
setSecure
(boolean secure) set the secure for this object.void
set the value for this object.void
setVersion
(int version) toString()
creates a string representation of this cookieMethods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, 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, traverseProperty
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getPropertyOrNull, getProps, getSchema, getString, removed, removeProperty, set, set, set, set, set, set, set, set, set
-
Constructor Details
-
Cookie
public Cookie()create the cookie -
Cookie
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
public 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
public 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. version
-
-
Method Details
-
addConfigElement
-
getValue
get the value for this object.- Returns:
- the value of this cookie
-
setValue
set the value for this object.- Parameters:
value
- the value of this cookie
-
getDomain
get the domain for this object.- Returns:
- the domain for which this cookie is valid
-
setDomain
set the domain for this object.- Parameters:
domain
- the domain for which this cookie is valid
-
getExpires
public long getExpires()get the expiry time for the cookie- Returns:
- Expiry time in seconds since the Java epoch
-
getExpiresMillis
public long getExpiresMillis()get the expiry time for the cookie- Returns:
- Expiry time in milli-seconds since the Java epoch, i.e. same as System.currentTimeMillis()
-
setExpires
public void setExpires(long expires) set the expiry time for the cookie- Parameters:
expires
- - expiry time in seconds since the Java epoch
-
getSecure
public boolean getSecure()get the secure for this object.- Returns:
- flag whether this cookie should be treated as a 'secure' cookie
-
setSecure
public void setSecure(boolean secure) set the secure for this object.- Parameters:
secure
- flag whether this cookie should be treated as a 'secure' cookie
-
getPath
get the path for this object.- Returns:
- the path for which this cookie is valid
-
setPath
set the path for this object.- Parameters:
path
- the path for which this cookie is valid
-
setPathSpecified
public void setPathSpecified(boolean b) -
isPathSpecified
public boolean isPathSpecified() -
setDomainSpecified
public void setDomainSpecified(boolean b) -
isDomainSpecified
public boolean isDomainSpecified() -
toString
creates a string representation of this cookie -
getVersion
public int getVersion()- Returns:
- the version
-
setVersion
public void setVersion(int version) - Parameters:
version
- the version to set
-