Version: 1.1.1

org.biomoby.client
Class CentralDigestImpl

java.lang.Object
  extended by org.biomoby.client.CentralImpl
      extended by org.biomoby.client.CentralDigestImpl
All Implemented Interfaces:
SimpleCache, Central, CentralDigest, Notifier
Direct Known Subclasses:
CentralDigestCachedSimpleImpl

public class CentralDigestImpl
extends CentralImpl
implements CentralDigest, Notifier

A default implementation of CentralDigest to get (also) cumulated data from a Moby registry.

Version:
$Id: CentralDigestImpl.java,v 1.14 2008/10/30 02:33:25 gordonp Exp $
Author:
Martin Senger

Field Summary
 
Fields inherited from class org.biomoby.client.CentralImpl
CENTRAL_IMPL_RESOURCE_NAME, DEFAULT_CENTRAL_IMPL_CLASSNAME, DEFAULT_ENDPOINT, DEFAULT_NAMESPACE, DOCUMENT_BUILDER_FACTORIES
 
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
 
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
 
Constructor Summary
CentralDigestImpl()
          Default constructor.
CentralDigestImpl(String endpoint)
          Constructor allowing to specify which Moby Registry to use.
CentralDigestImpl(String endpoint, String namespace)
          Constructor allowing to specify which Moby Registry and what namespace to use.
 
Method Summary
 void addNotificationListener(NotificationListener l)
          Adds the specified notification listener to receive notification events from the class that implements this interface.
 void addNotificationListeners(NotificationListener[] l)
          Adds the specified notification listeners to receive notification events from the class that implements this interface.
 void callback(int signal)
          Call the notifier and signal that it can stop loading data (or whatever it is doing).
 void fireEvent(int type, Object message, Object details)
           
 void fireEvent(NotificationEvent event)
           
 MobyDataType[] getDataTypes()
          Get definition of all known data types.
 MobyNamespace[] getFullNamespaces()
          Parses and imports the following XML.
 MobyServiceType[] getFullServiceTypes()
          Get definition of all known service types.
 NotificationListener[] getNotificationListeners()
          Returns an array of all the NotificationListeners added to the class that implements this interface.
 MobyService[] getServices()
          Get definition of all registered service instances.
 void removeNotificationListener(NotificationListener l)
          Removes the specified notification listener so that it no longer receives notification events from the class that implements this interface.
 void removeNotificationListeners(NotificationListener[] l)
          Removes the specified notification listeners so that they no longer receive notification events from the class that implements this interface.
 void setCacheMode(boolean shouldCache)
          Methods re-writing the same methods from the superclass.
 
Methods inherited from class org.biomoby.client.CentralImpl
call, createId, escapeXML, existsInCache, extractServices, findService, findService, findService, findService, findService, formatFault, formatFault, getCacheMode, getContents, getDataType, getDataTypeNames, getDataTypeRelationships, getDataTypeRelationships, getDefaultCentral, getDefaultCentral, getDefaultURI, getDefaultURL, getNamespaces, getProviders, getRegisterDataTypeXML, getRegisterNamespaceXML, getRegisterServiceTypeXML, getRegisterServiceXML, getRegistryEndpoint, getRegistryNamespace, getResource, getResourceRefs, getServiceNames, getServiceNamesByAuthority, getServicesByAuthority, getServiceTypeRelationships, getServiceTypes, getServiceWSDL, getServiceWSDL, loadDocument, registerDataType, registerNamespace, registerService, registerServiceType, removeFromCache, setContents, setDebug, unregisterDataType, unregisterNamespace, unregisterService, unregisterServiceType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentralDigestImpl

public CentralDigestImpl()
                  throws MobyException
Default constructor. It connects to a default Moby registry (as defined in CentralImpl.DEFAULT_ENDPOINT) using a default namespace (as defined int CentralImpl.DEFAULT_NAMESPACE).

Throws:
MobyException

CentralDigestImpl

public CentralDigestImpl(String endpoint)
                  throws MobyException
Constructor allowing to specify which Moby Registry to use.

Throws:
MobyException

CentralDigestImpl

public CentralDigestImpl(String endpoint,
                         String namespace)
                  throws MobyException
