public class BlaubotChannelConfig
extends java.util.Observable
Modifier and Type | Class and Description |
---|---|
static class |
BlaubotChannelConfig.MessagePickerStrategy
Unique identifier for PickingStrategy-Implementations.
|
Modifier and Type | Field and Description |
---|---|
static int |
MESSAGE_RATE_NO_LIMIT
Use this constant for {BlaubotChannelConfig#setMessageRateLimit} to not use a message rate limit.
|
Constructor and Description |
---|
BlaubotChannelConfig(short channelId)
Constructs a channel config for a channel id using the default
MessagePickerStrategy (PROCESS_ALL).
|
Modifier and Type | Method and Description |
---|---|
short |
getChannelId()
The channel id
|
protected IBlaubotMessagePickerStrategy |
getMessagePicker()
Gets the mesage picker strategy specified by the user
|
int |
getMinMessageRateDelay()
The minimun delay between two messages.
|
BlaubotChannelConfig.MessagePickerStrategy |
getPickerStrategy() |
BlaubotMessage.Priority |
getPriority()
The priority for messages sent through this channel.
|
int |
getQueueCapacity()
The max size of the message queue
|
boolean |
isTransmitIfNoSubscribers()
Check whether mesages are sent even if there are no known subscribers to this channel.
|
boolean |
isTransmitReflexiveMessages()
Check if reflexive messages to this channel are sent through the network or directly
posted to your listeners instead.
|
BlaubotChannelConfig |
setMessagePickerStrategy(BlaubotChannelConfig.MessagePickerStrategy strategy)
Sets the MessagePickerStrategy that defines, how fast messages are send or discarded.
|
BlaubotChannelConfig |
setMessageRateLimit(int minMessageRateDelay)
Sets the message rate limit.
|
BlaubotChannelConfig |
setPriority(BlaubotMessage.Priority priority)
Sets the priority for messages sent through this channel.
|
void |
setQueueCapacity(int queueCapacity)
Sets max the size of the message queue.
|
void |
setTransmitIfNoSubscribers(boolean transmitIfNoSubscribers)
Sets a flag to avoid sending messages, if there are no known subscribers yet.
|
void |
setTransmitReflexiveMessages(boolean transmitReflexiveMessages)
If set to true, reflexive messages (messages that are posted to a channel to which we are
subscribed) are not send to the master device but directly posted to the registered listeners.
|
public static final int MESSAGE_RATE_NO_LIMIT
public BlaubotChannelConfig(short channelId)
channelId
- the channel's idpublic void setQueueCapacity(int queueCapacity)
queueCapacity
- the new capacity.public int getQueueCapacity()
public short getChannelId()
protected IBlaubotMessagePickerStrategy getMessagePicker()
public BlaubotChannelConfig.MessagePickerStrategy getPickerStrategy()
public BlaubotChannelConfig setMessagePickerStrategy(BlaubotChannelConfig.MessagePickerStrategy strategy)
strategy
- the strategy to useBlaubotChannelConfig.MessagePickerStrategy
public BlaubotChannelConfig setMessageRateLimit(int minMessageRateDelay)
minMessageRateDelay
- the minimum delay between two messages that are picked to be sent in millisecondspublic BlaubotChannelConfig setPriority(BlaubotMessage.Priority priority)
priority
- the prioritypublic BlaubotMessage.Priority getPriority()
public int getMinMessageRateDelay()
public boolean isTransmitReflexiveMessages()
public void setTransmitReflexiveMessages(boolean transmitReflexiveMessages)
transmitReflexiveMessages
- true to reduce traffic in these cases on the sending devicepublic boolean isTransmitIfNoSubscribers()
public void setTransmitIfNoSubscribers(boolean transmitIfNoSubscribers)
transmitIfNoSubscribers
- If set to true, messages published to this channel are always send