|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjautil.cache.JACacheHandler
public abstract class JACacheHandler
A JA cache handler provides access to a local cache for a collection of potentially remote and dispersed data files, each identified by its URL.
This is an abstract class. Each concrete subclass must supply
a local root directory for the cache via the abstract method
getCacheRootDir()
.
Each cache is bound to a specific version of JASigning.
Each cache entry is identified by its name and is represented by
a pair of files: a descriptor, represented here as a
JACacheDescriptor
, and the cached copy of the data at the
original URL.
The contents of the descriptor include the entry name and
the original data URL.
The obvious way to support this cache would be through the
standard Java caching mechanism, the JNLP Persistence Service.
However, that service seems not to be available to HTML applets
-- at least not automatically so: a typical applet dies a horrible
death as soon as it tries to use that service.
So this cache is implemented using the local file system: the descriptor
and data files for a given entry are held in a subdirectory of the
cache root directory with the same name as the entry.
Any JA cache root directory is expected to be held under a directory
called .jasigning/
under the given user's base directory.
Method Summary | |
---|---|
JACacheDescriptor |
ensureCached(java.lang.String name,
java.lang.String url)
Tries to ensure that this cache contains an up-to-date pair of files for the entry with the given name and original data URL, returning the cache descriptor if successful, or null
otherwise. |
java.net.URL |
getCachedDataURL(java.lang.String ename,
java.lang.String durl)
Returns a URL for the local copy of the data in the cache entry for the given name and remote data URL; the result is null if the
required cache entry does not exist and cannot be created. |
java.net.URL |
getDataFileURL(JACacheDescriptor desc)
Returns a URL for the local copy of the data in the cache entry identified by the given descriptor; if the given descriptor is null the result is also null . |
java.lang.String |
getDataFileURLStr(JACacheDescriptor desc)
Returns the string form of the URL for the local copy of the data in the cache entry identified by the given descriptor; if the given descriptor is null the result is also null . |
boolean |
hasACacheEntry(java.lang.String ename,
java.lang.String url)
Determines whether the cache contains a (possibly stale) entry for the given name and original data URL. |
boolean |
isCached(java.lang.String ename,
java.lang.String url)
Determines whether the cache contains an (up-to-date) pair of files for the entry with the given name and original data URL. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean hasACacheEntry(java.lang.String ename, java.lang.String url)
public boolean isCached(java.lang.String ename, java.lang.String url)
public JACacheDescriptor ensureCached(java.lang.String name, java.lang.String url)
null
otherwise. If necessary, a new pair of cache items is created or an
existing stale data item is refreshed.
public java.net.URL getCachedDataURL(java.lang.String ename, java.lang.String durl)
null
if the
required cache entry does not exist and cannot be created.
public java.net.URL getDataFileURL(JACacheDescriptor desc)
null
the result is also null
.
.
public java.lang.String getDataFileURLStr(JACacheDescriptor desc)
null
the result is also null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |