Top Description Fields Constructors Methods
org.apache.http.cookie

public final Class CookieSpecRegistry

extends Object
implements Lookup<CookieSpecProvider>
Class Inheritance
All Implemented Interfaces
org.apache.http.config.Lookup
Annotations
@Contract
threading:SAFE
@Deprecated
Imports
java.util.ArrayList, .List, .Locale, .Map, java.util.concurrent.ConcurrentHashMap, org.apache.http.HttpRequest, org.apache.http.annotation.Contract, .ThreadingBehavior, org.apache.http.config.Lookup, org.apache.http.params.HttpParams, org.apache.http.protocol.ExecutionContext, .HttpContext, org.apache.http.util.Args

Deprecated

(4.3) use org.apache.http.config.Registry.

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

Field Summary

Modifier and TypeField and Description
private final ConcurrentHashMap<String, CookieSpecFactory>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CookieSpec
getCookieSpec(final String
the cookie specification identifier
name
,
final HttpParams
the HTTP parameters for the cookie specification.
params
)

Deprecated as a consequence of HttpParams being deprecated.
Gets the cookie specification with the given ID.
public CookieSpec
getCookieSpec(final String
the cookie specification identifier
name
)

Gets the cookie specification with the given name.

public List<String>

Returns:

list of registered cookie spec names
getSpecNames
()

Obtains a list containing the names of all registered cookie specs.

public CookieSpecProvider
public void
register(final String
the identifier for this specification
name
,
final CookieSpecFactory
the CookieSpecFactory class to register
factory
)

Deprecated as a consequence of CookieSpecFactory being deprecated.
Registers a CookieSpecFactory with the given identifier.
public void
setItems(final Map<String, CookieSpecFactory>
cookie specs
map
)

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

public void
unregister(final String
the identifier of the cookie specification to unregister
id
)

Unregisters the CookieSpecFactory with the given ID.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

registeredSpecsback to summary
private final ConcurrentHashMap<String, CookieSpecFactory> registeredSpecs

Constructor Detail

CookieSpecRegistryback to summary
public CookieSpecRegistry()

Method Detail

getCookieSpecback to summary
public CookieSpec getCookieSpec(final String name, final HttpParams params) throws IllegalStateException

Deprecated

as a consequence of HttpParams being deprecated. See corresponding docs for further information.

Gets the cookie specification with the given ID.

Parameters
name:String

the cookie specification identifier

params:HttpParams

the HTTP parameters for the cookie specification.

Returns:CookieSpec

cookie specification

Exceptions
IllegalStateException:
if a policy with the given name cannot be found
getCookieSpecback to summary
public CookieSpec getCookieSpec(final String name) throws IllegalStateException

Gets the cookie specification with the given name.

Parameters
name:String

the cookie specification identifier

Returns:CookieSpec

cookie specification

Exceptions
IllegalStateException:
if a policy with the given name cannot be found
getSpecNamesback to summary
public List<String> getSpecNames()

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<String>

list of registered cookie spec names

lookupback to summary
public CookieSpecProvider lookup(final String name)

Implements org.apache.http.config.Lookup.lookup.

Annotations
@Override
registerback to summary
public void register(final String name, final CookieSpecFactory factory)

Deprecated

as a consequence of CookieSpecFactory being deprecated. See corresponding docs for further information.

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:String

the identifier for this specification

factory:CookieSpecFactory

the CookieSpecFactory class to register

See Also
getCookieSpec(String)
setItemsback to summary
public void setItems(final Map<String, CookieSpecFactory> map)

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

Parameters
map:Map<String, CookieSpecFactory>

cookie specs

unregisterback to summary
public void unregister(final String id)

Unregisters the CookieSpecFactory with the given ID.

Parameters
id:String

the identifier of the cookie specification to unregister