Package org.apache.uima.pear.tools
Class InstallationDescriptor
java.lang.Object
org.apache.uima.pear.tools.InstallationDescriptor
- All Implemented Interfaces:
Serializable
The
InstallationDescriptor class encapsulates all elements and parameters included
in the XML Installation Descriptor file.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTheActionInfoclass defines 'installation action' attributes.static classTheArgInfoclass defines attributes of a service command argument.static classTheComponentInfoclass defines UIMA component attributes.static classTheServiceInfoclass defines attributes of a 'service' component. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.InstallationDescriptor(File insdFile) Constructor that takes a given original InsD file as an argument. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDelegateComponent(String id, String name) Creates and adds a delegate component specification to the list (for aggregate component).voidaddFrameworkSpec(String specName, String specValue) Adds a specification defined by given name and value to the set of Framework specifications.voidAdds a specified 'installation action' to the list.voidAdds a specification defined by given name and value to the set of OS specifications.protected static PropertiesaddProperty(Properties props, String name, String value) Adds a property specified by given name and value to a givenPropertiesobject.voidaddToolkitsSpec(String specName, String specValue) Adds a specification defined by given name and value to the set of Toolkits specifications.voidRemoves all specified delegate components.voidRemoves all Framework specifications.voidRemoves all specified installation actions.voidRemoves all OS specifications.voidRemoves all Toolkits specifications.voidRemoves a specified delegate component associated with a given component ID.voiddeleteFrameworkSpec(String specName, String specValue) Removes a specification defined by given name and value from the set of Framework specifications.voiddeleteInstallationActions(String actionName) Removes all installation actions associated with a given action name (FIND_AND_REPLACE_PATH_ACT or SET_ENV_VARIABLE_ACT).voiddeleteOSSpec(String specName, String specValue) Removes a specification defined by given name and value from the set of OS specifications.protected static PropertiesdeleteProperty(Properties props, String name, String value) Deletes a property specified by given name and value from a givenPropertiesobject.voiddeleteToolkitsSpec(String specName, String specValue) Removes a specification defined by given name and value from the set of Toolkits specifications.getInstallationActions(String actionName) Returns the list of specifiedActionInfoobjects that have a given action name.getMainCasConsumerDesc(boolean relativePath) Returns absolute or relative path to the specified CAS Consumer descriptor for the main (submitted) component, ornull, if the main component was not specified.getMainCasInitializerDesc(boolean relativePath) Returns absolute or relative path to the specified CAS Initializer descriptor for the main (submitted) component, ornull, if the main component was not specified.getMainCollIteratorDesc(boolean relativePath) Returns absolute or relative path to the specified Collection Iterator descriptor for the main (submitted) component, ornull, if the main component was not specified.getMainComponentDesc(boolean relativePath) Returns absolute or relative path to the specified XML AE descriptor for the main (submitted) component, ornull, if the main component was not specified.getMainComponentNetworkParam(String paramName) protected static StringgetRelativePathForComponentObject(String absolutePath, InstallationDescriptor.ComponentInfo component) Constructs a relative path of a given component object, based on its absolute path.voidsetDelegateComponentDesc(String id, String descFilePath) Sets a given descriptor file path to a given delegate component.voidsetDelegateComponentName(String id, String name) Assignes a given name to a given delegate component.voidsetDelegateComponentProperty(String id, String propName, String propValue) Assignes a given property to a given delegate component.voidsetDelegateComponentRoot(String id, String rootDirPath) Sets a given directory path as the root path for a given delegate component.voidsetInstallationDescriptorFile(File insdFile) Assignes a given installation descriptor file to this object.voidsetMainCasConsumerDesc(String descFilePath) Sets a given main CAS consumer descriptor file.voidsetMainCasInitializerDesc(String descFilePath) Sets a given main CAS initializer descriptor file.voidsetMainCollIteratorDesc(String descFilePath) Sets a given main Collection iterator descriptor file.voidSets a given main component using a given component ID.voidsetMainComponent(String id, String name) Sets a given main component using given component ID and name.voidsetMainComponentDeployment(String deplType) Sets a given main component deployment type:standard,serviceornetwork.voidsetMainComponentDesc(String descFilePath) Sets a given main component descriptor file.voidReplaces existing main component ID with a given new ID.voidsetMainComponentName(String name) Sets a given main component name.voidsetMainComponentNetworkParam(String paramName, Properties paramSpecs) Sets a specifications of a given network component parameter.voidsetMainComponentProperty(String propNname, String propValue) Sets a given main component property.voidsetMainComponentRoot(String rootDirPath) Sets a given main component root directory.voidSets a given main component service specifications.toString()voidDeprecated.Use setMainComponentId() method instead.
-
Field Details
-
PROPERTY_DELIMITER
- See Also:
-
VNS_SPECS
- See Also:
-
VNS_HOST
- See Also:
-
VNS_PORT
- See Also:
-
-
Constructor Details
-
InstallationDescriptor
public InstallationDescriptor()Default constructor. -
InstallationDescriptor
Constructor that takes a given original InsD file as an argument.- Parameters:
insdFile- The given original InsD file.
-
-
Method Details
-
addProperty
Adds a property specified by given name and value to a givenPropertiesobject. 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 givenPropertiesobject to be modified.name- The given property name.value- The given new value of the property.- Returns:
- The modified
Propertiesobject.
-
deleteProperty
Deletes a property specified by given name and value from a givenPropertiesobject. 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 givenPropertiesobject to be modified.name- The given property name.value- The given new value of the property.- Returns:
- The modified
Propertiesobject.
-
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
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
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
Adds a specified 'installation action' to the list.- Parameters:
action- The specified 'installation action' object.
-
addOSSpec
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
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
Removes a specified delegate component associated with a given component ID.- Parameters:
id- The given delegate component ID to be removed.
-
deleteFrameworkSpec
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
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
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
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
- Returns:
- The list of the
ComponentInfoobjects that encapsulate specifications of the registered delegate components (for aggregate component).
-
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
- Returns:
- The list of the
ActionInfoobjects that encapsulate specifications of all requested installation actions.
-
getInstallationActions
Returns the list of specifiedActionInfoobjects that have a given action name.- Parameters:
actionName- The given action name.- Returns:
- The list of the
ActionInfoobjects that have the given action name.
-
getInstallationDescriptorFile
- Returns:
- The InsD file associated with this object.
-
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
Returns absolute or relative path to the specified CAS Consumer descriptor for the main (submitted) component, ornull, 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- Iftrue, 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
- Returns:
- Absolute path to the specified CAS Initializer descriptor for the main (submitted)
component, or
nullif the main component was not specified.
-
getMainCasInitializerDesc
Returns absolute or relative path to the specified CAS Initializer descriptor for the main (submitted) component, ornull, 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- Iftrue, 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
- Returns:
- Absolute path to the specified Collection Iterator descriptor for the main (submitted)
component, or
nullif the main component was not specified.
-
getMainCollIteratorDesc
Returns absolute or relative path to the specified Collection Iterator descriptor for the main (submitted) component, ornull, 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- Iftrue, 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
- Returns:
- The specified main component deployment type, or default deployment type
(
standard), if no deployment type specified.
-
getMainComponentDesc
- Returns:
- Absolute path to the specified XML AE descriptor for the main (submitted) component, or
nullif the main component was not specified.
-
getMainComponentDesc
Returns absolute or relative path to the specified XML AE descriptor for the main (submitted) component, ornull, 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- Iftrue, 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
- Returns:
- The specified ID for the main (submitted) component, or
nullif the main component was not specified.
-
getMainComponentName
- Returns:
- The specified name for the main (submitted) component, or
nullif the main component was not specified.
-
getMainComponentNetworkParam
- Parameters:
paramName- The given network component parameter name.- Returns:
- The specifications of the given network component parameter.
-
getMainComponentNetworkParamNames
- Returns:
- The
Setof the network component parameter names.
-
getMainComponentProps
- Returns:
- The specified additional properties of the main (submitted) component, or
nullif the main component was not specified.
-
getMainComponentRoot
- Returns:
- The specified root directory path for the main (submitted) component, or
nullif the main component was not specified.
-
getMainComponentService
- Returns:
- Main component service specifications, if specified.
-
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
- 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
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
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
Assignes a given name to a given delegate component.- Parameters:
id- The given delegate component ID.name- The given delegate component name.
-
setDelegateComponentProperty
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
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
Sets a given main CAS consumer descriptor file.- Parameters:
descFilePath- The given CAS consumer descriptor file path.
-
setMainCasInitializerDesc
Sets a given main CAS initializer descriptor file.- Parameters:
descFilePath- The given CAS initializer descriptor file path.
-
setMainCollIteratorDesc
Sets a given main Collection iterator descriptor file.- Parameters:
descFilePath- The given Collection iterator descriptor file path.
-
setMainComponent
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
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
Sets a given main component deployment type:standard,serviceornetwork.- Parameters:
deplType- The specified deployment type.
-
setMainComponentDesc
Sets a given main component descriptor file.- Parameters:
descFilePath- The given main component descriptor file path.
-
setMainComponentId
Replaces existing main component ID with a given new ID.- Parameters:
id- The given new ID of the main component.
-
setMainComponentName
Sets a given main component name.- Parameters:
name- The given main component name.
-
setMainComponentNetworkParam
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
Sets a given main component property.- Parameters:
propNname- The given property name.propValue- The given property value.
-
setMainComponentRoot
Sets a given main component root directory.- Parameters:
rootDirPath- The given main component root directory path.
-
setMainComponentService
Sets a given main component service specifications. The service specifications are valid only forservicedeployment type.- Parameters:
serviceInfo- The given main component service specifications.
-
toString
-
updateMainComponentId
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.
-