Class XmlRequesterResponderResource<Q extends Dto,S>

java.lang.Object
esendex.sdk.java.service.resource.base.Resource
esendex.sdk.java.service.resource.base.XmlRequesterResponderResource<Q,S>
Type Parameters:
Q - the Dto type expected in the request
S - the Dto type expected in the response
Direct Known Subclasses:
CreateContactResource, CreateOptOutResource, MessageDispatcherResource, UpdateContactResource

public abstract class XmlRequesterResponderResource<Q extends Dto,S> extends Resource
An XmlRequesterResponderResource is a resource that receives and sends XML data
Author:
Mike Whittaker
  • Constructor Details

    • XmlRequesterResponderResource

      public XmlRequesterResponderResource(Authenticator auth, String account, String id, HttpQuery query, String version)
      Instantiates a new xml requester responder resource.
      Parameters:
      auth - the authenticator
      account - the account
      id - the id
      query - the query
    • XmlRequesterResponderResource

      public XmlRequesterResponderResource(Authenticator auth, String account, String id, HttpQuery query)
  • Method Details

    • setRequestObject

      public void setRequestObject(Q requestDto)
      Sets the request object.
      Parameters:
      requestDto - the new request object
    • getRequestData

      protected String getRequestData()
      Retrieves the request data if any in raw String form. By default returns null
      Overrides:
      getRequestData in class Resource
      Returns:
      the request data in raw form
    • execute

      public void execute() throws EsendexException
      Makes and completes the connection to the resource.
      Overrides:
      execute in class Resource
      Throws:
      EsendexException - If there is a problem during the connection or the HTTP response is outside the 200-299 range.
    • getResponseObject

      public S getResponseObject()
      Gets the response object.
      Returns:
      the response object