Class IgnoreCookiesSpec
java.lang.Object
edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.cookie.IgnoreCookiesSpec
- All Implemented Interfaces:
CookieSpec
A cookie spec that does nothing. Cookies are neither parsed, formatted nor matched.
It can be used to effectively disable cookies altogether.
- Since:
- 3.0
-
Field Summary
Fields inherited from interface edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.cookie.CookieSpec
PATH_DELIM, PATH_DELIM_CHAR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
domainMatch
(String host, String domain) Performs domain-match as defined by the cookie specification.formatCookie
(Cookie cookie) Create a "Cookie" header value for an array of cookies.formatCookieHeader
(Cookie cookie) Create a "Cookie" Header for single Cookie.formatCookieHeader
(Cookie[] cookies) Create a "Cookie" Header for an array of Cookies.formatCookies
(Cookie[] cookies) Create a "Cookie" header value for an array of cookies.Returns theCollection
of date patterns used for parsing.boolean
Determines if a Cookie matches a location.Cookie[]
Returns an emptycookie
array.Cookie[]
Returns an emptycookie
array.Cookie[]
Returns an emptycookie
array.void
parseAttribute
(NameValuePair attribute, Cookie cookie) Does nothing.boolean
Performs path-match as defined by the cookie specification.void
setValidDateFormats
(Collection datepatterns) Does nothing.void
Does nothing.
-
Constructor Details
-
IgnoreCookiesSpec
public IgnoreCookiesSpec()
-
-
Method Details
-
parse
public Cookie[] parse(String host, int port, String path, boolean secure, String header) throws MalformedCookieException Returns an emptycookie
array. All parameters are ignored.- Specified by:
parse
in interfaceCookieSpec
- Parameters:
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- Returns:
- an array of Cookies parsed from the Set-Cookie value
- Throws:
MalformedCookieException
- if an exception occurs during parsing- See Also:
-
getValidDateFormats
Description copied from interface:CookieSpec
Returns theCollection
of date patterns used for parsing. The String patterns are compatible with theSimpleDateFormat
.- Specified by:
getValidDateFormats
in interfaceCookieSpec
- Returns:
null
-
setValidDateFormats
Does nothing.- Specified by:
setValidDateFormats
in interfaceCookieSpec
- Parameters:
datepatterns
- collection of date patterns
-
formatCookie
Description copied from interface:CookieSpec
Create a "Cookie" header value for an array of cookies.- Specified by:
formatCookie
in interfaceCookieSpec
- Parameters:
cookie
- the cookie to be formatted as string- Returns:
null
-
formatCookieHeader
Description copied from interface:CookieSpec
Create a "Cookie" Header for single Cookie.- Specified by:
formatCookieHeader
in interfaceCookieSpec
- Parameters:
cookie
- the Cookie format as a Cookie header- Returns:
null
- Throws:
IllegalArgumentException
- if an input parameter is illegal
-
formatCookieHeader
Description copied from interface:CookieSpec
Create a "Cookie" Header for an array of Cookies.- Specified by:
formatCookieHeader
in interfaceCookieSpec
- Parameters:
cookies
- the Cookies format into a Cookie header- Returns:
null
- Throws:
IllegalArgumentException
- if an input parameter is illegal
-
formatCookies
Description copied from interface:CookieSpec
Create a "Cookie" header value for an array of cookies.- Specified by:
formatCookies
in interfaceCookieSpec
- Parameters:
cookies
- the Cookies to be formatted- Returns:
null
- Throws:
IllegalArgumentException
- if an input parameter is illegal
-
match
Description copied from interface:CookieSpec
Determines if a Cookie matches a location.- Specified by:
match
in interfaceCookieSpec
- Parameters:
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- Returns:
false
-
match
Returns an emptycookie
array. All parameters are ignored.- Specified by:
match
in interfaceCookieSpec
- Parameters:
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- Returns:
- true if the cookie should be submitted with a request with given attributes, false otherwise.
-
parse
public Cookie[] parse(String host, int port, String path, boolean secure, Header header) throws MalformedCookieException, IllegalArgumentException Returns an emptycookie
array. All parameters are ignored.- Specified by:
parse
in interfaceCookieSpec
- Parameters:
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- Returns:
- an array of Cookies parsed from the header
- Throws:
MalformedCookieException
- if an exception occurs during parsingIllegalArgumentException
- if an input parameter is illegal- See Also:
-
parseAttribute
public void parseAttribute(NameValuePair attribute, Cookie cookie) throws MalformedCookieException, IllegalArgumentException Does nothing.- Specified by:
parseAttribute
in interfaceCookieSpec
- Parameters:
attribute
- cookie attribute from the Set-Cookiecookie
- the to be updated- Throws:
MalformedCookieException
- if an exception occurs during parsingIllegalArgumentException
- if an input parameter is illegal
-
validate
public void validate(String host, int port, String path, boolean secure, Cookie cookie) throws MalformedCookieException, IllegalArgumentException Does nothing.- Specified by:
validate
in interfaceCookieSpec
- Parameters:
host
- the host from which theCookie
was receivedport
- the port from which theCookie
was receivedpath
- the path from which theCookie
was receivedsecure
- true when theCookie
was received using a secure connectioncookie
- the Cookie to validate- Throws:
MalformedCookieException
- if the cookie is invalidIllegalArgumentException
- if an input parameter is illegal
-
domainMatch
Description copied from interface:CookieSpec
Performs domain-match as defined by the cookie specification.- Specified by:
domainMatch
in interfaceCookieSpec
- Parameters:
host
- The target host.domain
- The cookie domain attribute.- Returns:
false
-
pathMatch
Description copied from interface:CookieSpec
Performs path-match as defined by the cookie specification.- Specified by:
pathMatch
in interfaceCookieSpec
- Parameters:
path
- The target path.topmostPath
- The cookie path attribute.- Returns:
false
-