public final class

CookieSpecRegistry

extends Object
java.lang.Object
   ↳ org.apache.http.cookie.CookieSpecRegistry

Class Overview

Cookie specification registry that can be used to obtain the corresponding cookie specification implementation for a given type of type or version of cookie.

Summary

Public Constructors
CookieSpecRegistry()
Public Methods
CookieSpec getCookieSpec(String name)
Gets the cookie specification with the given name.
CookieSpec getCookieSpec(String name, HttpParams params)
Gets the cookie specification with the given ID.
List<String> getSpecNames()
Obtains a list containing the names of all registered cookie specs.
void register(String name, CookieSpecFactory factory)
Registers a CookieSpecFactory with the given identifier.
void setItems(Map<StringCookieSpecFactory> map)
Populates the internal collection of registered cookie specs with the content of the map passed as a parameter.
void unregister(String id)
Unregisters the CookieSpecFactory with the given ID.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CookieSpecRegistry ()

Also: HttpClient

Public Methods

public CookieSpec getCookieSpec (String name)

Also: HttpClient

Gets the cookie specification with the given name.

Parameters
name the cookie specification identifier
Throws
IllegalStateException if a policy with the given name cannot be found

public CookieSpec getCookieSpec (String name, HttpParams params)

Also: HttpClient

Gets the cookie specification with the given ID.

Parameters
name the cookie specification identifier
params the HTTP parameters for the cookie specification.
Throws
IllegalStateException if a policy with the given name cannot be found

public List<String> getSpecNames ()

Also: HttpClient

Obtains a list containing the names of all registered cookie specs. Note that the DEFAULT policy (if present) is likely to be the same as one of the other policies, but does not have to be.

Returns
  • list of registered cookie spec names

public void register (String name, CookieSpecFactory factory)

Also: HttpClient

Registers a CookieSpecFactory with the given identifier. If a specification with the given name already exists it will be overridden. This nameis the same one used to retrieve the CookieSpecFactory from getCookieSpec(String).

Parameters
name the identifier for this specification
factory the CookieSpecFactory class to register

public void setItems (Map<StringCookieSpecFactory> map)

Also: HttpClient

Populates the internal collection of registered cookie specs with the content of the map passed as a parameter.

Parameters
map cookie specs

public void unregister (String id)

Also: HttpClient

Unregisters the CookieSpecFactory with the given ID.

Parameters
id the identifier of the cookie specification to unregister