org.apache.uima.pear.tools
Class InstallationDescriptor

java.lang.Object
  extended by org.apache.uima.pear.tools.InstallationDescriptor
All Implemented Interfaces:
Serializable

public class InstallationDescriptor
extends Object
implements Serializable

The InstallationDescriptor class encapsulates all elements and parameters included in the XML Installation Descriptor file.

See Also:
InstallationDescriptorHandler, Serialized Form

Nested Class Summary
static class InstallationDescriptor.ActionInfo
          The ActionInfo class defines 'installation action' attributes.
static class InstallationDescriptor.ArgInfo
          The ArgInfo class defines attributes of a service command argument.
static class InstallationDescriptor.ComponentInfo
          The ComponentInfo class defines UIMA component attributes.
static class InstallationDescriptor.ServiceInfo
          The ServiceInfo class defines attributes of a 'service' component.
 
Field Summary
static String PROPERTY_DELIMITER
           
static String VNS_HOST
           
static String VNS_PORT
           
static String VNS_SPECS
           
 
Constructor Summary
InstallationDescriptor()
          Default constructor.
InstallationDescriptor(File insdFile)
          Constructor that takes a given original InsD file as an argument.
 
Method Summary
 void addDelegateComponent(String id, String name)
          Creates and adds a delegate component specification to the list (for aggregate component).
 void addFrameworkSpec(String specName, String specValue)
          Adds a specification defined by given name and value to the set of Framework specifications.
 void addInstallationAction(InstallationDescriptor.ActionInfo action)
          Adds a specified 'installation action' to the list.
 void addOSSpec(String specName, String specValue)
          Adds a specification defined by given name and value to the set of OS specifications.
protected static Properties addProperty(Properties props, String name, String value)
          Adds a property specified by given name and value to a given Properties object.
 void addToolkitsSpec(String specName, String specValue)
          Adds a specification defined by given name and value to the set of Toolkits specifications.
 void clearDelegateComponents()
          Removes all specified delegate components.
 void clearFrameworkSpecs()
          Removes all Framework specifications.
 void clearInstallationActions()
          Removes all specified installation actions.
 void clearOSSpecs()
          Removes all OS specifications.
 void clearToolkitsSpecs()
          Removes all Toolkits specifications.
 void deleteDelegateComponent(String id)
          Removes a specified delegate component associated with a given component ID.
 void deleteFrameworkSpec(String specName, String specValue)
          Removes a specification defined by given name and value from the set of Framework specifications.
 void deleteInstallationActions(String actionName)
          Removes all installation actions associated with a given action name (FIND_AND_REPLACE_PATH_ACT or SET_ENV_VARIABLE_ACT).
 void deleteOSSpec(String specName, String specValue)
          Removes a specification defined by given name and value from the set of OS specifications.
protected static Properties deleteProperty(Properties props, String name, String value)
          Deletes a property specified by given name and value from a given Properties object.
 void deleteToolkitsSpec(String specName, String specValue)
          Removes a specification defined by given name and value from the set of Toolkits specifications.
 Hashtable<String,InstallationDescriptor.ComponentInfo> getDelegateComponents()
           
 Properties getFrameworkSpecs()
           
 Collection<InstallationDescriptor.ActionInfo> getInstallationActions()
           
 Collection<InstallationDescriptor.ActionInfo> getInstallationActions(String actionName)
          Returns the list of specified ActionInfo objects that have a given action name.
 File getInstallationDescriptorFile()
           
 String getMainCasConsumerDesc()
           
 String getMainCasConsumerDesc(boolean relativePath)
          Returns absolute or relative path to the specified CAS Consumer descriptor for the main (submitted) component, or null, if the main component was not specified.
 String getMainCasInitializerDesc()
           
 String getMainCasInitializerDesc(boolean relativePath)
          Returns absolute or relative path to the specified CAS Initializer descriptor for the main (submitted) component, or null, if the main component was not specified.
 String getMainCollIteratorDesc()
           
 String getMainCollIteratorDesc(boolean relativePath)
          Returns absolute or relative path to the specified Collection Iterator descriptor for the main (submitted) component, or null, if the main component was not specified.
 String getMainComponentDeployment()
           
 String getMainComponentDesc()
           
 String getMainComponentDesc(boolean relativePath)
          Returns absolute or relative path to the specified XML AE descriptor for the main (submitted) component, or null, if the main component was not specified.
 String getMainComponentId()
           
 String getMainComponentName()
           
 Properties getMainComponentNetworkParam(String paramName)
           
 Set<String> getMainComponentNetworkParamNames()
           
 Properties getMainComponentProps()
           
 String getMainComponentRoot()
           
 InstallationDescriptor.ServiceInfo getMainComponentService()
           
 Properties getOSSpecs()
           
