MessageReceiver

public class MessageReceiver extends SOAPSender

The MessageReceiver is the abstract class which is used to send SOAP messsage request to B2B Collector series product.

Author:Jumbo Cheung

Constructors

MessageReceiver

public MessageReceiver(FileLogger l, Data m)

Explicit Constructor.

Parameters:
  • l – The logger used for log message and exception.
  • m – The message properties including how many message need to be sent and some performance parameter.

Methods

clearRequestPayload

public boolean clearRequestPayload()

Clear all payload in the request.

getContentType

public String getContentType()

Return the content type of the message.

Returns:The content type of message to bes sent.

getElapsedTime

public long getElapsedTime()

Get how long it tasks for the sender to do it’s tasks.

Returns:The times for the task from start to end in milleseconds.

getEndTime

public long getEndTime()
Returns:Return the end time of the sender process.

getResponsePayloads

public Payload[] getResponsePayloads()

Get the payload from the SOAP response. This should be called during onResponse().

Throws:
  • SOAPException – When unable to extract the payload in the SOAP Response.
  • IOException – When unable to open the input stream for the payload.
Returns:

A set of payload in SOAP message.

getStartTime

public long getStartTime()
Returns:Return the start time of the sending process.

onEnd

public void onEnd()

[@EVENT] This method is invoked when the sending execution is ended.

onError

public void onError(Throwable t)

[@EVENT] Log all known exceptions and stack trace.

Parameters:
  • t – The exception encountered.

onStart

public void onStart()

[@EVENT] This method is invoked when the sender begins to execute the run method.

setContentType

public void setContentType(String contentType)

Set the content type of the message to be sent.

Parameters:
  • contentType – The content type of message to be sent.