com.ibm.adt.topology
Class TopologyServiceFactory

java.lang.Object
  extended by com.ibm.adt.topology.TopologyServiceFactory

public final class TopologyServiceFactory
extends java.lang.Object

Implements factory methods for configuring TopologyService and for creating the interface instances required to use TopologyService services. Only one TopologyServiceFactory per JVM is allowed.


Constructor Summary
TopologyServiceFactory()
           
 
Method Summary
static TopologyComparator createComparatorInstance(java.lang.String providerId)
          Creates a new TopologyComparator instance corresponding to the specified providerId.
static TopologyProvider createProviderInstance(java.lang.String providerId)
          Creates a new TopologyProvider instance corresponding to the specified providerId.
static TopologyService createTopologyServiceInstance()
          Creates a new TopologyService instance that is used when it is desireable to establish context for object searchs that is finer grained then "JVM-wide".
static void destroyTopologyServiceInstance(TopologyService service)
          Destroys a TopologyService instance.
static java.lang.String[] getAvailableProviders()
          Get the registered TopologyProvider implementations.
static java.lang.String getConfigurationHandlerId(ConfigurationHandler handler)
          Returns the id of the specified ConfigurationHandler.
static TopologyService getGlobalTopologyService()
          Creates the global TopologyService instance if it doesn't already exist and returns it.
static TopologyServiceLogger getLogger()
          Gets the global TopologyService Logger instance.
static java.lang.String getProperty(java.lang.String key)
          Returns a runtime property from the TopologyService property store.
static ConfigurationHandler[] getRegisteredConfigurationHandlers()
          Gets all registered ConfigurationHandler instances.
static TopologyObjectCorrelator getRegisteredCorrelator(java.lang.String correlatorId)
          Gets the registered TopologyObjectCorrelator instance associated with the specified correlatorId.
static RelationshipMetaInfo[] getRegisteredRelationships(java.lang.String objectTypeNamespace)
          Returns the registered relationships applicable for the given namespace.
static void registerComparator(java.lang.String providerId, java.lang.Class comparatorClass)
          Register a TopologyComparator class with TopologyService.
static void registerConfigurationHandler(java.lang.String handlerId, java.lang.Object handler)
          Register a ConfigurationHandler instance with TopologyService.
static void registerCorrelator(java.lang.String correlatorId, java.lang.Object correlator)
          Register a TopologyObjectCorrelator instance with TopologyService.
static void registerProvider(java.lang.String providerId, java.lang.Class providerClass)
          Register a TopologyProvider class with TopologyService.
static void registerProviderRelationships(java.net.URL relationshipMapURL)
          Register provider relationships using the given XML descriptor file.
static void setLoggingOptions(boolean enable, java.lang.String logPath, java.util.logging.Level level)
          Set the logging options for Topology Service.
static void setProperty(java.lang.String key, java.lang.String value)
          Sets a runtime property in the TopologyService property store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopologyServiceFactory

public TopologyServiceFactory()
Method Detail

getGlobalTopologyService

public static TopologyService getGlobalTopologyService()
Creates the global TopologyService instance if it doesn't already exist and returns it.

Returns:
The global system TopologyService instance.

createTopologyServiceInstance

public static TopologyService createTopologyServiceInstance()
Creates a new TopologyService instance that is used when it is desireable to establish context for object searchs that is finer grained then "JVM-wide". Searches are limited to only those providers that are registered with this instance.

Returns:
TopologyService instance

destroyTopologyServiceInstance

public static void destroyTopologyServiceInstance(TopologyService service)
Destroys a TopologyService instance.

Parameters:
service - The TopologyService instance to destroy. NOTE: The global instance cannot be destroyed.

getAvailableProviders

public static java.lang.String[] getAvailableProviders()
Get the registered TopologyProvider implementations.

Returns:
an array of implemented TopologyProvider ids.

createProviderInstance

public static TopologyProvider createProviderInstance(java.lang.String providerId)
                                               throws TopologyException
Creates a new TopologyProvider instance corresponding to the specified providerId.

Parameters:
providerId - the type of TopologyProvider to instantiate.
Returns:
A new TopologyProvider instance of the specified type.
Throws:
TopologyException

