org.apache.camel.component.dataset
Class DataSetSupport

java.lang.Object
  extended by org.apache.camel.component.dataset.DataSetSupport
All Implemented Interfaces:
DataSet
Direct Known Subclasses:
SimpleDataSet

public abstract class DataSetSupport
extends Object
implements DataSet

Base class for DataSet

Version:

Constructor Summary
DataSetSupport()
           
DataSetSupport(int size)
           
 
Method Summary
protected  void applyHeaders(Exchange exchange, long messageIndex)
          Allows derived classes to add some custom headers for a given message
 void assertMessageExpected(DataSetEndpoint dataSetEndpoint, Exchange expected, Exchange actual, long index)
          Asserts that the expected message has been received for the given index
protected abstract  Object createMessageBody(long messageIndex)
           
 Map<String,Object> getDefaultHeaders()
           
 Processor getOutputTransformer()
           
 long getReportCount()
          Returns the number of messages which should be received before reporting on the progress of the test
 long getSize()
          Returns the size of the dataset
protected  void populateDefaultHeaders(Map<String,Object> map)
          Allows derived classes to customize a default set of properties
 void populateMessage(Exchange exchange, long messageIndex)
          Populates a message exchange when using the DataSet as a source of messages
 void setDefaultHeaders(Map<String,Object> defaultHeaders)
           
 void setOutputTransformer(Processor outputTransformer)
           
 void setReportCount(long reportCount)
          Sets the number of messages in a group on which we will report that messages have been received.
 void setSize(long size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSetSupport

public DataSetSupport()

DataSetSupport

public DataSetSupport(int size)
Method Detail

populateMessage

public void populateMessage(Exchange exchange,
                            long messageIndex)
                     throws Exception
Description copied from interface: DataSet
Populates a message exchange when using the DataSet as a source of messages

Specified by:
populateMessage in interface DataSet
Throws:
Exception

assertMessageExpected

public void assertMessageExpected(DataSetEndpoint dataSetEndpoint,
                                  Exchange expected,
                                  Exchange actual,
                                  long index)
                           throws Exception
Description copied from interface: DataSet
Asserts that the expected message has been received for the given index

Specified by:
assertMessageExpected in interface DataSet
Throws:
Exception

getSize

public long getSize()
Description copied from interface: DataSet
Returns the size of the dataset

Specified by:
getSize in interface DataSet

setSize

public void setSize(long size)

getReportCount

public long getReportCount()
Description copied from interface: DataSet
Returns the number of messages which should be received before reporting on the progress of the test

Specified by:
getReportCount in interface DataSet

setReportCount

public void setReportCount(long reportCount)
Sets the number of messages in a group on which we will report that messages have been received.


getDefaultHeaders

public Map<String,Object> getDefaultHeaders()

setDefaultHeaders

public void setDefaultHeaders(Map<String,Object> defaultHeaders)

getOutputTransformer

public Processor getOutputTransformer()

setOutputTransformer

public void setOutputTransformer(Processor outputTransformer)

createMessageBody

protected abstract Object createMessageBody(long messageIndex)

applyHeaders

protected void applyHeaders(Exchange exchange,
                            long messageIndex)
Allows derived classes to add some custom headers for a given message


populateDefaultHeaders

protected void populateDefaultHeaders(Map<String,Object> map)
Allows derived classes to customize a default set of properties



Apache CAMEL