|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CookieSpec
Defines the cookie management specification.
Cookie management specification must define
Field Summary | |
---|---|
static java.lang.String |
PATH_DELIM
Path delimiter |
static char |
PATH_DELIM_CHAR
Path delimiting charachter |
Method Summary | |
---|---|
boolean |
domainMatch(java.lang.String host,
java.lang.String domain)
Performs domain-match as defined by the cookie specification. |
java.lang.String |
formatCookie(Cookie cookie)
Create a "Cookie" header value for an array of cookies. |
Header |
formatCookieHeader(Cookie cookie)
Create a "Cookie" Header for single Cookie. |
Header |
formatCookieHeader(Cookie[] cookies)
Create a "Cookie" Header for an array of Cookies. |
java.lang.String |
formatCookies(Cookie[] cookies)
Create a "Cookie" header value for an array of cookies. |
java.util.Collection<java.text.SimpleDateFormat> |
getValidDateFormats()
Returns the Collection of date patterns used for parsing. |
boolean |
match(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Cookie cookie)
Determines if a Cookie matches a location. |
Cookie[] |
match(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Cookie[] cookies)
Determines which of an array of Cookies matches a location. |
Cookie[] |
parse(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Header header)
Parse the "Set-Cookie" Header into an array of Cookies. |
Cookie[] |
parse(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
java.lang.String header)
Parse the "Set-Cookie" header value into Cookie array. |
Cookie[] |
parse(java.net.URI uri,
Header header)
Parse the "Set-Cookie" header value into Cookie array. |
Cookie[] |
parse(java.net.URI uri,
java.lang.String header)
Parse the "Set-Cookie" header value into Cookie array. |
void |
parseAttribute(NameValuePair attribute,
Cookie cookie)
Parse the cookie attribute and update the corresponsing Cookie properties. |
boolean |
pathMatch(java.lang.String path,
java.lang.String topmostPath)
Performs path-match as defined by the cookie specification. |
void |
setValidDateFormats(java.util.Collection<java.text.SimpleDateFormat> datepatterns)
Sets the Collection of date patterns used for parsing. |
void |
validate(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Cookie cookie)
Validate the cookie according to validation rules defined by the cookie specification. |
Field Detail |
---|
static final java.lang.String PATH_DELIM
"/"
static final char PATH_DELIM_CHAR
Method Detail |
---|
Cookie[] parse(java.net.URI uri, java.lang.String header) throws MalformedCookieException, java.lang.IllegalArgumentException
This method will not perform the validation of the resultant
Cookie
s
uri
- the uri that sent the Set-Cookie headerheader
- the Set-Cookie received from the server
validate(String, int, String, boolean, Cookie)
MalformedCookieException
- if an exception occurs during parsing
java.lang.IllegalArgumentException
- if an input parameter is illegalCookie[] parse(java.net.URI uri, Header header) throws MalformedCookieException, java.lang.IllegalArgumentException
This method will not perform the validation of the resultant
Cookie
s
uri
- the uri that sent the Set-Cookie headerheader
- the Set-Cookie received from the server
validate(String, int, String, boolean, Cookie)
MalformedCookieException
- if an exception occurs during parsing
java.lang.IllegalArgumentException
- if an input parameter is illegalCookie[] parse(java.lang.String host, int port, java.lang.String path, boolean secure, java.lang.String header) throws MalformedCookieException, java.lang.IllegalArgumentException
This method will not perform the validation of the resultant
Cookie
s
host
- the host which sent the Set-Cookie headerport
- the port which sent the Set-Cookie headerpath
- the path which sent the Set-Cookie headersecure
- true when the Set-Cookie header was received
over secure conectionheader
- the Set-Cookie received from the server
validate(String, int, String, boolean, Cookie)
MalformedCookieException
- if an exception occurs during parsing
java.lang.IllegalArgumentException
- if an input parameter is illegalCookie[] parse(java.lang.String host, int port, java.lang.String path, boolean secure, Header header) throws MalformedCookieException, java.lang.IllegalArgumentException
This method will not perform the validation of the resultant
Cookie
s
host
- the host which sent the Set-Cookie headerport
- the port which sent the Set-Cookie headerpath
- the path which sent the Set-Cookie headersecure
- true when the Set-Cookie header was received
over secure conectionheader
- the Set-Cookie received from the server
validate(String, int, String, boolean, Cookie)
MalformedCookieException
- if an exception occurs during parsing
java.lang.IllegalArgumentException
- if an input parameter is illegalvoid parseAttribute(NameValuePair attribute, Cookie cookie) throws MalformedCookieException, java.lang.IllegalArgumentException
attribute
- cookie attribute from the Set-Cookiecookie
- the to be updated
MalformedCookieException
- if an exception occurs during parsing
java.lang.IllegalArgumentException
- if an input parameter is illegalvoid validate(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie) throws MalformedCookieException, java.lang.IllegalArgumentException
host
- the host from which the Cookie
was receivedport
- the port from which the Cookie
was receivedpath
- the path from which the Cookie
was receivedsecure
- true when the Cookie
was received using a secure
connectioncookie
- the Cookie to validate
MalformedCookieException
- if the cookie is invalid
java.lang.IllegalArgumentException
- if an input parameter is illegalvoid setValidDateFormats(java.util.Collection<java.text.SimpleDateFormat> datepatterns)
Collection
of date patterns used for parsing. The String
patterns must be compatible with SimpleDateFormat
.
datepatterns
- collection of date patternsjava.util.Collection<java.text.SimpleDateFormat> getValidDateFormats()
Collection
of date patterns used for parsing. The
String patterns are compatible with the
SimpleDateFormat
.
boolean match(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie)
host
- the host to which the request is being submittedport
- the port to which the request is being submittedpath
- the path to which the request is being submittedsecure
- true if the request is using a secure connectioncookie
- the Cookie to be matched
Cookie[] match(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie[] cookies)
host
- the host to which the request is being submittedport
- the port to which the request is being submitted (currenlty
ignored)path
- the path to which the request is being submittedsecure
- true if the request is using a secure protocolcookies
- an array of Cookies to be matched
boolean domainMatch(java.lang.String host, java.lang.String domain)
host
- The target host.domain
- The cookie domain attribute.
boolean pathMatch(java.lang.String path, java.lang.String topmostPath)
path
- The target path.topmostPath
- The cookie path attribute.
java.lang.String formatCookie(Cookie cookie)
cookie
- the cookie to be formatted as string
java.lang.String formatCookies(Cookie[] cookies) throws java.lang.IllegalArgumentException
cookies
- the Cookies to be formatted
java.lang.IllegalArgumentException
- if an input parameter is illegalHeader formatCookieHeader(Cookie[] cookies) throws java.lang.IllegalArgumentException
cookies
- the Cookies format into a Cookie header
java.lang.IllegalArgumentException
- if an input parameter is illegalHeader formatCookieHeader(Cookie cookie) throws java.lang.IllegalArgumentException
cookie
- the Cookie format as a Cookie header
java.lang.IllegalArgumentException
- if an input parameter is illegal
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |