public static class DataReceiverImpl.Builder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DATA_HANDLER_MISSING_ERROR |
protected DataHandler |
dataHandler |
protected RabbitQueueFactory |
factory |
protected int |
maxParallelProcessedMsgs |
protected RabbitQueue |
queue |
protected static String |
QUEUE_INFO_MISSING_ERROR |
protected String |
queueName |
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
DataReceiverImpl |
build()
Builds the
DataReceiverImpl instance with the previously given
information. |
DataReceiverImpl.Builder |
dataHandler(DataHandler dataHandler)
Sets the handler that is called if data is incoming.
|
DataReceiverImpl.Builder |
maxParallelProcessedMsgs(int maxParallelProcessedMsgs)
Sets the maximum number of incoming messages that are processed in parallel.
|
DataReceiverImpl.Builder |
queue(RabbitQueue queue)
Sets the queue that is used to receive data.
|
DataReceiverImpl.Builder |
queue(RabbitQueueFactory factory,
String queueName)
Method for providing the necessary information to create a queue if it has
not been provided with the
queue(RabbitQueue) method. |
protected static final String QUEUE_INFO_MISSING_ERROR
protected static final String DATA_HANDLER_MISSING_ERROR
protected DataHandler dataHandler
protected RabbitQueue queue
protected String queueName
protected int maxParallelProcessedMsgs
protected RabbitQueueFactory factory
public DataReceiverImpl.Builder dataHandler(DataHandler dataHandler)
dataHandler - the handler that is called if data is incomingpublic DataReceiverImpl.Builder queue(RabbitQueue queue)
queue - the queue that is used to receive datapublic DataReceiverImpl.Builder queue(RabbitQueueFactory factory, String queueName)
queue(RabbitQueue) method. Note that this
information is not used if a queue has been provided.factory - the queue factory used to create a queuequeueName - the name of the newly created queuepublic DataReceiverImpl.Builder maxParallelProcessedMsgs(int maxParallelProcessedMsgs)
maxParallelProcessedMsgs - the maximum number of incoming messages that are processed in
parallelpublic DataReceiverImpl build() throws IllegalStateException, IOException
DataReceiverImpl instance with the previously given
information.IllegalStateException - if the dataHandler is missing or if neither a queue nor the
information needed to create a queue have been provided.IOException - if an exception is thrown while creating a new queue or if the
given queue can not be configured by the newly created
DataReceiver. Note that in the latter case the queue will
be closed.Copyright © 2017–2018. All rights reserved.