public static class ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule extends Object implements Comparable<ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule>
Modifier and Type | Field and Description |
---|---|
protected static ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule |
ALL_ALLOWED
A QuorumRule that permits all actions.
|
protected static ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule |
NONE_ALLOWED
A QuorumRule that rejects all actions.
|
Constructor and Description |
---|
QuorumRule(int nRuleMask,
int nThreshold)
Construct a state with the specified threshold and numeric
representation.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule that)
Compare this Rule to another one based on the
threshold . |
protected boolean |
contains(int nMask)
Return true if the current rule contains the specified action mask.
|
protected int |
getRuleMask()
Return the numeric representation of the actions allowed by this rule.
|
protected int |
getThreshold()
Return the size threshold for this rule.
|
protected void |
setRuleMask(int nRuleMask)
Set the numeric representation of the actions allowed by this rule.
|
protected void |
setThreshold(int nThreshold)
Set the size threshold for this rule.
|
String |
toString() |
protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule |
union(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule rule)
Return a quorum rule composed from this and the specified rule that
reflects the "union" of the two rules.
|
protected static final ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule NONE_ALLOWED
protected static final ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule ALL_ALLOWED
public QuorumRule(int nRuleMask, int nThreshold)
nRuleMask
- numeric representation of the statenThreshold
- the size threshold of the statepublic int compareTo(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule that)
threshold
.compareTo
in interface Comparable<ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule>
protected boolean contains(int nMask)
nMask
- the action bitmask to test forprotected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule union(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule rule)
rule
- the rule to compute the union of this withprotected int getRuleMask()
protected void setRuleMask(int nRuleMask)
nRuleMask
- the numeric representation of this ruleprotected int getThreshold()
protected void setThreshold(int nThreshold)
nThreshold
- the size threshold for this rule