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
Modifier and TypeClassDescriptionstatic class
TheActionInfo
class defines 'installation action' attributes.static class
TheArgInfo
class defines attributes of a service command argument.static class
TheComponentInfo
class defines UIMA component attributes.static class
TheServiceInfo
class defines attributes of a 'service' component. -
Field Summary
-
Constructor Summary
ConstructorDescriptionDefault constructor.InstallationDescriptor
(File insdFile) Constructor that takes a given original InsD file as an argument. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Adds a specified 'installation action' to the list.void
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 givenProperties
object.void
addToolkitsSpec
(String specName, String specValue) Adds a specification defined by given name and value to the set of Toolkits specifications.void
Removes all specified delegate components.void
Removes all Framework specifications.void
Removes all specified installation actions.void
Removes all OS specifications.void
Removes all Toolkits specifications.void
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 givenProperties
object.void
deleteToolkitsSpec
(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 specifiedActionInfo
objects 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 String
getRelativePathForComponentObject
(String absolutePath, InstallationDescriptor.ComponentInfo component) Constructs a relative path of a given component object, based on its absolute path.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
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
ornetwork
.void
setMainComponentDesc
(String descFilePath) Sets a given main component descriptor file.void
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
Sets a given main component service specifications.toString()
void
Deprecated.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 givenProperties
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 givenProperties
object to be modified.name
- The given property name.value
- The given new value of the property.- Returns:
- The modified
Properties
object.
-
deleteProperty
Deletes a property specified by given name and value from a givenProperties
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 givenProperties
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
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
ComponentInfo
objects 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
ActionInfo
objects that encapsulate specifications of all requested installation actions.
-
getInstallationActions
Returns the list of specifiedActionInfo
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
- 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
null
if 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
null
if 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
null
if 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
null
if the main component was not specified.
-
getMainComponentName
- Returns:
- The specified name for the main (submitted) component, or
null
if 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
Set
of the network component parameter names.
-
getMainComponentProps
- Returns:
- The specified additional properties of the main (submitted) component, or
null
if the main component was not specified.
-
getMainComponentRoot
- Returns:
- The specified root directory path for the main (submitted) component, or
null
if 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
,service
ornetwork
.- 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 forservice
deployment 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.
-