com.e_c_group.bwptk
Class Response

java.lang.Object
  extended by com.e_c_group.bwptk.Response
All Implemented Interfaces:
java.io.Serializable

public class Response
extends java.lang.Object
implements java.io.Serializable

Defines the responses of the Broadworks Server Serializable so it can be conveniently cached by JCS

See Also:
Serialized Form

Field Summary
static javax.xml.xpath.XPath xPath
          Return a new XPath from the the default XPathFactory().
 
Constructor Summary
Response()
           
 
Method Summary
 java.lang.String getElementByXPath(java.lang.String xPathExpression)
           
 java.lang.String getElementByXPathMaskingXPathException(java.lang.String xPathExpression)
           
 org.w3c.dom.NodeList getNodeList(java.lang.String xPathSearch)
          Return a nodelist of objects, split by the specified xPath.
 org.w3c.dom.NodeList getNodeListOfRows()
          Return a nodelist of rows, split by the XPath "//command//row".
 boolean isCommandType(java.lang.String commandType)
          Determine whether this response has a command (element) "xsi:type" (attribute) value of "c:" + commandType or literally commandType.
 boolean isErrorResponse()
          Returns true if the "xsi:type" of this response is a "ErrorRersponse".
 boolean isSuccessResponse()
          Returns true if the "xsi:type" of this response is a "c:SuccessResponse".
 java.lang.String toString()
           
static java.lang.String xPathEvaluate(java.lang.String xPathString, org.w3c.dom.Node n)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xPath

public static javax.xml.xpath.XPath xPath
Return a new XPath from the the default XPathFactory(). This is just a convenience method to hide
   XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); 

Constructor Detail

Response

public Response()
Method Detail

getElementByXPath

public java.lang.String getElementByXPath(java.lang.String xPathExpression)
                                   throws javax.xml.xpath.XPathExpressionException
Throws:
javax.xml.xpath.XPathExpressionException

getElementByXPathMaskingXPathException

public java.lang.String getElementByXPathMaskingXPathException(java.lang.String xPathExpression)
                                                        throws BwptkException
Throws:
BwptkException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isCommandType

public boolean isCommandType(java.lang.String commandType)
                      throws BwptkException
Determine whether this response has a command (element) "xsi:type" (attribute) value of "c:" + commandType or literally commandType.

Throws:
BwptkException

isSuccessResponse

public boolean isSuccessResponse()
                          throws BwptkException
Returns true if the "xsi:type" of this response is a "c:SuccessResponse". This is a convenience method to determine whether a Request executed successfully.

Throws:
BwptkException

isErrorResponse

public boolean isErrorResponse()
                        throws BwptkException
Returns true if the "xsi:type" of this response is a "ErrorRersponse". This is a convenience method to determine whether a Request failed.

Throws:
BwptkException

getNodeListOfRows

public org.w3c.dom.NodeList getNodeListOfRows()
                                       throws javax.xml.xpath.XPathExpressionException
Return a nodelist of rows, split by the XPath "//command//row". BroadWorks responses are often returned as rows. Equivalent to
{ @code   getNodeList("//command//row"); }

Throws:
javax.xml.xpath.XPathExpressionException

getNodeList

public org.w3c.dom.NodeList getNodeList(java.lang.String xPathSearch)
                                 throws javax.xml.xpath.XPathExpressionException
Return a nodelist of objects, split by the specified xPath. For example,
//command//row
will pull the rows out of a
<command><rowset><row>...</row><row>...</row></rowset></command> 
Likewise,
//command/deviceType
will split up the response from SystemDeviceTypeGetAvailableListResponse14sp1:
{ @code 
                
                        2Wire HomePortal
                        ACT P103SLC
                        ACT P104SLD
                        Aastra 480i
                        Aastra 480i CT
                        Aastra 53i
                        Aastra 55i
                        Aastra 57i
                
 }

Throws:
javax.xml.xpath.XPathExpressionException

xPathEvaluate

public static java.lang.String xPathEvaluate(java.lang.String xPathString,
                                             org.w3c.dom.Node n)
                                      throws javax.xml.xpath.XPathExpressionException
Throws:
javax.xml.xpath.XPathExpressionException