protected static String getRelativePathForComponentObject(String absolutePath, InstallationDescriptor.ComponentInfo component)
          Constructs a relative path of a given component object, based on its absolute path.
 Properties getToolkitsSpecs()
           
 void setDelegateComponentDesc(String id, String descFilePath)
          Sets a given descriptor file path to a given delegate component.
 void setDelegateComponentName(String id, String name)
          Assignes a given name to a given delegate component.
 void setDelegateComponentProperty(String id, String propName, String propValue)
          Assignes a given property to a given delegate component.
 void setDelegateComponentRoot(String id, String rootDirPath)
          Sets a given directory path as the root path for a given delegate component.
 void setInstallationDescriptorFile(File insdFile)
          Assignes a given installation descriptor file to this object.
 void setMainCasConsumerDesc(String descFilePath)
          Sets a given main CAS consumer descriptor file.
 void setMainCasInitializerDesc(String descFilePath)
          Sets a given main CAS initializer descriptor file.
 void setMainCollIteratorDesc(String descFilePath)
          Sets a given main Collection iterator descriptor file.
 void setMainComponent(String id)
          Sets a given main component using a given component ID.
 void setMainComponent(String id, String name)
          Sets a given main component using given component ID and name.
 void setMainComponentDeployment(String deplType)
          Sets a given main component deployment type: standard, service or network.
 void setMainComponentDesc(String descFilePath)
          Sets a given main component descriptor file.
 void setMainComponentId(String id)
          Replaces existing main component ID with a given new ID.
 void setMainComponentName(String name)
          Sets a given main component name.
 void setMainComponentNetworkParam(String paramName, Properties paramSpecs)
          Sets a specifications of a given network component parameter.
 void setMainComponentProperty(String propNname, String propValue)
          Sets a given main component property.
 void setMainComponentRoot(String rootDirPath)
          Sets a given main component root directory.
 void setMainComponentService(InstallationDescriptor.ServiceInfo serviceInfo)
          Sets a given main component service specifications.
 String toString()
           
 void updateMainComponentId(String id)
          Deprecated. Use setMainComponentId() method instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_DELIMITER

public static final String PROPERTY_DELIMITER
See Also:
Constant Field Values

VNS_SPECS

public static final String VNS_SPECS
See Also:
Constant Field Values

VNS_HOST

public static final String VNS_HOST
See Also:
Constant Field Values

VNS_PORT

public static final String VNS_PORT
See Also:
Constant Field Values
Constructor Detail

InstallationDescriptor

public InstallationDescriptor()
Default constructor.


InstallationDescriptor

public InstallationDescriptor(File insdFile)
Constructor that takes a given original InsD file as an argument.

Parameters:
insdFile - The given original InsD file.
Method Detail

addProperty

protected static Properties addProperty(Properties props,
                                        String name,
                                        String value)
Adds a property specified by given name and value to a given Properties object. If the given object already contains a property with the given name, adds a new value to this property using PROPERTY_DELIMITER as the delimiter, unless the existing property value list already contains the given new value.

Parameters:
props - The given Properties object to be modified.
name - The given property name.
value - The given new value of the property.
Returns:
The modified Properties object.

deleteProperty

protected static Properties deleteProperty(Properties props,
                                           String name,
                                           String value)
Deletes a property specified by given name and value from a given Properties object. If the given object contains one or more PROPERTY_DELIMITER separated values under the given property name, removes the value that is equal to the specified value. If no values remain under the given name, removes the property associated with the specified name from the given object.

Parameters:
props - The given Properties object to be modified.
name - The given property name.
value - The given new value of the property.
Returns:
The modified Properties object.

