public static class DataSenderImpl.Builder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
deliveryMode |
protected RabbitQueueFactory |
factory |
protected IdGenerator |
idGenerator |
protected int |
messageConfirmBuffer |
protected int |
messageSize |
protected String |
name |
protected RabbitQueue |
queue |
protected static String |
QUEUE_INFO_MISSING_ERROR |
protected String |
queueName |
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
DataSenderImpl |
build()
Builds the
DataReceiverImpl instance with the previously given
information. |
DataSenderImpl.Builder |
deliveryMode(int deliveryMode)
Sets the delivery mode used for the RabbitMQ messages.
|
DataSenderImpl.Builder |
idGenerator(IdGenerator idGenerator)
Sets the Id generator used to create unique stream Ids.
|
DataSenderImpl.Builder |
messageBuffer(int messageConfirmBuffer)
Sets the number of messages that are buffered while waiting for a
confirmation that they have been received by the broker.
|
DataSenderImpl.Builder |
messageSize(int messageSize)
Sets the size of the messages that will be send.
|
DataSenderImpl.Builder |
name(String name) |
DataSenderImpl.Builder |
queue(RabbitQueue queue)
Sets the queue that is used to receive data.
|
DataSenderImpl.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 IdGenerator idGenerator
protected RabbitQueue queue
protected String queueName
protected RabbitQueueFactory factory
protected int messageSize
protected int messageConfirmBuffer
protected int deliveryMode
protected String name
public DataSenderImpl.Builder idGenerator(IdGenerator idGenerator)
dataHandler - the Id generator used to create unique stream Idspublic DataSenderImpl.Builder queue(RabbitQueue queue)
queue - the queue that is used to receive datapublic DataSenderImpl.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 DataSenderImpl.Builder messageSize(int messageSize)
messageSize - the size of the messages that will be sendpublic DataSenderImpl.Builder messageBuffer(int messageConfirmBuffer)
Sets the number of messages that are buffered while waiting for a confirmation that they have been received by the broker. Note that if the message buffer has reached is maximum size, the sender will block until confirmations are received.
If the given message buffer size is <1 the usage of confirmation
messages is turned off.
messageConfirmBuffer - the size of the messages bufferpublic DataSenderImpl.Builder deliveryMode(int deliveryMode)
DataSenderImpl.DEFAULT_DELIVERY_MODE.deliveryMode - the delivery mode used for the RabbitMQ messagespublic DataSenderImpl.Builder name(String name)
public DataSenderImpl build() throws IllegalStateException, IOException
DataReceiverImpl instance with the previously given
information.IllegalStateException - 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.Copyright © 2017–2018. All rights reserved.