Class ResponseBundle

java.lang.Object
co.ecg.alpaca.toolkit.messaging.response.ResponseBundle
All Implemented Interfaces:
Serializable

public class ResponseBundle extends Object implements Serializable
Defines a bundle of responses from the BroadWorks Server. It is serializable so it can be conveniently cached by JCS.
Author:
Matthew Keathley on 6/8/15
See Also:
  • Field Details

  • Constructor Details

    • ResponseBundle

      public ResponseBundle()
  • Method Details

    • getResponseBundle

      public static ResponseBundle getResponseBundle(String responseContent, RequestBundle requestBundle)
      This creates an object that extends the Response class with the given response content.
      Parameters:
      responseContent - The XML response from BroadWorks as a String
      requestBundle - The RequestBundle that was sent to BroadWorks
      Returns:
      Returns the ResponseBundle.
    • containsError

      public boolean containsError() throws RequestException
      Returns true if the RequestBundle contains an error response
      Returns:
      Returns true if any of the Responses were of 'ErrorResponse' type.
      Throws:
      RequestException
    • getErrorResponses

      public List<Response> getErrorResponses()
      Returns the list of Responses in the Response Bundle that are errors
      Returns:
      Returns the list of Responses for which they were of 'ErrorResponse' type.
    • getRequestBundle

      public RequestBundle getRequestBundle()
      Returns the backing request bundle for the response bundle
      Returns:
      The RequestBundle that formed this Response Bundle.
    • setRequestBundle

      public void setRequestBundle(RequestBundle requestBundle)
    • getResponseForRequest

      public <T extends Response> T getResponseForRequest(Request<T> request)
      Returns the response for a given request from the backing map
      Parameters:
      request - The request key
      Returns:
      The Response for the given Request object.
    • getResponseList

      public Collection<Response> getResponseList()
      Returns the full list of responses from the Response Bundle
      Returns:
      The Response list as a Collection.
    • getResponseMap

      public HashMap<Request<?>,Response> getResponseMap()
      Returns:
      the backing HashMap of Requests to Responses