getRelativePathForComponentObject

protected static String getRelativePathForComponentObject(String absolutePath,
                                                          InstallationDescriptor.ComponentInfo component)
Constructs a relative path of a given component object, based on its absolute path.

Parameters:
absolutePath - The given absolute path of the object.
component - The given component instance.
Returns:
The relative path of the given component object.

addDelegateComponent

public void addDelegateComponent(String id,
                                 String name)
Creates and adds a delegate component specification to the list (for aggregate component).

Parameters:
id - The given delegate component ID.
name - The given delegate component name.

addFrameworkSpec

public void addFrameworkSpec(String specName,
                             String specValue)
Adds a specification defined by given name and value to the set of Framework specifications. If the Framework specifications already contain the given name, adds a new value using PROPERTY_DELIMITER as the delimiter.

Parameters:
specName - The given specification name.
specValue - The given specification value.

addInstallationAction

public void addInstallationAction(InstallationDescriptor.ActionInfo action)
Adds a specified 'installation action' to the list.

Parameters:
action - The specified 'installation action' object.

addOSSpec

public void addOSSpec(String specName,
                      String specValue)
Adds a specification defined by given name and value to the set of OS specifications. If the OS specifications already contain the given name, adds a new value using PROPERTY_DELIMITER as the delimiter.

Parameters:
specName - The given specification name.
specValue - The given specification value.

addToolkitsSpec

public void addToolkitsSpec(String specName,
                            String specValue)
Adds a specification defined by given name and value to the set of Toolkits specifications. If the Toolkits specifications already contain the given name, adds a new value using PROPERTY_DELIMITER as the delimiter.

Parameters:
specName - The given specification name.
specValue - The given specification value.

clearDelegateComponents

public void clearDelegateComponents()
Removes all specified delegate components.


clearFrameworkSpecs

public void clearFrameworkSpecs()
Removes all Framework specifications.


clearInstallationActions

public void clearInstallationActions()
Removes all specified installation actions.


clearOSSpecs

public void clearOSSpecs()
Removes all OS specifications.


clearToolkitsSpecs

public void clearToolkitsSpecs()
Removes all Toolkits specifications.


deleteDelegateComponent

public void deleteDelegateComponent(String id)
Removes a specified delegate component associated with a given component ID.

Parameters:
id - The given delegate component ID to be removed.

deleteFrameworkSpec

public void deleteFrameworkSpec(String specName,
                                String specValue)
Removes a specification defined by given name and value from the set of Framework specifications.

Parameters:
specName - The given specification name.
specValue - The given specification value.

deleteInstallationActions

public void deleteInstallationActions(String actionName)
Removes all installation actions associated with a given action name (FIND_AND_REPLACE_PATH_ACT or SET_ENV_VARIABLE_ACT).

Parameters:
actionName - The given action name.

deleteOSSpec

public void deleteOSSpec(String specName,
                         String specValue)
Removes a specification defined by given name and value from the set of OS specifications.

Parameters:
specName - The given specification name.
specValue - The given specification value.

deleteToolkitsSpec

public void deleteToolkitsSpec(String specName,
                               String specValue)
Removes a specification defined by given name and value from the set of Toolkits specifications.

Parameters:
specName - The given specification name.
specValue - The given specification value.

getDelegateComponents

public Hashtable<String,InstallationDescriptor.ComponentInfo> getDelegateComponents()
Returns:
The list of the ComponentInfo objects that encapsulate specifications of the registered delegate components (for aggregate component).

getFrameworkSpecs

public Properties getFrameworkSpecs()
Returns:
The specifications of the UIMA framework - (key, value) pairs. Value may contain one string or a list of strings, separated by PROPERTY_DELIMITER.

getInstallationActions

public Collection<InstallationDescriptor.ActionInfo> getInstallationActions()
Returns:
The list of the ActionInfo objects that encapsulate specifications of all requested installation actions.

getInstallationActions

public Collection<InstallationDescriptor.ActionInfo> getInstallationActions(String actionName)
Returns the list of specified ActionInfo objects that have a given action name.

Parameters:
actionName - The given action name.
Returns:
The list of the ActionInfo objects that have the given action name.

