com.ibm.broker.config.proxy

Class DataCaptureProxy



  • public class DataCaptureProxy
    extends AdministeredObject

    When the broker has been configured to record data passing through it for subsequent view, edit and replay, the DataCaptureProxy object can be used to retrieve information related to the recorded data.

    Calling applications create a filter query using a Java Properties object, which defines the data to search for. This object is then passed to the execution group that logically owns the data via the getDataCapture method, and a DataCaptureProxy object is returned which encapsulates the matching data. For example:

         BrokerProxy b = BrokerProxy.getInstance(
             new IntegrationNodeConnectionParameters("localhost", 4414)); 
         ExecutionGroupProxy eg = b.getExecutionGroupByName("default");
         
         Properties filterProps = new Properties();
         filterProps.setProperty(DataCaptureEntry.PROPERTY_BROKER_NAME, "MYBROKER");
         filterProps.setProperty(AttributeConstants.DATACAPTURE_NUMBEROFENTRIESPERPAGE, "20");
         
         DataCaptureEntry filterEntry = new DataCaptureEntry(filterProps);
         DataCaptureProxy dcp = eg.getDataCapture("DefaultCaptureStore", filterEntry);
         
         if (dcp.getSize() >= 1) {
           DataCaptureEntry messageOne = dcp.getDataCaptureEntry(1);
           // ... work with messageOne ...
         }
     
    The Properties object that is passed to getDataCapture() can contain the following control and filter criteria:

    Control Parameters
    AttributeConstants.DATACAPTURE_STOREThe DataCaptureStore to use
    AttributeConstants.DATACAPTURE_NUMBEROFENTRIESPERPAGEThe number of results to return per requested page
    AttributeConstants.DATACAPTURE_PAGENUMBERThe page number of the results to return
    AttributeConstants.DATACAPTURE_SORTBYThe column to sort the results by
    AttributeConstants.DATACAPTURE_EVENT_TIMESTAMP_FROMThe earliest date/time to return results from (using standard SQL date/time syntax)
    AttributeConstants.DATACAPTURE_EVENT_TIMESTAMP_TOThe latest date/time to return results from (using standard SQL date/time syntax)
    AttributeConstants.DATACAPTURE_PAYLOADReturns the payload associated with a single data point. Set the value of this property to AttributeConstants.DATACAPTURE_PAYLOAD_BITSTREAM to return the bitstream, or set it to AttributeConstants.DATACAPTURE_PAYLOAD_EXCEPTIONLIST to return the exception list. As this option refers to a single data point, always specify an additional filter criteria of DataCaptureEntry.PROPERTY_WMBMSG_KEY, with a value of your message ID.
    AttributeConstants.DATACAPTURE_REPLAYAsks the broker to additionally replay a data point to the supplied destination. Set the value of this property to the data destination name. As this option refers to a single data point, always specify an additional filter criteria of DataCaptureEntry.PROPERTY_WMBMSG_KEY, with a value of your message ID.
    DataCaptureEntry.PROPERTY_*These are used to filter the results, e.g. DataCaptureEntry.PROPERTY_BROKER_NAME to filter on the broker of the supplied name, as shown in the example code above.

    com.ibm.broker.config.proxy.DataCaptureProxy extends com.ibm.broker.config.proxy.AdministeredObject

    Responsibilities Represents a set of data points that have been previously captured by the execution group.
    Internal Collaborators com.ibm.broker.config.proxy.DataCaptureEntry
    
     Change Activity:
     --------   ----------- -------------   ------------------------------------
     Reason:    Date:       Originator:     Comments:
     --------   ----------- -------------   ------------------------------------
     80006.8    2011-10-03  HDDJS           v8 Release
    
     
    • Method Detail

      • getDataCaptureEntry

        public DataCaptureEntry getDataCaptureEntry(int position)
                                             throws java.lang.ArrayIndexOutOfBoundsException,
                                                    ConfigManagerProxyPropertyNotInitializedException
        Returns the DataCaptureEntry at the supplied position in the messages list associated with this DataCaptureProxy,
        Parameters:
        position - Number of the DataCaptureEntry to return. The minimum value is 1, the maximum value is determined by getSize().
        Returns:
        DataCaptureEntry The entry at the given element
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if the value of the supplied position is less than one or greater than the number of viewable entries.
        ConfigManagerProxyPropertyNotInitializedException - if the value of the DataCaptureEntry could not be determined because the information was not supplied from the broker before a timeout occurred.
      • getDataCaptureEntryAsXml

        public java.lang.String getDataCaptureEntryAsXml(int position)
                                                  throws java.lang.ArrayIndexOutOfBoundsException,
                                                         ConfigManagerProxyPropertyNotInitializedException
        Returns the XML string DataCaptureEntry at the supplied position in the messages list associated with this DataCaptureProxy,
        Parameters:
        position - Number of the DataCaptureEntry to return. The minimum value is 1, the maximum value is determined by getSize().
        Returns:
        DataCaptureEntry The entry at the given element
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if the value of the supplied position is less than one or greater than the number of viewable entries.
        ConfigManagerProxyPropertyNotInitializedException - if the value of the DataCaptureEntry could not be determined because the information was not supplied from the broker before a timeout occurred.
      • toString

        public java.lang.String toString()
        Displays the name of the current object (or type and UUID the name if it is available). The format is not guaranteed, and therefore should not be parsed programmatically.
        Overrides:
        toString in class AdministeredObject
        Returns:
        String Representation of the current object
      • hasBeenPopulatedByBroker

        public boolean hasBeenPopulatedByBroker()
        Returns true if and only if this object handle has received at least one update publication from the connected broker. This call returns immediately. If this method returns false, it means that requests for attributes of this AdministeredObject are likely to cause a pause while the information is discovered.
        Overrides:
        hasBeenPopulatedByBroker in class AdministeredObject
        Returns:
        boolean true if the object has had at least one update by the server, false otherwise.
      • hasBeenPopulatedByBroker

        public boolean hasBeenPopulatedByBroker(boolean waitIfNotUpdated)
        Returns true if and only if this object handle has received at least one update publication from the connected broker. If no updates have been received, this method optionally waits for the first update to arrive.
        Overrides:
        hasBeenPopulatedByBroker in class AdministeredObject
        Parameters:
        waitIfNotUpdated - If set to true, this method will retry for the currently configured timeout period if the object has not been updated. If the object has not been updated after the timeout period has expired, false will be returned.
        Returns:
        boolean true if the object has had at least one update by the broker, false otherwise.
        See Also:
        BrokerProxy.setRetryCharacteristics(long)