Class CandidateConfig

    • Constructor Detail

      • CandidateConfig

        public CandidateConfig()
        Default constructor.
      • CandidateConfig

        public CandidateConfig​(String group)
        Constructs new instance.
        Parameters:
        group - Group name (see setGroup(String)).
    • Method Detail

      • getGroup

        public String getGroup()
        Returns the election group name (see setGroup(String)).
        Returns:
        Election group name.
      • setGroup

        public void setGroup​(String group)
        Sets the election group name. Can contain only alpha-numeric characters and non-repeatable dots/hyphens.

        Only one candidate among all candidates that are registered with the same group name will be elected as a leader and all other candidates will remain in the follower state. If candidates are registered with different group names then they will form completely independent groups with each group having its own leader.

        Value of this parameter is mandatory and must be unique across all configurations registered within the ElectionServiceFactory.

        Parameters:
        group - Group name (can contain only alpha-numeric characters and non-repeatable dots/hyphens).
      • setCandidate

        public void setCandidate​(Candidate candidate)
        Sets the leader election candidate that should be notified upon group leader election results.
        Parameters:
        candidate - Leader election candidate.