getInstallationDescriptorFile

public File getInstallationDescriptorFile()
Returns:
The InsD file associated with this object.

getMainCasConsumerDesc

public String getMainCasConsumerDesc()
Returns:
Absolute path to the specified CAS Consumer descriptor for the main (submitted) component, or null, if the main component was not specified.

getMainCasConsumerDesc

public String getMainCasConsumerDesc(boolean relativePath)
Returns absolute or relative path to the specified CAS Consumer descriptor for the main (submitted) component, or null, if the main component was not specified. If the relative path is requested, returns the path relative to the main component root dir.

Parameters:
relativePath - If true, returns relative path, otherwise returns absolute path.
Returns:
Absolute or relative path to the specified CAS Consumer descriptor for the main (submitted) component, or null, if the main component was not specified.

getMainCasInitializerDesc

public String getMainCasInitializerDesc()
Returns:
Absolute path to the specified CAS Initializer descriptor for the main (submitted) component, or null if the main component was not specified.

getMainCasInitializerDesc

public String getMainCasInitializerDesc(boolean relativePath)
Returns absolute or relative path to the specified CAS Initializer descriptor for the main (submitted) component, or null, if the main component was not specified. If the relative path is requested, returns the path relative to the main component root dir.

Parameters:
relativePath - If true, returns relative path, otherwise returns absolute path.
Returns:
Absolute or relative path to the specified CAS Initializer descriptor for the main (submitted) component, or null, if the main component was not specified.

getMainCollIteratorDesc

public String getMainCollIteratorDesc()
Returns:
Absolute path to the specified Collection Iterator descriptor for the main (submitted) component, or null if the main component was not specified.

getMainCollIteratorDesc

public String getMainCollIteratorDesc(boolean relativePath)
Returns absolute or relative path to the specified Collection Iterator descriptor for the main (submitted) component, or null, if the main component was not specified. If the relative path is requested, returns the path relative to the main component root dir.

Parameters:
relativePath - If true, returns relative path, otherwise returns absolute path.
Returns:
Absolute or relative path to the specified Collection Iterator descriptor for the main (submitted) component, or null, if the main component was not specified.

getMainComponentDeployment

public String getMainComponentDeployment()
Returns:
The specified main component deployment type, or default deployment type (standard), if no deployment type specified.

getMainComponentDesc

public String getMainComponentDesc()
Returns:
Absolute path to the specified XML AE descriptor for the main (submitted) component, or null if the main component was not specified.

getMainComponentDesc

public String getMainComponentDesc(boolean relativePath)
Returns absolute or relative path to the specified XML AE descriptor for the main (submitted) component, or null, if the main component was not specified. If the relative path is requested, returns the path relative to the main component root dir.

Parameters:
relativePath - If true, returns relative path, otherwise returns absolute path.
Returns:
Absolute or relative path to the specified XML AE descriptor for the main (submitted) component, or null, if the main component was not specified.

getMainComponentId

public String getMainComponentId()
Returns:
The specified ID for the main (submitted) component, or null if the main component was not specified.

getMainComponentName

public String getMainComponentName()
Returns:
The specified name for the main (submitted) component, or null if the main component was not specified.

getMainComponentNetworkParam

public Properties getMainComponentNetworkParam(String paramName)
Parameters:
paramName - The given network component parameter name.
Returns:
The specifications of the given network component parameter.

getMainComponentNetworkParamNames

public Set<String> getMainComponentNetworkParamNames()
Returns:
The Set of the network component parameter names.

getMainComponentProps

public Properties getMainComponentProps()
Returns:
The specified additional properties of the main (submitted) component, or null if the main component was not specified.

getMainComponentRoot

public String getMainComponentRoot()
Returns:
The specified root directory path for the main (submitted) component, or null if the main component was not specified.

getMainComponentService

public InstallationDescriptor.ServiceInfo getMainComponentService()
Returns:
Main component service specifications, if specified.

getOSSpecs

public Properties getOSSpecs()
Returns:
The specified attributes of the OS environment - (name, value) pairs. Value may contain one string or a list of strings, separated by PROPERTY_DELIMITER.

getToolkitsSpecs

