public class SessionCacheUtils extends Object
SessionCache
.Constructor and Description |
---|
SessionCacheUtils() |
Modifier and Type | Method and Description |
---|---|
static WMSCapabilities |
getOrRetrieveSessionCapabilities(URL url,
SessionCache cache,
Object cacheKey,
AbsentResourceList absentResourceList,
long resourceID,
PropertyChangeListener propertyListener,
String propertyName)
Checks a session cache for a specified key, and if present attempts to interpret the cache entry as a
WMSCapabilities document. |
static WMSCapabilities |
getSessionCapabilities(SessionCache cache,
Object cacheKey,
String name)
Checks a session cache for a specified key, and if present attempts to interpret the cache entry as a
WMSCapabilities document. |
static void |
retrieveSessionData(URL url,
SessionCache cache,
Object cacheKey,
AbsentResourceList absentResourceList,
long resourceID,
PropertyChangeListener propertyListener,
String propertyName)
Retrieves the contents of a specified
URL . |
public static WMSCapabilities getOrRetrieveSessionCapabilities(URL url, SessionCache cache, Object cacheKey, AbsentResourceList absentResourceList, long resourceID, PropertyChangeListener propertyListener, String propertyName)
WMSCapabilities
document. If the key does not map to a Capabilities document for any reason, this attempts to
asynchronously retrieve the Capabilities from a specified URL, and returns null.url
- the URL contents to retrieve.cache
- the session cache.cacheKey
- the key to identify the object in the session cache.absentResourceList
- the absent resource list to update.resourceID
- the resource ID to use in the absent resource list.propertyListener
- the property change listener which is fired when the retrieved data is available.propertyName
- the property name to fire when retrieved data is available.IllegalArgumentException
- if either the url, retrieval service, cache or cache key are null.public static WMSCapabilities getSessionCapabilities(SessionCache cache, Object cacheKey, String name)
WMSCapabilities
document. If the key does not exist in the cache, or the cache entry cannot be interpreted as a
Capabilities document, this returns null. If the entry exists, but must be converted to a Capabilities document,
this overrides the previous cache entry with the the newly converted Capabilities.cache
- the session cache.cacheKey
- the key to identify the object in the session cache.name
- the name to use in logging messages.IllegalArgumentException
- if either the cache or cache key are null.public static void retrieveSessionData(URL url, SessionCache cache, Object cacheKey, AbsentResourceList absentResourceList, long resourceID, PropertyChangeListener propertyListener, String propertyName)
URL
. If successful, this places the URL
contents in a specified session cache with a specified key. This either marks the resource as available or
missing, depending on whether the retrieval succeeds or fails. Finally, this optionally notifies the caller that
the retrieval has succeeded by firing a property change event. If either the property listener or property name
are null, that functionality is disabled.url
- the URL contents to retrieve.cache
- the cache which receives the retrieved data.cacheKey
- the cache key which identifies where the retrieved data is placed in the session
cache.absentResourceList
- the absent resource list to update.resourceID
- the resource ID to use in the absent resource list.propertyListener
- the property change listener which is fired when the retrieved data is available.propertyName
- the property name to fire when retrieved data is available.IllegalArgumentException
- if any of the url, retrieval service, cache, or cache key are null.