public class ResponseCollector<T> extends java.lang.Object implements Condition
Constructor and Description |
---|
ResponseCollector() |
ResponseCollector(Address... members) |
ResponseCollector(java.util.Collection<Address> members) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Address member,
T data) |
java.util.List<Address> |
getMissing()
Returns a list of members which didn't send a valid response
|
java.util.Map<Address,T> |
getResults() |
java.util.List<Address> |
getValidResults() |
boolean |
hasAllResponses() |
boolean |
isMet()
Return true if the condition is met and false otherwise
|
int |
numberOfValidResponses() |
void |
remove(Address member) |
void |
remove(java.util.List<Address> members) |
void |
reset() |
void |
reset(Address... members) |
void |
reset(java.util.Collection<Address> members) |
boolean |
retainAll(java.util.List<Address> members) |
int |
size() |
void |
suspect(Address member) |
java.lang.String |
toString() |
boolean |
waitForAllResponses(long timeout)
Waits until all responses have been received, or until a timeout has elapsed.
|
public ResponseCollector(java.util.Collection<Address> members)
members
- List of members from which we expect responsespublic ResponseCollector(Address... members)
public ResponseCollector()
public void remove(Address member)
public void remove(java.util.List<Address> members)
public boolean retainAll(java.util.List<Address> members)
public void suspect(Address member)
public boolean isMet()
Condition
public boolean hasAllResponses()
public int numberOfValidResponses()
public java.util.List<Address> getMissing()
public java.util.List<Address> getValidResults()
public int size()
public boolean waitForAllResponses(long timeout)
timeout
- Number of milliseconds to wait max. This value needs to be greater than 0, or else
it will be adjusted to 2000public void reset()
public void reset(java.util.Collection<Address> members)
public void reset(Address... members)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1998-2020 Red Hat. All Rights Reserved.