Constructor allowing to specify which Moby Registry and what namespace to use. If any of the parameters is null, its default value is used instead.

Throws:
MobyException
Method Detail

setCacheMode

public void setCacheMode(boolean shouldCache)
Methods re-writing the same methods from the superclass.

Specified by:
setCacheMode in interface Central
Overrides:
setCacheMode in class CentralImpl
Parameters:
shouldCache - whether retrieveXXX call results should be cached in case they are called again (i.e. don't request MobyCentral every time)

getDataTypes

public MobyDataType[] getDataTypes()
                            throws MobyException
Description copied from interface: CentralDigest
Get definition of all known data types. It is a cumulation of many individual calls to Central.getDataType(java.lang.String) for all registered data type names.

Specified by:
getDataTypes in interface Central
Specified by:
getDataTypes in interface CentralDigest
Overrides:
getDataTypes in class CentralImpl
Throws:
MobyException - if communication with the Moby Registry fails

getFullServiceTypes

public MobyServiceType[] getFullServiceTypes()
                                      throws MobyException
Description copied from interface: CentralDigest
Get definition of all known service types. It differs from the Central.getServiceTypes() because it returns an array of full definitions of service types, and not just their names and descriptions.

Specified by:
getFullServiceTypes in interface CentralDigest
Throws:
MobyException - if communication with the Moby Registry fails

getFullNamespaces

public MobyNamespace[] getFullNamespaces()
                                  throws MobyException
Description copied from class: CentralImpl
Parses and imports the following XML.
  <Namespaces>
     <Namespace name="namespace" lsid="...">
            <Description><![CDATA[free text description here]]></Description>
            <contactEmail>...</contactEmail>
            <authURI>...</authURI>
     </Namespace>
          ...
          ...
  </Namespaces>
 

Specified by:
getFullNamespaces in interface Central
Overrides:
getFullNamespaces in class CentralImpl
Returns:
array of namespaces
Throws:
MobyException - if communication with the Moby Registry fails

getServices

public MobyService[] getServices()
                          throws MobyException
Description copied from interface: CentralDigest
Get definition of all registered service instances. It is a cumulation of many individual calls to findService by name for all known service names.

Specified by:
getServices in interface CentralDigest
Throws:
MobyException - if communication with the Moby Registry fails

addNotificationListener

public void addNotificationListener(NotificationListener l)
Description copied from interface: Notifier
Adds the specified notification listener to receive notification events from the class that implements this interface.

Specified by:
addNotificationListener in interface Notifier
Parameters:
l - notification listener to be added

addNotificationListeners

public void addNotificationListeners(NotificationListener[] l)
Description copied from interface: Notifier
Adds the specified notification listeners to receive notification events from the class that implements this interface.

Specified by:
addNotificationListeners in interface Notifier
Parameters:
l - notification listeners to be added

removeNotificationListener

public void removeNotificationListener(NotificationListener l)
Description copied from interface: Notifier
Removes the specified notification listener so that it no longer receives notification events from the class that implements this interface.

Specified by:
removeNotificationListener in interface Notifier
Parameters:
l - notification listener to be removed

removeNotificationListeners

public void removeNotificationListeners(NotificationListener[] l)
Description copied from interface: Notifier
Removes the specified notification listeners so that they no longer receive notification events from the class that implements this interface.

Specified by:
removeNotificationListeners in interface Notifier
Parameters:
l - notification listeners to be removed

getNotificationListeners

public NotificationListener[] getNotificationListeners()
Description copied from interface: Notifier
Returns an array of all the NotificationListeners added to the class that implements this interface.

Specified by:
getNotificationListeners in interface Notifier
Returns:
all of the NotificationListeners added or an empty array if no listeners have been added

callback

public void callback(int signal)
Description copied from interface: Notifier
Call the notifier and signal that it can stop loading data (or whatever it is doing).

Specified by:
callback in interface Notifier
Parameters:
signal - identifies what to stop doing (some usual values of this signal are defined elsewhere in this interface with names starting by SIGNAL_)

fireEvent

public void fireEvent(int type,
                      Object message,
                      Object details)
Specified by:
fireEvent in interface Notifier

fireEvent

public void fireEvent(NotificationEvent event)
Specified by:
fireEvent in interface Notifier

Version: 1.1.1

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