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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • 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.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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 cookie
        value - value of the cookie
        domain - domain for which the cookie is valid
        path - path for which the cookie is valid
        secure - 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 cookie
        value - value of the cookie
        domain - domain for which the cookie is valid
        path - path for which the cookie is valid
        secure - flag whether cookie is to be handled as 'secure'
        expires - - this is in seconds
        hasPath - - 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 cookie
        value - value of the cookie
        domain - domain for which the cookie is valid
        path - path for which the cookie is valid
        secure - flag whether cookie is to be handled as 'secure'
        expires - - this is in seconds
        hasPath - - was the path explicitly specified?
        hasDomain - - was the domain explicitly specified?
        version - - cookie spec.
    • Method Detail

      • 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

      • 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
      • toString

         String toString()

        creates a string representation of this cookie

      • setVersion

         void setVersion(int version)
        Parameters:
        version - the version to set