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