Package org.apache.uima.pear.tools
Class InstallationDescriptor
- java.lang.Object
-
- org.apache.uima.pear.tools.InstallationDescriptor
-
- All Implemented Interfaces:
java.io.Serializable
public class InstallationDescriptor extends java.lang.Object implements java.io.Serializable
TheInstallationDescriptor
class encapsulates all elements and parameters included in the XML Installation Descriptor file.- See Also:
InstallationDescriptorHandler
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InstallationDescriptor.ActionInfo
TheActionInfo
class defines 'installation action' attributes.static class
InstallationDescriptor.ArgInfo
TheArgInfo
class defines attributes of a service command argument.static class
InstallationDescriptor.ComponentInfo
TheComponentInfo
class defines UIMA component attributes.static class
InstallationDescriptor.ServiceInfo
TheServiceInfo
class defines attributes of a 'service' component.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_DELIMITER
static java.lang.String
VNS_HOST
static java.lang.String
VNS_PORT
static java.lang.String
VNS_SPECS
-
Constructor Summary
Constructors Constructor Description InstallationDescriptor()
Default constructor.InstallationDescriptor(java.io.File insdFile)
Constructor that takes a given original InsD file as an argument.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addDelegateComponent(java.lang.String id, java.lang.String name)
Creates and adds a delegate component specification to the list (for aggregate component).void
addFrameworkSpec(java.lang.String specName, java.lang.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(java.lang.String specName, java.lang.String specValue)
Adds a specification defined by given name and value to the set of OS specifications.protected static java.util.Properties
addProperty(java.util.Properties props, java.lang.String name, java.lang.String value)
Adds a property specified by given name and value to a givenProperties
object.void
addToolkitsSpec(java.lang.String specName, java.lang.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(java.lang.String id)
Removes a specified delegate component associated with a given component ID.void
deleteFrameworkSpec(java.lang.String specName, java.lang.String specValue)
Removes a specification defined by given name and value from the set of Framework specifications.void
deleteInstallationActions(java.lang.String actionName)
Removes all installation actions associated with a given action name (FIND_AND_REPLACE_PATH_ACT or SET_ENV_VARIABLE_ACT).void
deleteOSSpec(java.lang.String specName, java.lang.String specValue)
Removes a specification defined by given name and value from the set of OS specifications.protected static java.util.Properties
deleteProperty(java.util.Properties props, java.lang.String name, java.lang.String value)
Deletes a property specified by given name and value from a givenProperties
object.void
deleteToolkitsSpec(java.lang.String specName, java.lang.String specValue)
Removes a specification defined by given name and value from the set of Toolkits specifications.java.util.Hashtable<java.lang.String,InstallationDescriptor.ComponentInfo>
getDelegateComponents()
java.util.Properties
getFrameworkSpecs()
java.util.Collection<InstallationDescriptor.ActionInfo>
getInstallationActions()
java.util.Collection<InstallationDescriptor.ActionInfo>
getInstallationActions(java.lang.String actionName)
Returns the list of specifiedActionInfo
objects that have a given action name.java.io.File
getInstallationDescriptorFile()
java.lang.String
getMainCasConsumerDesc()
java.lang.String
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.java.lang.String
getMainCasInitializerDesc()
java.lang.String
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.java.lang.String
getMainCollIteratorDesc()
java.lang.String
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.java.lang.String
getMainComponentDeployment()
java.lang.String
getMainComponentDesc()
java.lang.String
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.java.lang.String
getMainComponentId()
java.lang.String
getMainComponentName()
java.util.Properties
getMainComponentNetworkParam(java.lang.String paramName)
java.util.Set<java.lang.String>
getMainComponentNetworkParamNames()
java.util.Properties
getMainComponentProps()
java.lang.String
getMainComponentRoot()
InstallationDescriptor.ServiceInfo
getMainComponentService()
java.util.Properties
getOSSpecs()
protected static java.lang.String
getRelativePathForComponentObject(java.lang.String absolutePath, InstallationDescriptor.ComponentInfo component)
Constructs a relative path of a given component object, based on its absolute path.java.util.Properties
getToolkitsSpecs()
void
setDelegateComponentDesc(java.lang.String id, java.lang.String descFilePath)
Sets a given descriptor file path to a given delegate component.void
setDelegateComponentName(java.lang.String id, java.lang.String name)
Assignes a given name to a given delegate component.void
setDelegateComponentProperty(java.lang.String id, java.lang.String propName, java.lang.String propValue)
Assignes a given property to a given delegate component.void
setDelegateComponentRoot(java.lang.String id, java.lang.String rootDirPath)
Sets a given directory path as the root path for a given delegate component.void
setInstallationDescriptorFile(java.io.File insdFile)
Assignes a given installation descriptor file to this object.void
setMainCasConsumerDesc(java.lang.String descFilePath)
Sets a given main CAS consumer descriptor file.void
setMainCasInitializerDesc(java.lang.String descFilePath)
Sets a given main CAS initializer descriptor file.void
setMainCollIteratorDesc(java.lang.String descFilePath)
Sets a given main Collection iterator descriptor file.void
setMainComponent(java.lang.String id)
Sets a given main component using a given component ID.void
setMainComponent(java.lang.String id, java.lang.String name)
Sets a given main component using given component ID and name.void
setMainComponentDeployment(java.lang.String deplType)
Sets a given main component deployment type:standard
,service
ornetwork
.void
setMainComponentDesc(java.lang.String descFilePath)
Sets a given main component descriptor file.void
setMainComponentId(java.lang.String id)
Replaces existing main component ID with a given new ID.void
setMainComponentName(java.lang.String name)
Sets a given main component name.void
setMainComponentNetworkParam(java.lang.String paramName, java.util.Properties paramSpecs)
Sets a specifications of a given network component parameter.void
setMainComponentProperty(java.lang.String propNname, java.lang.String propValue)
Sets a given main component property.void
setMainComponentRoot(java.lang.String rootDirPath)
Sets a given main component root directory.void
setMainComponentService(InstallationDescriptor.ServiceInfo serviceInfo)
Sets a given main component service specifications.java.lang.String
toString()
void
updateMainComponentId(java.lang.String id)
Deprecated.Use setMainComponentId() method instead.
-
-
-
Field Detail
-
PROPERTY_DELIMITER
public static final java.lang.String PROPERTY_DELIMITER
- See Also:
- Constant Field Values
-
VNS_SPECS
public static final java.lang.String VNS_SPECS
- See Also:
- Constant Field Values
-
VNS_HOST
public static final java.lang.String VNS_HOST
- See Also:
- Constant Field Values
-
VNS_PORT
public static final java.lang.String VNS_PORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
addProperty
protected static java.util.Properties addProperty(java.util.Properties props, java.lang.String name, java.lang.String value)
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
protected static java.util.Properties deleteProperty(java.util.Properties props, java.lang.String name, java.lang.String value)
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 java.lang.String getRelativePathForComponentObject(java.lang.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(java.lang.String id, java.lang.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(java.lang.String specName, java.lang.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(java.lang.String specName, java.lang.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(java.lang.String specName, java.lang.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(java.lang.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(java.lang.String specName, java.lang.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(java.lang.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(java.lang.String specName, java.lang.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(java.lang.String specName, java.lang.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 java.util.Hashtable<java.lang.String,InstallationDescriptor.ComponentInfo> getDelegateComponents()
- Returns:
- The list of the
ComponentInfo
objects that encapsulate specifications of the registered delegate components (for aggregate component).
-
getFrameworkSpecs
public java.util.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 java.util.Collection<InstallationDescriptor.ActionInfo> getInstallationActions()
- Returns:
- The list of the
ActionInfo
objects that encapsulate specifications of all requested installation actions.
-
getInstallationActions
public java.util.Collection<InstallationDescriptor.ActionInfo> getInstallationActions(java.lang.String actionName)
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
public java.io.File getInstallationDescriptorFile()
- Returns:
- The InsD file associated with this object.
-
getMainCasConsumerDesc
public java.lang.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 java.lang.String 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. 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
public java.lang.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 java.lang.String 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. 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
public java.lang.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 java.lang.String 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. 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
public java.lang.String getMainComponentDeployment()
- Returns:
- The specified main component deployment type, or default deployment type (
standard
), if no deployment type specified.
-
getMainComponentDesc
public java.lang.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 java.lang.String 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. 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
public java.lang.String getMainComponentId()
- Returns:
- The specified ID for the main (submitted) component, or
null
if the main component was not specified.
-
getMainComponentName
public java.lang.String getMainComponentName()
- Returns:
- The specified name for the main (submitted) component, or
null
if the main component was not specified.
-
getMainComponentNetworkParam
public java.util.Properties getMainComponentNetworkParam(java.lang.String paramName)
- Parameters:
paramName
- The given network component parameter name.- Returns:
- The specifications of the given network component parameter.
-
getMainComponentNetworkParamNames
public java.util.Set<java.lang.String> getMainComponentNetworkParamNames()
- Returns:
- The
Set
of the network component parameter names.
-
getMainComponentProps
public java.util.Properties getMainComponentProps()
- Returns:
- The specified additional properties of the main (submitted) component, or
null
if the main component was not specified.
-
getMainComponentRoot
public java.lang.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 java.util.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 java.util.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(java.io.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(java.lang.String id, java.lang.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(java.lang.String id, java.lang.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(java.lang.String id, java.lang.String propName, java.lang.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(java.lang.String id, java.lang.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(java.lang.String descFilePath)
Sets a given main CAS consumer descriptor file.- Parameters:
descFilePath
- The given CAS consumer descriptor file path.
-
setMainCasInitializerDesc
public void setMainCasInitializerDesc(java.lang.String descFilePath)
Sets a given main CAS initializer descriptor file.- Parameters:
descFilePath
- The given CAS initializer descriptor file path.
-
setMainCollIteratorDesc
public void setMainCollIteratorDesc(java.lang.String descFilePath)
Sets a given main Collection iterator descriptor file.- Parameters:
descFilePath
- The given Collection iterator descriptor file path.
-
setMainComponent
public void setMainComponent(java.lang.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(java.lang.String id, java.lang.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(java.lang.String deplType)
Sets a given main component deployment type:standard
,service
ornetwork
.- Parameters:
deplType
- The specified deployment type.
-
setMainComponentDesc
public void setMainComponentDesc(java.lang.String descFilePath)
Sets a given main component descriptor file.- Parameters:
descFilePath
- The given main component descriptor file path.
-
setMainComponentId
public void setMainComponentId(java.lang.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(java.lang.String name)
Sets a given main component name.- Parameters:
name
- The given main component name.
-
setMainComponentNetworkParam
public void setMainComponentNetworkParam(java.lang.String paramName, java.util.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(java.lang.String propNname, java.lang.String propValue)
Sets a given main component property.- Parameters:
propNname
- The given property name.propValue
- The given property value.
-
setMainComponentRoot
public void setMainComponentRoot(java.lang.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 forservice
deployment type.- Parameters:
serviceInfo
- The given main component service specifications.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation of the InsD object.
- See Also:
Object.toString()
-
updateMainComponentId
@Deprecated public void updateMainComponentId(java.lang.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.
-
-