com.ibm.adt.topology.handler
Class ProviderInfo

java.lang.Object
  extended by com.ibm.adt.topology.handler.ProviderInfo
All Implemented Interfaces:
java.io.Serializable

public final class ProviderInfo
extends java.lang.Object
implements java.io.Serializable

This class is output from ConfigurationHandler.parseLocation() invocations to specify the type of TopologyProvider that must be instantiatied in order to process the artifacts within a given location. The provider-specific ConfigurationHandler also sets all required initialization properties to be passed in to TopologyProvider.initialize(Properties) as dictated by the provider implementation. This class provides support for passing initialization parameters in the form name/value pairs as well as key/object pairs.

See Also:
ConfigurationHandler.parseLocation(String), TopologyProvider.initialize(ProviderInfo), Serialized Form

Constructor Summary
ProviderInfo(java.lang.String providerId, java.lang.String location)
          Creates a new ProviderInfo instance using the specified providerId and location.
 
Method Summary
 java.lang.String getHandlerId()
          Returns the id of the ConfigurationHandler that created this instance.
 java.lang.String getHandlerLocation()
          Returns the initial location that was specified to the ConfigurationHandler when a provider match was found.
 java.lang.String getInitialLocation()
          Gets the initial location that was given to a ConfigurationHandler.
 java.lang.String getLocation()
          Gets the location associated with this provider.
 java.lang.Object getObject(java.lang.String key)
          Gets an object from the ProviderInfo Object store associated with the specifed key.
 java.util.Properties getProperties()
          Gets the initialization properties to be used when calling TopologyProvider.initialize(Properties).
 java.lang.String getProperty(java.lang.String key)
          Gets a property from the ProviderInfo Properties store.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Gets a property from the ProviderInfo Properties store.
 java.lang.String getProviderId()
          Gets the TopologyProvider id.
 void relocate(java.lang.String src, java.lang.String dst)
          Relocates the artifacts associated with this provider to a different location.
 void serializeToFile(java.lang.String filename)
          Serialize this ProviderInfo instance to the specified file.
(package private)  void setHandlerId(java.lang.String handlerId)
          Saves the id of the ConfigurationHandler instance that created this instance.
(package private)  void setHandlerLocation(java.lang.String handlerLocation)
          Saves the location that was given to the ConfigurationHandler instance that found the provider match.
(package private)  void setInitialLocation(java.lang.String initialLocation)
          Saves the initial location that was given to a ConfigurationHandler.
 void setObject(java.lang.String key, java.lang.Object object)
          Sets an object in the ProviderInfo Object store using the specified key.
 void setProperties(java.util.Properties properties)
          Copies all specified properties to the ProviderInfo property store.
 void setProperty(java.lang.String key, java.lang.String value)
          Sets a property in the ProviderInfo Properties store.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProviderInfo

public ProviderInfo(java.lang.String providerId,
                    java.lang.String location)
Creates a new ProviderInfo instance using the specified providerId and location. Also initializes the provider initialization property and object stores.

Parameters:
providerId - the provider type
location - the location
Method Detail

setHandlerLocation

void setHandlerLocation(java.lang.String handlerLocation)
Saves the location that was given to the ConfigurationHandler instance that found the provider match.

Parameters:
handlerLocation - the handlerLocation to set

setInitialLocation

void setInitialLocation(java.lang.String initialLocation)
Saves the initial location that was given to a ConfigurationHandler. This is useful in those cases where a ConfigurationHandler aggregates other ConfigurationHandlers.

Parameters:
initialLocation - the initialLocation to set

setHandlerId

void setHandlerId(java.lang.String handlerId)
Saves the id of the ConfigurationHandler instance that created this instance.

Parameters:
handlerId - the handlerId to set

getProperties

public java.util.Properties getProperties()
Gets the initialization properties to be used when calling TopologyProvider.initialize(Properties).

See Also:
com.ibm.adt.topology.provider.TopologyProvider#initialize(Properties)

setProperties

public void setProperties(java.util.Properties properties)
Copies all specified properties to the ProviderInfo property store.

Parameters:
properties -

getLocation

public java.lang.String getLocation()
Gets the location associated with this provider.

Returns:
the location

getProviderId

public java.lang.String getProviderId()
Gets the TopologyProvider id.

Returns:
the provider id

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets a property in the ProviderInfo Properties store.

Parameters:
key - the property key
value - the property value

getProperty

public java.lang.String getProperty(java.lang.String key)
Gets a property from the ProviderInfo Properties store.

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

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Gets a property from the ProviderInfo Properties store. If the property is not found, return the defaultValue.

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

setObject

public void setObject(java.lang.String key,
                      java.lang.Object object)
Sets an object in the ProviderInfo Object store using the specified key.

Parameters:
key - the object key
object - the object

getObject

public java.lang.Object getObject(java.lang.String key)
Gets an object from the ProviderInfo Object store associated with the specifed key.

Parameters:
key - the object key
Returns:
the object

serializeToFile

public void serializeToFile(java.lang.String filename)
                     throws java.io.FileNotFoundException,
                            java.io.IOException
Serialize this ProviderInfo instance to the specified file.

Parameters:
filename -
Throws:
java.io.FileNotFoundException
java.io.IOException

relocate

public void relocate(java.lang.String src,
                     java.lang.String dst)
Relocates the artifacts associated with this provider to a different location.

Parameters:
src - the source loaction
dst - the target location

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getHandlerId

public java.lang.String getHandlerId()
Returns the id of the ConfigurationHandler that created this instance.

Returns:
id the id

getInitialLocation

public java.lang.String getInitialLocation()
Gets the initial location that was given to a ConfigurationHandler. This is useful in those cases where a ConfigurationHandler aggregates other ConfigurationHandlers.

Returns:
the initialLocation

getHandlerLocation

public java.lang.String getHandlerLocation()
Returns the initial location that was specified to the ConfigurationHandler when a provider match was found.

Returns:
the handlerLocation


© Copyright 2006 IBM Corp. 2006 All Rights Reserved