Class Overview
HTTP "magic-cookie" represents a piece of state information
that the HTTP agent and the target server can exchange to maintain
a session as specified by RFC2965.
Summary
Public Methods |
Object
|
clone()
Creates and returns a copy of this Object .
|
String
|
getCommentURL()
Returns null.
|
int[]
|
getPorts()
Returns null.
|
boolean
|
isExpired(Date date)
Returns true if this cookie has expired.
|
boolean
|
isPersistent()
Returns false if the cookie should be discarded at the end
of the "session"; true otherwise.
|
void
|
setCommentURL(String commentURL)
If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described by the information at this URL.
|
void
|
setDiscard(boolean discard)
Set the Discard attribute.
|
void
|
setPorts(int[] ports)
Sets the Port attribute.
|
[Expand]
Inherited Methods |
From class org.apache.http.impl.cookie.BasicClientCookie
|
From class java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Called before the object's memory is reclaimed by the VM.
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
From interface org.apache.http.cookie.ClientCookie
|
From interface org.apache.http.cookie.Cookie
abstract
String
|
getComment()
Returns the comment describing the purpose of this cookie, or
null if no such comment has been defined.
|
abstract
String
|
getCommentURL()
If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described by the information at this URL.
|
abstract
String
|
getDomain()
Returns domain attribute of the cookie.
|
abstract
Date
|
getExpiryDate()
Returns the expiration Date of the cookie, or null
if none exists.
|
abstract
String
|
getName()
Returns the name.
|
abstract
String
|
getPath()
Returns the path attribute of the cookie
|
abstract
int[]
|
getPorts()
Get the Port attribute.
|
abstract
String
|
getValue()
Returns the value.
|
abstract
int
|
getVersion()
Returns the version of the cookie specification to which this
cookie conforms.
|
abstract
boolean
|
isExpired(Date date)
Returns true if this cookie has expired.
|
abstract
boolean
|
isPersistent()
Returns false if the cookie should be discarded at the end
of the "session"; true otherwise.
|
abstract
boolean
|
isSecure()
Indicates whether this cookie requires a secure connection.
|
|
From interface org.apache.http.cookie.SetCookie
abstract
void
|
setComment(String comment)
If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described using this comment.
|
abstract
void
|
setDomain(String domain)
Sets the domain attribute.
|
abstract
void
|
setExpiryDate(Date expiryDate)
Sets expiration date.
|
abstract
void
|
setPath(String path)
Sets the path attribute.
|
abstract
void
|
setSecure(boolean secure)
Sets the secure attribute of the cookie.
|
abstract
void
|
setValue(String value)
|
abstract
void
|
setVersion(int version)
Sets the version of the cookie specification to which this
cookie conforms.
|
|
From interface org.apache.http.cookie.SetCookie2
abstract
void
|
setCommentURL(String commentURL)
If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described by the information at this URL.
|
abstract
void
|
setDiscard(boolean discard)
Set the Discard attribute.
|
abstract
void
|
setPorts(int[] ports)
Sets the Port attribute.
|
|
Public Constructors
public
BasicClientCookie2
(String name, String value)
Default Constructor taking a name and a value. The value may be null.
Parameters
name
| The name. |
value
| The value.
|
Public Methods
public
Object
clone
()
Creates and returns a copy of this Object
. The default
implementation returns a so-called "shallow" copy: It creates a new
instance of the same class and then copies the field values (including
object references) from this instance to the new instance. A "deep" copy,
in contrast, would also recursively clone nested objects. A subclass that
needs to implement this kind of cloning should call super.clone()
to create the new instance and then create deep copies of the nested,
mutable objects.
public
String
getCommentURL
()
Returns null. Cookies prior to RFC2965 do not set this attribute
public
int[]
getPorts
()
Returns null. Cookies prior to RFC2965 do not set this attribute
public
boolean
isExpired
(Date date)
Returns true if this cookie has expired.
Returns
- true if the cookie has expired.
public
boolean
isPersistent
()
Returns false if the cookie should be discarded at the end
of the "session"; true otherwise.
Returns
- false if the cookie should be discarded at the end
of the "session"; true otherwise
public
void
setCommentURL
(String commentURL)
If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described by the information at this URL.
public
void
setDiscard
(boolean discard)
Set the Discard attribute.
Note: Discard attribute overrides Max-age.
public
void
setPorts
(int[] ports)
Sets the Port attribute. It restricts the ports to which a cookie
may be returned in a Cookie request header.