public static final class DataReceiverImpl.Builder extends Object
| Modifier and Type | Field and Description |
|---|---|
private MessageConsumerBuilder |
consumerBuilder |
private static String |
DATA_HANDLER_MISSING_ERROR |
private IncomingStreamHandler |
dataHandler |
private RabbitQueueFactory |
factory |
private int |
maxParallelProcessedMsgs |
private String |
name |
private RabbitQueue |
queue |
private static String |
QUEUE_INFO_MISSING_ERROR |
private 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 |
consumerBuilder(MessageConsumerBuilder consumerBuilder)
Sets the
MessageConsumerBuilder which is used to create the
MessageConsumer for the created DataReceiverImpl. |
DataReceiverImpl.Builder |
dataHandler(IncomingStreamHandler 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 |
name(String name) |
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. |
private static final String QUEUE_INFO_MISSING_ERROR
private static final String DATA_HANDLER_MISSING_ERROR
private IncomingStreamHandler dataHandler
private RabbitQueue queue
private String queueName
private int maxParallelProcessedMsgs
private RabbitQueueFactory factory
private MessageConsumerBuilder consumerBuilder
private String name
public DataReceiverImpl.Builder dataHandler(IncomingStreamHandler 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.Builder consumerBuilder(MessageConsumerBuilder consumerBuilder)
MessageConsumerBuilder which is used to create the
MessageConsumer for the created DataReceiverImpl.consumerBuilder - the builder used to create the consumerpublic DataReceiverImpl.Builder name(String name)
public 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.