public Properties getToolkitsSpecs()
Returns:
The specified attributes of the standard system toolkits - (name, value) pairs. Value may contain one string or a list of strings, separated by PROPERTY_DELIMITER.

setInstallationDescriptorFile

public void setInstallationDescriptorFile(File insdFile)
Assignes a given installation descriptor file to this object. This method does not perform parsing of the file.

Parameters:
insdFile - The given installation descriptor file.

setDelegateComponentDesc

public void setDelegateComponentDesc(String id,
                                     String descFilePath)
Sets a given descriptor file path to a given delegate component.

Parameters:
id - The given delegate component ID.
descFilePath - The given descriptor file path.

setDelegateComponentName

public void setDelegateComponentName(String id,
                                     String name)
Assignes a given name to a given delegate component.

Parameters:
id - The given delegate component ID.
name - The given delegate component name.

setDelegateComponentProperty

public void setDelegateComponentProperty(String id,
                                         String propName,
                                         String propValue)
Assignes a given property to a given delegate component.

Parameters:
id - The given delegate component ID.
propName - The given property name.
propValue - The given property value.

setDelegateComponentRoot

public void setDelegateComponentRoot(String id,
                                     String rootDirPath)
Sets a given directory path as the root path for a given delegate component.

Parameters:
id - The given delegate component ID.
rootDirPath - The given root directory path.

setMainCasConsumerDesc

public void setMainCasConsumerDesc(String descFilePath)
Sets a given main CAS consumer descriptor file.

Parameters:
descFilePath - The given CAS consumer descriptor file path.

setMainCasInitializerDesc

public void setMainCasInitializerDesc(String descFilePath)
Sets a given main CAS initializer descriptor file.

Parameters:
descFilePath - The given CAS initializer descriptor file path.

setMainCollIteratorDesc

public void setMainCollIteratorDesc(String descFilePath)
Sets a given main Collection iterator descriptor file.

Parameters:
descFilePath - The given Collection iterator descriptor file path.

setMainComponent

public void setMainComponent(String id)
Sets a given main component using a given component ID. This method creates a new main component instance, overriding all previously set attributes of the main component.

Parameters:
id - The given main component ID.

setMainComponent

public void setMainComponent(String id,
                             String name)
Sets a given main component using given component ID and name. This method creates a new main component instance, overriding all previously set attributes of the main component.

Parameters:
id - The given main component ID.
name - The given main component name.

setMainComponentDeployment

public void setMainComponentDeployment(String deplType)
Sets a given main component deployment type: standard, service or network.

Parameters:
deplType - The specified deployment type.

setMainComponentDesc

public void setMainComponentDesc(String descFilePath)
Sets a given main component descriptor file.

Parameters:
descFilePath - The given main component descriptor file path.

setMainComponentId

public void setMainComponentId(String id)
Replaces existing main component ID with a given new ID.

Parameters:
id - The given new ID of the main component.

setMainComponentName

public void setMainComponentName(String name)
Sets a given main component name.

Parameters:
name - The given main component name.

setMainComponentNetworkParam

public void setMainComponentNetworkParam(String paramName,
                                         Properties paramSpecs)
Sets a specifications of a given network component parameter.

Parameters:
paramName - The given network component parameter name.
paramSpecs - The specifications of the given network component parameter.

setMainComponentProperty

public void setMainComponentProperty(String propNname,
                                     String propValue)
Sets a given main component property.

Parameters:
propNname - The given property name.
propValue - The given property value.

setMainComponentRoot

public void setMainComponentRoot(String rootDirPath)
Sets a given main component root directory.

Parameters:
rootDirPath - The given main component root directory path.

setMainComponentService

public void setMainComponentService(InstallationDescriptor.ServiceInfo serviceInfo)
Sets a given main component service specifications. The service specifications are valid only for service deployment type.

Parameters:
serviceInfo - The given main component service specifications.

toString

public String toString()
Overrides:
toString in class Object
Returns:
String representation of the InsD object.
See Also:
Object.toString()

updateMainComponentId

@Deprecated
public void updateMainComponentId(String id)
Deprecated. Use setMainComponentId() method instead.

Replaces existing main component ID with a given new ID.

Parameters:
id - The given new ID of the main component.


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.