|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.boot.cache.FileCache
file cache for resources
| Method Summary | |
boolean |
checkHash(IFileCacheResource resource,
java.lang.String hash,
boolean isJar)
Check the integrity of the given resource. |
java.io.File |
getBaseDir()
Get the directory where the file cache is located. |
static IFileCache |
getInstance()
get the FileCache |
static FileCache |
initialize(BootRuntime brt)
initialize only once before usage |
void |
invalidateResource(IFileCacheResource ifcr)
call this method to remove (delete) all information of this cached resource. |
void |
invalidateResource(java.net.URL urlRemote)
invalidates a cache-entry if exists will invalidate all file-resources from the file cache directory for this url. |
static boolean |
isCacheable(java.net.URL source)
Returns whether the resource can be cached. |
boolean |
isCached(java.net.URL urlRemote)
check´s if there is already a local copy of this remote URL |
boolean |
isCachedAndValid(IFileCacheResource resource,
java.lang.String hash)
Check if there is allready a local copy of the given resouce. |
boolean |
isCachedAndValid(XMA_URI uri,
java.lang.String hash)
Check if there is allready a local copy of the given resouce. |
IFileCacheResource |
openLocalResource(XMA_URI resource)
Open a resource from the local cache. |
IFileCacheResource |
openResource(IRtXMASessionClient session,
java.net.URL urlRemote)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(java.net.URL urlRemote)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(java.net.URL urlRemote,
boolean bmode)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(java.net.URL urlRemote,
boolean bmode,
boolean bforce)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(java.net.URL urlRemote,
boolean bmode,
boolean bforce,
IRtXMASessionClient session)
This method will open a resource represented by a valid URL. |
IFileCacheResource |
openResource(XMA_URI resource,
java.lang.String hash,
VersionNumber serverVers,
boolean bforce)
This method will open a resource represented by a valid XMA_URI. |
IFileCacheResource |
openResource(XMA_URI appUri,
XMAResource resource,
VersionNumber serverVers,
boolean bforce)
This method will open a resource represented by a valid XMAResource. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static IFileCache getInstance()
java.lang.IllegalStateException - if not initialized
public static FileCache initialize(BootRuntime brt)
throws java.io.IOException
brt - the BootRuntime to get the configuration from
java.lang.IllegalArgumentException - if file does not exist.
java.io.IOException - containing the filename
public IFileCacheResource openResource(java.net.URL urlRemote)
throws java.io.IOException
IFileCacheURL.IFileCache.openResource(URL, boolean, boolean, IRtXMASessionClient) called
with (urlRemote, true, false, null).
openResource in interface IFileCacheurlRemote - remote url to open.
java.io.IOException - on filesystem errors
public IFileCacheResource openResource(IRtXMASessionClient session,
java.net.URL urlRemote)
throws java.io.IOException
IFileCacheURL.IFileCache.openResource(URL, boolean, boolean, IRtXMASessionClient) called
with (urlRemote, true, false, session).
openResource in interface IFileCachesession - xma session (or null)urlRemote - remote url to open.
java.io.IOException - on filesystem errors
public IFileCacheResource openResource(java.net.URL urlRemote,
boolean bmode)
throws java.io.IOException
IFileCacheURL.IFileCache.openResource(URL, boolean, boolean, IRtXMASessionClient) called
with (urlRemote, bmode, false, null).
openResource in interface IFileCacheurlRemote - remote url to open.bmode - use true for buffered mode.
java.io.IOException - on filesystem errors
public IFileCacheResource openResource(java.net.URL urlRemote,
boolean bmode,
boolean bforce)
throws java.io.IOException
IFileCacheURL.IFileCache.openResource(URL, boolean, boolean, IRtXMASessionClient) called
with (urlRemote, bmode, bforce, null).
openResource in interface IFileCacheurlRemote - remote url to open.bmode - use true for buffered mode.bforce - force an update check with the server
java.io.IOException - on filesystem errors
public IFileCacheResource openResource(java.net.URL urlRemote,
boolean bmode,
boolean bforce,
IRtXMASessionClient session)
throws java.io.IOException
IFileCacheURL.
openResource in interface IFileCacheurlRemote - remote url to open.bmode - read the cache entry, into a memory buffer imediately on object creationbforce - force an update check with the serversession - xma session (or null)
java.io.IOException - on filesystem errors
public IFileCacheResource openResource(XMA_URI appUri,
XMAResource resource,
VersionNumber serverVers,
boolean bforce)
throws java.io.IOException
IFileCacheXMAResource.XMAResource match the
hash of the cached resource.
openResource in interface IFileCacheappUri - uri of the xma applicationresource - the wanted resource inside this applicationserverVers - version number of the xma-runtime on the serverbforce - force an update check with the server
java.io.IOException - on filesystem errors
public boolean checkHash(IFileCacheResource resource,
java.lang.String hash,
boolean isJar)
checkHash in interface IFileCacheresource - to checkhash - expected hash valueisJar - if the resource is a jar file or not
public IFileCacheResource openLocalResource(XMA_URI resource)
null is returned. The resource is not checked for expiration or integrity.
This method does not find shared resources.
openLocalResource in interface IFileCacheresource - to open
null if not cached.
java.io.IOException - containing the filename
public IFileCacheResource openResource(XMA_URI resource,
java.lang.String hash,
VersionNumber serverVers,
boolean bforce)
throws java.io.IOException
IFileCacheXMA_URI.
openResource in interface IFileCacheresource - the wanted resourcehash - the expected hash value of the resouceserverVers - version number of the xma-runtime on the serverbforce - force an update check with the server
java.io.IOException - on filesystem errorspublic void invalidateResource(java.net.URL urlRemote)
IFileCacheinvalidates a cache-entry if exists
will invalidate all file-resources from the file cache directory for this url.
invalidateResource in interface IFileCacheurlRemote - the remote url that is the key to the cached resourcespublic void invalidateResource(IFileCacheResource ifcr)
IFileCache
invalidateResource in interface IFileCacheifcr - the resource to invalidatepublic static boolean isCacheable(java.net.URL source)
source - url to check
public boolean isCached(java.net.URL urlRemote)
isCached in interface IFileCacheurlRemote - remote URL to check for a local cached copy
java.lang.IllegalArgumentException - if the source is not cacheableURLpublic java.io.File getBaseDir()
IFileCache
getBaseDir in interface IFileCache
public boolean isCachedAndValid(XMA_URI uri,
java.lang.String hash)
IFileCache
isCachedAndValid in interface IFileCacheuri - defining the resourcehash - expected hash value of the resource
public boolean isCachedAndValid(IFileCacheResource resource,
java.lang.String hash)
IFileCache
isCachedAndValid in interface IFileCacheresource - to checkhash - expected hash value of the resource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||