|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.chemistry.opencmis.client.bindings.spi.cookies.CmisHttpCookie
public final class CmisHttpCookie
This class represents a http cookie, which indicates the status information between the client agent side and the server side. According to RFC, there are 3 http cookie specifications. This class is compatible with all the three forms. HttpCookie class can accept all these 3 forms of syntax.
Constructor Summary | |
---|---|
CmisHttpCookie(java.lang.String name,
java.lang.String value)
Initializes a cookie with the specified name and value. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Answers a copy of this object. |
static boolean |
domainMatches(java.lang.String domain,
java.lang.String host)
A utility method used to check whether the host name is in a domain or not. |
boolean |
equals(java.lang.Object obj)
Answers whether two cookies are equal. |
java.lang.String |
getComment()
Answers the value of comment attribute(specified in RFC 2965) of this cookie. |
java.lang.String |
getCommentURL()
Answers the value of commentURL attribute(specified in RFC 2965) of this cookie. |
boolean |
getDiscard()
Answers the value of discard attribute(specified in RFC 2965) of this cookie. |
java.lang.String |
getDomain()
Answers the domain name for this cookie in the format specified in RFC 2965 |
long |
getMaxAge()
Returns the Max-Age value as specified in RFC 2965 of this cookie. |
java.lang.String |
getName()
Answers the name for this cookie. |
java.lang.String |
getPath()
Answers the path part of a request URL to which this cookie is returned. |
java.lang.String |
getPortlist()
Answers the value of port attribute(specified in RFC 2965) of this cookie. |
boolean |
getSecure()
Answers true if the browser only sends cookies over a secure protocol. |
java.lang.String |
getValue()
Answers the value of this cookie. |
int |
getVersion()
Get the version of this cookie |
boolean |
hasExpired()
Answers whether the cookie has expired. |
int |
hashCode()
Answers hash code of this http cookie. |
static java.util.List<CmisHttpCookie> |
parse(java.lang.String header)
Constructs a cookie from a string. |
void |
setComment(java.lang.String purpose)
Set the value of comment attribute(specified in RFC 2965) of this cookie. |
void |
setCommentURL(java.lang.String purpose)
Set the value of commentURL attribute(specified in RFC 2965) of this cookie. |
void |
setDiscard(boolean discard)
Set the value of discard attribute(specified in RFC 2965) of this cookie. |
void |
setDomain(java.lang.String pattern)
Set the domain value for this cookie. |
void |
setMaxAge(long expiry)
Sets the Max-Age value as specified in RFC 2965 of this cookie to expire. |
void |
setPath(java.lang.String path)
Set the path to which this cookie is returned. |
void |
setPortlist(java.lang.String ports)
Set the value of port attribute(specified in RFC 2965) of this cookie. |
void |
setSecure(boolean flag)
Tells the browser whether the cookies should be sent to server through secure protocols. |
void |
setValue(java.lang.String newValue)
Sets the value for this cookie after it has been instantiated. |
void |
setVersion(int v)
Sets the version of the cookie. |
java.lang.String |
toString()
Returns a string to represent the cookie. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CmisHttpCookie(java.lang.String name, java.lang.String value)
name
- - the specific name of the cookievalue
- - the specific value of the cookie
java.lang.IllegalArgumentException
- - if the name contains not-allowed or reserved characters
java.lang.NullPointerException
- if the value of name is nullMethod Detail |
---|
public static boolean domainMatches(java.lang.String domain, java.lang.String host)
domain
- the domain to be checked againsthost
- the host to be checked
public static java.util.List<CmisHttpCookie> parse(java.lang.String header)
header
- a set-cookie or set-cookie2 header.
java.lang.IllegalArgumentException
- if the string does not comply with cookie specification, or
the cookie name contains illegal characters, or reserved
tokens of cookie specification appears
java.lang.NullPointerException
- if header is nullpublic java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to be compared.
public java.lang.String getComment()
public java.lang.String getCommentURL()
public boolean getDiscard()
public java.lang.String getDomain()
public long getMaxAge()
public java.lang.String getName()
public java.lang.String getPath()
public java.lang.String getPortlist()
public boolean getSecure()
public java.lang.String getValue()
public int getVersion()
public boolean hasExpired()
public int hashCode()
hashCode
in class java.lang.Object
public void setComment(java.lang.String purpose)
purpose
- the comment value to be setpublic void setCommentURL(java.lang.String purpose)
purpose
- the value of commentURL attribute to be setpublic void setDiscard(boolean discard)
discard
- the value for discard attributepublic void setDomain(java.lang.String pattern)
pattern
- the domain patternpublic void setMaxAge(long expiry)
expiry
- the value used to set the Max-Age value of this cookiepublic void setPath(java.lang.String path)
path
- the path to which this cookie is returnedpublic void setPortlist(java.lang.String ports)
ports
- the value for port attributepublic void setSecure(boolean flag)
flag
- tells browser to send cookie to server only through secure
protocol if flag is truepublic void setValue(java.lang.String newValue)
newValue
- the value for this cookiepublic void setVersion(int v)
v
- 0 or 1 as stated above
java.lang.IllegalArgumentException
- if v is neither 0 nor 1public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |