Package io.hekate.messaging.operation
Interface BroadcastResult<T>
-
- Type Parameters:
T
- Base type of broadcast message.
public interface BroadcastResult<T>
Result of aBroadcast
operation.- See Also:
MessagingChannel.newBroadcast(Object)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Throwable
errorOf(ClusterNode node)
Returns a communication error for the specified node ornull
if there was no communication failure with that node.Map<ClusterNode,Throwable>
errors()
Returns the map of cluster nodes and errors that happened while trying to communicate with these nodes.default boolean
isSuccess()
Returnstrue
if broadcast completed successfully without anyerrors
.default boolean
isSuccess(ClusterNode node)
Returnstrue
if there was no communication failure with the specified cluster node..T
message()
Returns the original message object that was submitted to the cluster.List<ClusterNode>
nodes()
Returns the broadcast operation participants.
-
-
-
Method Detail
-
message
T message()
Returns the original message object that was submitted to the cluster.- Returns:
- Original message.
-
nodes
List<ClusterNode> nodes()
Returns the broadcast operation participants. Returns an empty list if there were no suitable nodes in the cluster to perform the operation.- Returns:
- Cluster nodes that participated in the broadcast operation or an empty list if there were no suitable nodes in the cluster to perform the operation.
-
errors
Map<ClusterNode,Throwable> errors()
Returns the map of cluster nodes and errors that happened while trying to communicate with these nodes. Returns an empty map if there were no communication failures.- Returns:
- Map of nodes and their corresponding failures. Returns an empty map if there were no communication failures.
- See Also:
errorOf(ClusterNode)
-
isSuccess
default boolean isSuccess()
Returnstrue
if broadcast completed successfully without anyerrors
.- Returns:
true
if broadcast completed successfully without any errors.- See Also:
errors()
-
isSuccess
default boolean isSuccess(ClusterNode node)
Returnstrue
if there was no communication failure with the specified cluster node..- Parameters:
node
- Cluster node (must be one ofnodes()
, otherwise results will be unpredictable).- Returns:
true
if there was no communication failure with the specified cluster node.
-
errorOf
default Throwable errorOf(ClusterNode node)
Returns a communication error for the specified node ornull
if there was no communication failure with that node.
-
-