Class CPMUtils
java.lang.Object
org.apache.uima.collection.impl.cpm.utils.CPMUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertToAbsolutePath
(String aSystemVar, String aExpr, String aPathToConvert) static void
dumpEvents
(ProcessTrace aPTr) Dumps all events in the process trace objectprivate static String
extractText
(Node aNode) Finds a node with a given path and returns its textual valuestatic long
extractTime
(ProcessTrace aPT, String eventName) Returns the total duration of a given eventstatic File
findDeployDirectory
(String aServiceName) static ChunkMetadata
getChunkMetadata
(CAS aCas) Extract metadata associated with chunk from a given CAS.private static ConfigurableFeature
getConfigurableFeature
(Node entityNode) private static File[]
static int
getFeatureAsInt
(CAS aCas, Feature aFeature, String aName) static String
getFeatureAsString
(CAS aCas, Feature aFeature, String aName) Returns a value associated with a given featureprivate static ArrayList
getFeatures
(Node attributesNode) static String[]
getKeys2Drop
(String aKeyDropMapFile) Currently, this returns initialized array of Strings.private static String
getTextValue
(NodeList aList) Returns text associated with TEXT_NODE elementstatic UimaTimer
getTimer()
static UimaTimer
Return timer to measure performace of the cpm.static String
scrubThePath
(String value) Finds an occurance of the ##CPM_HOME in a value parameter and returns it with an expanded form (ie.c:/cpm/...) based on the env variable CPM_HOME.static void
-
Field Details
-
CPM_LOG_RESOURCE_BUNDLE
- See Also:
-
timer
-
-
Constructor Details
-
CPMUtils
public CPMUtils()
-
-
Method Details
-
getKeys2Drop
Currently, this returns initialized array of Strings.- Parameters:
aKeyDropMapFile
- - a file containing a list of features that should be removed from CAS being sent to Cas Processor. Currently not used.- Returns:
- - Array of empty Strings
- Throws:
ResourceConfigurationException
- -
-
setTimer
- Parameters:
aTimer
-
-
getTimer
- Returns:
- the timer
-
convertToAbsolutePath
- Parameters:
aSystemVar
-aExpr
-aPathToConvert
-- Returns:
- absolute path
-
getTimer
Return timer to measure performace of the cpm. The timer can optionally be configured in the CPE descriptor. If none defined, the method returns default timer.- Returns:
- - customer timer or JavaTimer (default)
- Throws:
Exception
- -
-
extractTime
Returns the total duration of a given event- Parameters:
aPT
- - Event containereventName
- - name of the event for which the time is needed- Returns:
- - total duration of an event
-
dumpEvents
Dumps all events in the process trace object- Parameters:
aPTr
- - event container
-
scrubThePath
Finds an occurance of the ##CPM_HOME in a value parameter and returns it with an expanded form (ie.c:/cpm/...) based on the env variable CPM_HOME. -
extractText
Finds a node with a given path and returns its textual value- Parameters:
path
- String - XPath path to a node- Returns:
- textual value of a node indicated in the XPath path
- Throws:
Exception
-
getConfigurableFeature
private static ConfigurableFeature getConfigurableFeature(Node entityNode) throws ConfigurationException - Parameters:
entityNode
-- Returns:
- a configurable feature
- Throws:
ConfigurationException
- -
-
getTextValue
Returns text associated with TEXT_NODE element- Parameters:
aList
- - list of elements- Returns:
- - Text
-
getFeatures
- Parameters:
attributesNode
-- Returns:
- a list of features
- Throws:
ConfigurationException
- -
-
findDeployDirectory
- Parameters:
aServiceName
-- Returns:
- the deploy directory
- Throws:
Exception
- -
-
getDirectories
- Returns:
- an array of directories
- Throws:
Exception
- -
-
getFeatureAsInt
- Throws:
Exception
-
getFeatureAsString
Returns a value associated with a given feature- Parameters:
aCas
- - Cas containing data to extractaFeature
- - feature to locate in the CASaName
- - name of the feature- Returns:
- - value as String
- Throws:
Exception
-
getChunkMetadata
Extract metadata associated with chunk from a given CAS.- Parameters:
aCas
- - Cas to extract chunk metadata from- Returns:
- - chunk metadata
-