com.ibm.broker.connector

Class ResponseRecord

  • java.lang.Object
    • com.ibm.broker.connector.ResponseRecord
  • Direct Known Subclasses:
    ByteArrayResponseRecord, TimeoutResponseRecord


    public abstract class ResponseRecord
    extends java.lang.Object
    ResponseRecord is the base class for a polling result from the system. The connector writer implements and constructs ResponseRecord objects, which are returned to Integration Bus for processing from the ResponseRecord.ReadData method.

    IBM Integration Bus makes call backs to the ResponseRecord object during the processing of the ResponseRecord as follows:

    • logResult is called when the ResponseRecord is about to be processed and needs to be logged to activity trace.
    • buildInputRecord is called when the record representing the ResponseRecord is required. The record is used to construct the message that is processed in the message flow.
    • buildProperties is called when extra details about the ResponseRecord are required which are not part of the data. These details are written out to the LocalEnvironment tree.
    • confirm is called if the processing of the result was successful.
    • markAsFailed is called if the processing of the result failed.

    The connector writer constructs ResponseRecordwhich are returned to Integration Bus from the RequestConnector's readData method.

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String copyright 
    • Constructor Summary

      Constructors 
      Constructor and Description
      ResponseRecord(RequestConnector connector)
      Initializes a new instance of the ResponseRecord class.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      abstract InputRecord buildInputRecord()
      This is called by the integration node when the record representing the result is required.
      java.util.Properties buildProperties()
      This is called by the integration node when the additional information in found in the record is required.
      void confirm()
      This is called by the integration node if the processing of the result completes without error.
      RequestConnector getConnector()
      Returns the owning NBRequestConnector.
      void logResult()
      This is called by the integration node after readData to allow the connector writer to do there own logging.
      void markAsFailed()
      This is called by the integration node if the processing of the result fails with an error.
      java.lang.String resultSource()
      This is called by the the integration node after a result is received.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResponseRecord

        public ResponseRecord(RequestConnector connector)
                       throws com.ibm.broker.plugin.MbException
        Initializes a new instance of the ResponseRecord class.
        Parameters:
        connector - The owning connector.
        Throws:
        com.ibm.broker.plugin.MbException
    • Method Detail

      • buildInputRecord

        public abstract InputRecord buildInputRecord()
                                              throws com.ibm.broker.plugin.MbException
        This is called by the integration node when the record representing the result is required. The record is used to construct the message that is processed in the message flow. If a MbException is thrown then the processing of the event will fail.
        Throws:
        com.ibm.broker.plugin.MbException
      • buildProperties

        public java.util.Properties buildProperties()
                                             throws com.ibm.broker.plugin.MbException
        This is called by the integration node when the additional information in found in the record is required. The returned properties is used to construct the local environment part of the message. If a MbException is thrown then the processing of the event will fail. The keys and values in the returned dictionary will become Name or NameValue elements under the Input folder in the LocalEnvironment. If the key has multiple parts, separated by "/" characters (such as "a/b/c") then a tree will be constructed for each element between the "/" characters.
        Returns:
        A Properties object containing key values for adding data into the LocalEnvironment.
        Throws:
        com.ibm.broker.plugin.MbException
      • confirm

        public void confirm()
                     throws com.ibm.broker.plugin.MbException
        This is called by the integration node if the processing of the result completes without error. If a MbException is thrown then the error is written to the system log and the event is discarded.
        Throws:
        com.ibm.broker.plugin.MbException
      • markAsFailed

        public void markAsFailed()
                          throws com.ibm.broker.plugin.MbException
        This is called by the integration node if the processing of the result fails with an error. If a MbException is thrown then the error is written to the system log and the event is discarded.
        Throws:
        com.ibm.broker.plugin.MbException
      • resultSource

        public java.lang.String resultSource()
                                      throws com.ibm.broker.plugin.MbException
        This is called by the the integration node after a result is received. The information is used in log entries to tell the end user where the event originated from. If it is not overridden then the connector key is used. Throwing an exception will cause an entry to be written to the system log and the event to be discarded.
        Throws:
        com.ibm.broker.plugin.MbException
      • logResult

        public void logResult()
                       throws com.ibm.broker.plugin.MbException
        This is called by the integration node after readData to allow the connector writer to do there own logging. If it is not overridden then a standard activity log message is written using the details given in sentDestination. Throwing an exception will cause the message flow node to throw an exception for the messaging being currently processed.
        Throws:
        com.ibm.broker.plugin.MbException
      • getConnector

        public final RequestConnector getConnector()
                                            throws com.ibm.broker.plugin.MbException
        Returns the owning NBRequestConnector.
        Throws:
        com.ibm.broker.plugin.MbException
IBM Integration BusTM
JavaTM Connector API