com.xmatters.integrations.ws
Class AlarmPointWebServiceClient

java.lang.Object
  extended by com.xmatters.integrations.ws.AlarmPointWebServiceClient

public class AlarmPointWebServiceClient
extends java.lang.Object

Used to interact with the AlarmPoint Web Services using straight XML Documents

Author:
bneate

Field Summary
static java.lang.String AP_NAMESPACE
           
static java.lang.String AP_NAMESPACE_PREFIX
           
static java.lang.String OK_STATUS
           
static java.lang.String SOAP_NAMESPACE
           
static java.lang.String SOAP_NAMESPACE_PREFIX
           
 
Constructor Summary
AlarmPointWebServiceClient(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String company)
          Create a new web service client using the specified request parameters
AlarmPointWebServiceClient(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String clientIP, java.lang.String clientOSUser, java.lang.String company)
          Create a new web service client using the specified request parameters
 
Method Summary
 org.dom4j.Element createElement(java.lang.String name, java.lang.String value)
          Create a XML Element with the specified name and value using the default AlarmPoint namespace
 org.dom4j.Element createElement(java.lang.String name, java.lang.String value, org.dom4j.Namespace namespace)
          Create a XML Element with the specified name and value using the specified namespace
 java.lang.String getClientIP()
           
 java.lang.String getClientOSUser()
           
 java.lang.String getCompany()
           
 java.lang.String getPassword()
           
 java.lang.String getUrl()
           
 java.lang.String getUsername()
           
 org.dom4j.Node send(java.lang.String action, org.dom4j.Element... elements)
          Make a web service request to the AlarmPoint server and return the response
 java.lang.String sendCheckStatus(java.lang.String action, org.dom4j.Element... elements)
          Make a web service request to the AlarmPoint server and only return the return status
 org.dom4j.Node sendReceive(java.lang.String action, org.dom4j.Element payload)
          Send a SOAP request to the ServiceCenter server and return the contents to the returned SOAP body
 void setClientIP(java.lang.String clientIP)
           
 void setClientOSUser(java.lang.String clientOSUser)
           
 void setCompany(java.lang.String company)
           
 void setPassword(java.lang.String password)
           
 void setUrl(java.lang.String url)
           
 void setUsername(java.lang.String username)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOAP_NAMESPACE_PREFIX

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

SOAP_NAMESPACE

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

AP_NAMESPACE_PREFIX

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

AP_NAMESPACE

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

OK_STATUS

public static final java.lang.String OK_STATUS
See Also:
Constant Field Values
Constructor Detail

AlarmPointWebServiceClient

public AlarmPointWebServiceClient(java.lang.String url,
                                  java.lang.String username,
                                  java.lang.String password,
                                  java.lang.String company)
Create a new web service client using the specified request parameters

Parameters:
url - Url of the AlarmPoint web server
username - User name to use for all web service requests
password - Password to use for all web service requests
company - Company to use for all web service requests

AlarmPointWebServiceClient

public AlarmPointWebServiceClient(java.lang.String url,
                                  java.lang.String username,
                                  java.lang.String password,
                                  java.lang.String clientIP,
                                  java.lang.String clientOSUser,
                                  java.lang.String company)
Create a new web service client using the specified request parameters

Parameters:
url - Url of the AlarmPoint web server
username - User name to use for all web service requests
password - Password to use for all web service requests
clientIP - Client ip address to use for web service request logging
clientOSUser - Client os user to use for web service request logging
company - Company to use for all web service requests
Method Detail

sendCheckStatus

public java.lang.String sendCheckStatus(java.lang.String action,
                                        org.dom4j.Element... elements)
Make a web service request to the AlarmPoint server and only return the return status

Parameters:
action - The web service Action to use ('AddUser' for example)
elements - All the elements in order to add to the request (for an AddUser request you would need the ap:person element for example)
Returns:
Returns the return status from the AlarmPoint web server, SERVER_ERROR if the request fails or NO_STATUS_RETURNED if the response doesn't contain a return status.

send

public org.dom4j.Node send(java.lang.String action,
                           org.dom4j.Element... elements)
Make a web service request to the AlarmPoint server and return the response

Parameters:
action - The web service Action to use ('AddUser' for example)
elements - All the elements in order to add to the request (for an AddUser request you would need the ap:person element for example)
Returns:
A dom4j Node containing the contents of the returned SOAP body element or null if the request fails.

sendReceive

public org.dom4j.Node sendReceive(java.lang.String action,
                                  org.dom4j.Element payload)
Send a SOAP request to the ServiceCenter server and return the contents to the returned SOAP body

Parameters:
action - The SOAP Action to perform in ServiceCenter. The possible values are defined on the extaccess table
payload - A dom4j Element that will be the payload of the SOAP request
Returns:
A dom4j Node containing the contents of the returned SOAP body element or null if the request fails.

createElement

public org.dom4j.Element createElement(java.lang.String name,
                                       java.lang.String value)
Create a XML Element with the specified name and value using the default AlarmPoint namespace

Parameters:
name - Element name
value - Element value. If null no value will be added.
Returns:
The created Element

createElement

public org.dom4j.Element createElement(java.lang.String name,
                                       java.lang.String value,
                                       org.dom4j.Namespace namespace)
Create a XML Element with the specified name and value using the specified namespace

Parameters:
name - Element name
value - Element value. If null no value will be added.
namespace - The namespace to use for the new Element
Returns:
The created Element

getUrl

public java.lang.String getUrl()

setUrl

public void setUrl(java.lang.String url)

getUsername

public java.lang.String getUsername()

setUsername

public void setUsername(java.lang.String username)

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

getClientIP

public java.lang.String getClientIP()

setClientIP

public void setClientIP(java.lang.String clientIP)

getClientOSUser

public java.lang.String getClientOSUser()

setClientOSUser

public void setClientOSUser(java.lang.String clientOSUser)

getCompany

public java.lang.String getCompany()

setCompany

public void setCompany(java.lang.String company)