Package com.yahoo.messagebus
Class MessageBusParams
java.lang.Object
com.yahoo.messagebus.MessageBusParams
To facilitate several configuration parameters to the
MessageBus
constructor, all parameters are held by this
class. This class has reasonable default values for each parameter.- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorDescriptionConstructs a new instance of this parameter object with default values for all members.MessageBusParams
(MessageBusParams params) Implements the copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddProtocol
(Protocol protocol) Adds a new protocol to this.addProtocols
(List<Protocol> protocols) Registers multiple protocols with this by callingaddProtocol(Protocol)
multiple times.int
Returns the maximum number of pending messages.int
Returns the maximum number of bytes allowed for pending messages.int
Returns the number of protocols that are contained in this.getProtocol
(int i) Returns the protocol at the given index.Returns the retry policy for the resender.setMaxPendingCount
(int maxCount) Sets the maximum number of allowed pending messages.setMaxPendingSize
(int maxSize) Sets the maximum number of bytes allowed for pending messages.setMessageBusConfig
(MessagebusConfig config) setRetryPolicy
(RetryPolicy retryPolicy) Sets the retry policy for the resender.
-
Constructor Details
-
MessageBusParams
public MessageBusParams()Constructs a new instance of this parameter object with default values for all members. -
MessageBusParams
Implements the copy constructor.- Parameters:
params
- The object to copy.
-
-
Method Details
-
getRetryPolicy
Returns the retry policy for the resender.- Returns:
- The policy.
-
setRetryPolicy
Sets the retry policy for the resender.- Parameters:
retryPolicy
- The policy to set.- Returns:
- This, to allow chaining.
-
addProtocol
Adds a new protocol to this.- Parameters:
protocol
- The protocol to add.- Returns:
- This, to allow chaining.
-
addProtocols
Registers multiple protocols with this by callingaddProtocol(Protocol)
multiple times.- Parameters:
protocols
- The protocols to register.- Returns:
- This, to allow chaining.
-
getNumProtocols
public int getNumProtocols()Returns the number of protocols that are contained in this.- Returns:
- The number of protocols.
-
getProtocol
Returns the protocol at the given index.- Parameters:
i
- The index of the protocol to return.- Returns:
- The protocol object.
-
getMaxPendingCount
public int getMaxPendingCount()Returns the maximum number of pending messages.- Returns:
- The count limit.
-
setMaxPendingCount
Sets the maximum number of allowed pending messages.- Parameters:
maxCount
- The count limit to set.- Returns:
- This, to allow chaining.
-
getMaxPendingSize
public int getMaxPendingSize()Returns the maximum number of bytes allowed for pending messages.- Returns:
- The size limit.
-
setMaxPendingSize
Sets the maximum number of bytes allowed for pending messages.- Parameters:
maxSize
- The size limit to set.- Returns:
- This, to allow chaining.
-
getMessageBusConfig
-
setMessageBusConfig
-