createComparatorInstance

public static TopologyComparator createComparatorInstance(java.lang.String providerId)
                                                   throws TopologyException
Creates a new TopologyComparator instance corresponding to the specified providerId.

Parameters:
providerId - the type of TopologyComparator to instantiate.
Returns:
A new TopologyComparator instance of the specified type.
Throws:
TopologyException

setProperty

public static void setProperty(java.lang.String key,
                               java.lang.String value)
Sets a runtime property in the TopologyService property store.

Parameters:
key - the lookup key
value - the value to set

getProperty

public static java.lang.String getProperty(java.lang.String key)
Returns a runtime property from the TopologyService property store.

Parameters:
key - the lookup key
Returns:
the property value

registerConfigurationHandler

public static void registerConfigurationHandler(java.lang.String handlerId,
                                                java.lang.Object handler)
Register a ConfigurationHandler instance with TopologyService. This method is called by the Eclipse framework as part of processing defined TopologyService extension points.

Parameters:
handlerId - the handlerId
handler - a ConfigurationHandler instance

registerCorrelator

public static void registerCorrelator(java.lang.String correlatorId,
                                      java.lang.Object correlator)
Register a TopologyObjectCorrelator instance with TopologyService. This method is called by the Eclipse framework as part of processing defined TopologyService extension points.

Parameters:
correlatorId - the correlatorId
correlator - a TopologyObjectCorrelator instance

registerProvider

public static void registerProvider(java.lang.String providerId,
                                    java.lang.Class providerClass)
Register a TopologyProvider class with TopologyService. This method is called by the Eclipse framework as part of processing defined TopologyService extension points.

Parameters:
providerId - the providerId
providerClass - a TopologyProvider class

registerComparator

public static void registerComparator(java.lang.String providerId,
                                      java.lang.Class comparatorClass)
Register a TopologyComparator class with TopologyService. This method is called by the Eclipse framework as part of processing defined TopologyService extension points.

Parameters:
providerId - the providerId
comparatorClass - a TopologyComparator class

getRegisteredConfigurationHandlers

public static ConfigurationHandler[] getRegisteredConfigurationHandlers()
Gets all registered ConfigurationHandler instances.

Returns:
an array of ConfigurationHandler instances

getConfigurationHandlerId

public static java.lang.String getConfigurationHandlerId(ConfigurationHandler handler)
Returns the id of the specified ConfigurationHandler.

Parameters:
handler - the ConfigurationHandler instance
Returns:
the id

getRegisteredCorrelator

public static TopologyObjectCorrelator getRegisteredCorrelator(java.lang.String correlatorId)
Gets the registered TopologyObjectCorrelator instance associated with the specified correlatorId.

Parameters:
correlatorId - the correlatorId
Returns:
the TopologyObjectCorrelator instance

setLoggingOptions

public static void setLoggingOptions(boolean enable,
                                     java.lang.String logPath,
                                     java.util.logging.Level level)
                              throws TopologyException
Set the logging options for Topology Service.

Parameters:
enable - turns logging on
logPath - specifies base path for log files
level - specifies the logging level to be applied
Throws:
TopologyException

registerProviderRelationships

public static void registerProviderRelationships(java.net.URL relationshipMapURL)
Register provider relationships using the given XML descriptor file. This method is called by the Eclipse framework as part of processing defined TopologyService extension points.

Parameters:
relationshipMapURL - URL object that points to the XML file conforming to the TopologyObjectCorrelator.xsd schema file

getRegisteredRelationships

public static RelationshipMetaInfo[] getRegisteredRelationships(java.lang.String objectTypeNamespace)
Returns the registered relationships applicable for the given namespace. This method is called by the default TopologyProvider implementation as part of TopologyProvider registration.

Parameters:
objectTypeNamespace - the namespace
Returns:
an aray of RelationshipMetaInfo objects

getLogger

public static TopologyServiceLogger getLogger()
Gets the global TopologyService Logger instance.

Returns:
the Logger instance


© Copyright 2006 IBM Corp. 2006 All Rights Reserved