Version: 1.1.1

org.biomoby.shared
Interface CentralCached

All Superinterfaces:
Central, CentralAll, CentralDigest, Notifier
All Known Implementing Classes:
CentralCachedCallsImpl, CentralDigestCachedImpl, CentralDigestCachedSimpleImpl

public interface CentralCached
extends CentralAll, Notifier

A convenient interface combining together all methods for accessing the BioMoby registry and the handling its local cache.

Version:
$Id: CentralCached.java,v 1.2 2008/03/03 11:34:17 senger Exp $
Author:
Martin Senger

Field Summary
static String CACHE_PART_DATATYPES
          An ID indicating data types part of a cache.
static String CACHE_PART_NAMESPACES
          An ID indicating namespaces part of a cache.
static String CACHE_PART_SERVICES
          An ID indicating services part of a cache.
static String CACHE_PART_SERVICETYPES
          An indicating service types part of a cache.
static String CACHE_PROP_COUNT
           
static String CACHE_PROP_LOCATION
           
static String CACHE_PROP_NAME
           
static String CACHE_PROP_OLDEST
           
static String CACHE_PROP_REGISTRY_URL
           
static String CACHE_PROP_SIZE
           
static String CACHE_PROP_YOUNGEST
           
static String LIST_FILE
          A special file name, containing a list of cached entities.
static String RDF_FILE
          A special file name, containing an RDF document with the cached entities.
 
Fields inherited from interface org.biomoby.shared.Central
DATA_TYPES_RESOURCE_NAME, FULL_RESOURCE_NAME, HAS, HASA, iHAS, iHASA, iISA, ISA, NAMESPACES_RESOURCE_NAME, SERVICE_INSTANCES_RESOURCE_NAME, SERVICE_TYPES_RESOURCE_NAME
 
Fields inherited from interface org.biomoby.shared.event.Notifier
AUTHORITIES_CANCELLED, AUTHORITIES_COUNT, AUTHORITIES_END, AUTHORITIES_RESET, AUTHORITIES_START, AUTHORITIES_UPDATED, AUTHORITY_LOADED, AUTHORITY_LOADING, DATA_TYPE_LOADED, DATA_TYPE_LOADING, DATA_TYPES_CANCELLED, DATA_TYPES_COUNT, DATA_TYPES_END, DATA_TYPES_RESET, DATA_TYPES_START, DATA_TYPES_UPDATED, NAMESPACE_LOADED, NAMESPACE_LOADING, NAMESPACES_CANCELLED, NAMESPACES_COUNT, NAMESPACES_END, NAMESPACES_RESET, NAMESPACES_START, NAMESPACES_UPDATED, SERVICE_TYPE_LOADED, SERVICE_TYPE_LOADING, SERVICE_TYPES_CANCELLED, SERVICE_TYPES_COUNT, SERVICE_TYPES_END, SERVICE_TYPES_RESET, SERVICE_TYPES_START, SERVICE_TYPES_UPDATED, SIGNAL_CANCEL_DATA_TYPES, SIGNAL_CANCEL_NAMESPACES, SIGNAL_CANCEL_SERVICE_TYPES, SIGNAL_CANCEL_SERVICES
 
Method Summary
 long getCacheAge()
          Return an age of the current (whole) cache in millis from the beginning of the Epoch; or -1 if cache is empty, or the age is unknown.
 Properties getCacheInfo(String id)
          Return as many properties describing the given part of a cache as possible.
 String getCacheInfoFormatted(String id)
          Similar as getCacheInfo(java.lang.String) but formatted into a single string.
 boolean isUsingCache()
          Indicate whether the implementtaion really is using a local cache.
 void removeFromCache(String id)
          Remove a group of objects from a cache.
 void updateCache(String id)
          Update the indicated part of a cache.
 
Methods inherited from interface org.biomoby.shared.Central
call, findService, findService, findService, findService, findService, getCacheMode, getDataType, getDataTypeNames, getDataTypeRelationships, getDataTypeRelationships, getDataTypes, getFullNamespaces, getNamespaces, getProviders, getRegistryEndpoint, getRegistryNamespace, getResource, getResourceRefs, getServiceNames, getServiceNamesByAuthority, getServiceTypeRelationships, getServiceTypes, getServiceWSDL, getServiceWSDL, registerDataType, registerNamespace, registerService, registerServiceType, setCacheMode, setDebug, unregisterDataType, unregisterNamespace, unregisterService, unregisterServiceType
 
