APIdia Launch Partner
Top Fields Constructors Methods
sun.net.www.protocol.http

public Class AuthCacheImpl

extends Object
implements AuthCache
Class Inheritance
All Implemented Interfaces
sun.net.www.protocol.http.AuthCache
Imports
java.net.Authenticator, java.util.Collections, .LinkedList, .ListIterator, .HashMap, .Map, .WeakHashMap

Author
Michael McMahon

Field Summary

Modifier and TypeField and Description
private static final Map<Authenticator, AuthCacheImpl>
pack-priv HashMap<String, LinkedList<AuthCacheValue>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized AuthCacheValue
get(String pkey, String skey)

Implements sun.net.www.protocol.http.AuthCache.get.

Get an entry from the cache based on pkey as described above, but also using a pathname (skey) and the cache must return an entry if skey is a sub-path of the AuthCacheValue.path field.

public static AuthCacheImpl
getAuthCacheFor(Authenticator auth)

Atomically check if a cache exists for given Authenticator and return it or create one and return it

public static AuthCacheImpl
getDefault()

The default cache is stored under null key which is never garbage collected.

public synchronized void
put(String pkey, AuthCacheValue value)

Implements sun.net.www.protocol.http.AuthCache.put.

Put an entry in the cache.

public synchronized void
remove(String pkey, AuthCacheValue entry)

Implements sun.net.www.protocol.http.AuthCache.remove.

remove the entry from the cache whose pkey is specified and whose path is equal to entry.path.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachesback to summary
private static final Map<Authenticator, AuthCacheImpl> caches
hashtableback to summary
pack-priv HashMap<String, LinkedList<AuthCacheValue>> hashtable

Constructor Detail

AuthCacheImplback to summary
public AuthCacheImpl()

Method Detail

getback to summary
public synchronized AuthCacheValue get(String pkey, String skey)

Implements sun.net.www.protocol.http.AuthCache.get.

Doc from sun.net.www.protocol.http.AuthCache.get.

Get an entry from the cache based on pkey as described above, but also using a pathname (skey) and the cache must return an entry if skey is a sub-path of the AuthCacheValue.path field.

getAuthCacheForback to summary
public static AuthCacheImpl getAuthCacheFor(Authenticator auth)

Atomically check if a cache exists for given Authenticator and return it or create one and return it

getDefaultback to summary
public static AuthCacheImpl getDefault()

The default cache is stored under null key which is never garbage collected.

putback to summary
public synchronized void put(String pkey, AuthCacheValue value)

Implements sun.net.www.protocol.http.AuthCache.put.

Doc from sun.net.www.protocol.http.AuthCache.put.

Put an entry in the cache. pkey is a string specified as follows: A:[B:]C:D:E[:F] Between 4 and 6 fields separated by ":", where the fields have the following meaning: A is "s" or "p" for server or proxy authentication respectively B is optional and is the AuthScheme, e.g. BASIC, DIGEST, NTLM, etc C is either "http" or "https" D is the hostname E is the port number F is optional and if present is the realm Generally, two entries are created for each AuthCacheValue, one including the realm and one without the realm. Also, for some schemes (digest) multiple entries may be created with the same pkey, but with a different path value in the AuthCacheValue.

removeback to summary
public synchronized void remove(String pkey, AuthCacheValue entry)

Implements sun.net.www.protocol.http.AuthCache.remove.

Doc from sun.net.www.protocol.http.AuthCache.remove.

remove the entry from the cache whose pkey is specified and whose path is equal to entry.path. If entry is null then all entries with the same pkey should be removed.

setMapback to summary
public void setMap(HashMap<String, LinkedList<AuthCacheValue>> map)