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:
BrokerConnectionParameters bcp = new MQBrokerConnectionParameters("localhost", 1414, "QMGR"); BrokerProxy b = BrokerProxy.getInstance(bcp); 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_STORE | The DataCaptureStore to use |
AttributeConstants.DATACAPTURE_NUMBEROFENTRIESPERPAGE | The number of results to return per requested page |
AttributeConstants.DATACAPTURE_PAGENUMBER | The page number of the results to return |
AttributeConstants.DATACAPTURE_SORTBY | The column to sort the results by |
AttributeConstants.DATACAPTURE_EVENT_TIMESTAMP_FROM | The earliest date/time to return results from (using standard SQL date/time syntax) |
AttributeConstants.DATACAPTURE_EVENT_TIMESTAMP_TO | The latest date/time to return results from (using standard SQL date/time syntax) |
AttributeConstants.DATACAPTURE_PAYLOAD | Returns 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_REPLAY | Asks 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
Modifier and Type | Method and Description |
---|---|
java.util.Enumeration<DataCaptureEntry> |
elements()
Returns an Enumeration of all DataCaptureEntry objects
available to the user.
|
ConfigurationObjectType |
getConfigurationObjectType()
Returns the ConfigurationObjectType associated
with this AdministeredObject type.
|
ConfigurationObjectType |
getConfigurationObjectTypeOfParent()
Returns the ConfigurationObjectType associated
with the logical parent of this AdministeredObject type.
|
DataCaptureEntry |
getDataCaptureEntry(int position)
Returns the DataCaptureEntry at the supplied position in the
messages list associated with this DataCaptureProxy,
|
java.lang.String |
getDataCaptureEntryAsXml(int position)
Returns the XML string DataCaptureEntry at the supplied position in the
messages list associated with this DataCaptureProxy,
|
java.lang.String |
getName()
Returns the name of the object
|
int |
getSize()
Returns the number of available DataCaptureEntry objects from the current query.
|
boolean |
hasBeenPopulatedByBroker()
Returns true if and only if this object handle
has received at least one update publication from the
connected broker.
|
boolean |
hasBeenPopulatedByBroker(boolean waitIfNotUpdated)
Returns true if and only if this object handle
has received at least one update publication from
the connected broker.
|
void |
setLongDescription(java.lang.String desc)
Calling this method always results in a
ConfigManagerProxyLoggedException being thrown.
|
void |
setName(java.lang.String name)
Calling this method always results in a
ConfigManagerProxyLoggedException being thrown.
|
void |
setShortDescription(java.lang.String desc)
Calling this method always results in a
ConfigManagerProxyLoggedException being thrown.
|
java.lang.String |
toString()
Displays the name of the current object (or type and UUID
the name if it is available).
|
deregisterListener, deregisterListener, elements, equals, getAdvancedProperties, getBasicProperties, getLastBIPMessages, getLastCompletionCode, getLastUpdateUser, getLongDescription, getManagedSubcomponent, getManagedSubcomponentFromStringRepresentation, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponentsAsStrings, getManagedSubcomponentsAsStrings, getNumberOfSubcomponents, getParent, getProperties, getProperty, getProperty, getProperty, getProperty, getRepositoryTimestamp, getShortDescription, getTimeOfLastCompletionCode, getTimeOfLastUpdate, getType, getUUID, hasBeenRestrictedByBroker, hasBeenRestrictedByBroker, hasBeenRestrictedByConfigManager, hasBeenRestrictedByConfigManager, hasBeenUpdatedByConfigManager, hasBeenUpdatedByConfigManager, isAwaitingSubmissionForCreation, isAwaitingSubmissionForDeletion, isDeployed, isShared, refresh, registerListener, registerListener, registerListener, setProperties, toVerboseString, unsubscribeFromConfigurationManagerUpdates, withName, withUUID
public int getSize() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if the size of the list of message entries could not be determined because
the information was not supplied from the broker before a
timeout occurred.public DataCaptureEntry getDataCaptureEntry(int position) throws java.lang.ArrayIndexOutOfBoundsException, ConfigManagerProxyPropertyNotInitializedException
position
- Number of the DataCaptureEntry to return. The
minimum value is 1, the maximum value is determined by
getSize().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.public java.lang.String getDataCaptureEntryAsXml(int position) throws java.lang.ArrayIndexOutOfBoundsException, ConfigManagerProxyPropertyNotInitializedException
position
- Number of the DataCaptureEntry to return. The
minimum value is 1, the maximum value is determined by
getSize().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.public java.util.Enumeration<DataCaptureEntry> elements() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if the messages could not be determined because
the information was not supplied from the broker before a
timeout occurred.public ConfigurationObjectType getConfigurationObjectType()
getConfigurationObjectType
in class AdministeredObject
public ConfigurationObjectType getConfigurationObjectTypeOfParent()
getConfigurationObjectTypeOfParent
in class AdministeredObject
public java.lang.String getName() throws ConfigManagerProxyPropertyNotInitializedException
getName
in class AdministeredObject
ConfigManagerProxyPropertyNotInitializedException
- if the name could not be determined because
the information was not supplied from the broker before a
timeout occurred.public java.lang.String toString()
toString
in class AdministeredObject
public boolean hasBeenPopulatedByBroker()
hasBeenPopulatedByBroker
in class AdministeredObject
public boolean hasBeenPopulatedByBroker(boolean waitIfNotUpdated)
hasBeenPopulatedByBroker
in class AdministeredObject
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.BrokerProxy.setRetryCharacteristics(long)
public void setName(java.lang.String name) throws ConfigManagerProxyLoggedException
setName
in class AdministeredObject
name
- (this is ignored)ConfigManagerProxyLoggedException
- to indicate this
method should not be called.public void setShortDescription(java.lang.String desc) throws ConfigManagerProxyLoggedException
setShortDescription
in class AdministeredObject
desc
- (this is ignored)ConfigManagerProxyLoggedException
- to indicate this
method should not be called.public void setLongDescription(java.lang.String desc) throws ConfigManagerProxyLoggedException
setLongDescription
in class AdministeredObject
desc
- (this is ignored)ConfigManagerProxyLoggedException
- to indicate this
method should not be called.