Methods inherited from interface org.biomoby.shared.CentralDigest
getDataTypes, getFullServiceTypes, getServices
 
Methods inherited from interface org.biomoby.shared.event.Notifier
addNotificationListener, addNotificationListeners, callback, fireEvent, fireEvent, getNotificationListeners, removeNotificationListener, removeNotificationListeners
 

Field Detail

LIST_FILE

static final String LIST_FILE
A special file name, containing a list of cached entities. To be ignored when browsing the cache.

See Also:
Constant Field Values

RDF_FILE

static final String RDF_FILE
A special file name, containing an RDF document with the cached entities. To be ignored when browsing the cache.

See Also:
Constant Field Values

CACHE_PART_DATATYPES

static final String CACHE_PART_DATATYPES
An ID indicating data types part of a cache.

See Also:
Constant Field Values

CACHE_PART_SERVICES

static final String CACHE_PART_SERVICES
An ID indicating services part of a cache.

See Also:
Constant Field Values

CACHE_PART_SERVICETYPES

static final String CACHE_PART_SERVICETYPES
An indicating service types part of a cache.

See Also:
Constant Field Values

CACHE_PART_NAMESPACES

static final String CACHE_PART_NAMESPACES
An ID indicating namespaces part of a cache.

See Also:
Constant Field Values

CACHE_PROP_NAME

static final String CACHE_PROP_NAME
See Also:
Constant Field Values

CACHE_PROP_COUNT

static final String CACHE_PROP_COUNT
See Also:
Constant Field Values

CACHE_PROP_OLDEST

static final String CACHE_PROP_OLDEST
See Also:
Constant Field Values

CACHE_PROP_YOUNGEST

static final String CACHE_PROP_YOUNGEST
See Also:
Constant Field Values

CACHE_PROP_SIZE

static final String CACHE_PROP_SIZE
See Also:
Constant Field Values

CACHE_PROP_LOCATION

static final String CACHE_PROP_LOCATION
See Also:
Constant Field Values

CACHE_PROP_REGISTRY_URL

static final String CACHE_PROP_REGISTRY_URL
See Also:
Constant Field Values
Method Detail

removeFromCache

void removeFromCache(String id)
Remove a group of objects from a cache. If 'id' is null it removes the whole cache (for that Moby registry an instance implementing this interface was initiated for). Otherwise 'id' indicates which part of the cache that will be removed.

Parameters:
id - should be either null, or one of the following: CACHE_PART_DATATYPES, CACHE_PART_SERVICES, CACHE_PART_SERVICETYPES, and CACHE_PART_NAMESPACES.

updateCache

void updateCache(String id)
                 throws MobyException
Update the indicated part of a cache. If 'id' is null it updates the whole cache (for that Moby registry an instance implementing this interface was initiated for).

Updates means to fetch a new list of entities, compare it with existing entities in the cache, fetch the missing ones and remove the redundant ones.

Parameters:
id - should be either null, or one of the following: CACHE_PART_DATATYPES, CACHE_PART_SERVICES, CACHE_PART_SERVICETYPES, and CACHE_PART_NAMESPACES.
Throws:
MobyException

getCacheAge

long getCacheAge()
Return an age of the current (whole) cache in millis from the beginning of the Epoch; or -1 if cache is empty, or the age is unknown.

Returns:
the cache age which is taken as the oldest (but filled) cache part (part is considered e.g. 'services', or 'data types', not their individual records in the parts)

getCacheInfo

Properties getCacheInfo(String id)
Return as many properties describing the given part of a cache as possible. The key used for returned properties are publicly available from this interface but other may be returned as well.

Parameters:
id - is a part of cache to be described, or null if the whole cache should be described (this may return different kind of properties than for individual cache parts)
Returns:
properties describing a cache

getCacheInfoFormatted

String getCacheInfoFormatted(String id)
Similar as getCacheInfo(java.lang.String) but formatted into a single string.

Parameters:
id - is a part of cache to be described, or null if the whole cache should be described (this may return different kind of properties than for individual cache parts)
Returns:
a cache description

isUsingCache

boolean isUsingCache()
Indicate whether the implementtaion really is using a local cache.

Returns:
true if a local cache is used

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010