com.xmatters.ibm.tivoli.util
Class BaseUtil

java.lang.Object
  extended by com.xmatters.ibm.tivoli.util.BaseUtil
Direct Known Subclasses:
IncidentUtil, SyncUtil

public class BaseUtil
extends java.lang.Object

Contains methods common to all configuration utility classes.

Author:
bneate

Nested Class Summary
 class BaseUtil.ResourceResolver
          Inner Class to implement a URIResolver to allow the Transformer to resolve the location of included XSL data in the transform stylesheets
 class BaseUtil.TransformerErrorListener
          Inner Class to implement an ErrorListener to handle transformation errors and log them
 
Field Summary
static java.lang.String CONFIGURATION_PATH
           
protected  boolean configured
           
protected  org.apache.log4j.Logger logger
           
static java.lang.String PROPERTIES_FILE
           
 
Constructor Summary
BaseUtil()
           
 
Method Summary
 org.dom4j.Element addElement(org.dom4j.Element parent, java.lang.String name)
          Adds an element containing the specified text to the parent
 org.dom4j.Element addElement(org.dom4j.Element parent, java.lang.String name, java.lang.String value)
          Adds an element containing the specified text to the parent
 java.lang.String getConfPath()
           
 java.lang.String getJavaClientUrl()
           
 int getWorkflowAssignmentTimeout()
           
 int getWorkflowAssignmentWaitTime()
           
 boolean isConfigured()
          Check if the configuration for this utility has been loaded successfully
 java.util.Properties loadPropertiesFile(java.lang.String filename)
          Load the specified properties file contained on the classpath
 void moveFile(java.io.File file, java.lang.String destination)
          move a file from one location to another
 java.lang.String postToJavaClient(org.dom4j.Document document)
           
protected  void setConfPath(java.lang.String confPath)
           
 void setJavaClientUrl(java.lang.String javaClientUrl)
           
 void setWorkflowAssignmentTimeout(int workflowAssignmentTimeout)
           
 void setWorkflowAssignmentWaitTime(int workflowAssignmentWaitTime)
           
 org.dom4j.Document transformDocument(org.dom4j.Document document, java.lang.String xslFile)
          Transform the Document using the XSL File located on the classpath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTIES_FILE

public static final java.lang.String PROPERTIES_FILE
See Also:
Constant Field Values

CONFIGURATION_PATH

public static final java.lang.String CONFIGURATION_PATH
See Also:
Constant Field Values

configured

protected boolean configured

logger

protected org.apache.log4j.Logger logger
Constructor Detail

BaseUtil

public BaseUtil()
Method Detail

moveFile

public void moveFile(java.io.File file,
                     java.lang.String destination)
move a file from one location to another

Parameters:
file - The file to be moved
destination - The directory to move the file to

loadPropertiesFile

public java.util.Properties loadPropertiesFile(java.lang.String filename)
                                        throws java.io.IOException
Load the specified properties file contained on the classpath

Parameters:
filename - Name of the properties file
Returns:
The Properties object populated from the specified properties file
Throws:
java.io.IOException - If a error loading the properties file occurs

setConfPath

protected void setConfPath(java.lang.String confPath)

getConfPath

public java.lang.String getConfPath()

transformDocument

public org.dom4j.Document transformDocument(org.dom4j.Document document,
                                            java.lang.String xslFile)
Transform the Document using the XSL File located on the classpath

Parameters:
document - The Document to be transformed
xslFile - The XSL File name. The File must be on the classpath
Returns:
The transformed Document if the transform is successful or null if a TransformerException was thrown

isConfigured

public boolean isConfigured()
Check if the configuration for this utility has been loaded successfully

Returns:
If the utility is configured or not

setWorkflowAssignmentTimeout

public void setWorkflowAssignmentTimeout(int workflowAssignmentTimeout)

getWorkflowAssignmentTimeout

public int getWorkflowAssignmentTimeout()

setWorkflowAssignmentWaitTime

public void setWorkflowAssignmentWaitTime(int workflowAssignmentWaitTime)

getWorkflowAssignmentWaitTime

public int getWorkflowAssignmentWaitTime()

getJavaClientUrl

public java.lang.String getJavaClientUrl()

setJavaClientUrl

public void setJavaClientUrl(java.lang.String javaClientUrl)

postToJavaClient

public java.lang.String postToJavaClient(org.dom4j.Document document)

addElement

public org.dom4j.Element addElement(org.dom4j.Element parent,
                                    java.lang.String name)
Adds an element containing the specified text to the parent

Parameters:
parent - element to add the new node to
name - String name of the node to add

addElement

public org.dom4j.Element addElement(org.dom4j.Element parent,
                                    java.lang.String name,
                                    java.lang.String value)
Adds an element containing the specified text to the parent

Parameters:
parent - element to add the new node to
name - String name of the node to add
value - String value to assign to the node