Class MultiSpeakService

java.lang.Object
com.ecec.rweber.multispeak.MultiSpeakService

public class MultiSpeakService extends Object
This is an abstract class representing a service endpoint such as MR (meter reading), OA (outage managment), etc. To interact in a meaningful way with any MultiSpeak endpoint this class should be extended and specific methods implemented per vendor implementations of each Multispeak Service. This class can be created standalone with the call() method being used to pass method names as String objects.
Author:
rweber
  • Field Details

    • m_log

      protected org.apache.logging.log4j.Logger m_log
    • m_client

      protected MultiSpeakClient m_client
  • Constructor Details

    • MultiSpeakService

      public MultiSpeakService(MultiSpeakEndpoint endpoint)
      Parameters:
      endpoint - a valid MultiSpeakEndpoint - connection information
  • Method Details

    • getLastResult

      public MultiSpeakResult getLastResult()
    • getEndpointNamespace

      protected Namespace getEndpointNamespace()
    • createElement

      public Element createElement(String name)
    • createElement

      protected Element createElement(String name, String value)
    • getMethods

      public List<String> getMethods()
      All MultiSpeak Endpoints should implement this
      Returns:
      List of methods accepted by this server
    • ping

      public boolean ping()
      All MultiSpeak Endpoints should implement this
      Returns:
      true/false if the ping was successful
    • call

      public MultiSpeakResult call(String method)
      This is a convenience method for Multispeak calls with no parameters
      Parameters:
      method - the method to send to the MultiSpeak Service
      Returns:
      the result element with the SOAP envelope stripped off
    • call

      public MultiSpeakResult call(String method, String[] params)
      Call a Multispeak method with the given parameters. Results are returned as an XML element of the payload
      Parameters:
      method - the method to send to the MultiSpeak Service
      params - any parameters to pass, can be null
      Returns:
      the result element with the SOAP envelope stripped off - can be NULL
    • call

      public MultiSpeakResult call(String method, List<Element> params)
      Calls a MultiSpeak SOAP method using a list of pre-built JDOM element parameters.
      Parameters:
      method - the method to send to the MultiSpeak Service
      params - the list of JDOM Elements representing the method parameters
      Returns:
      the result element with the SOAP envelope stripped off - can be NULL