2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.netconf.topology;
11 import com.google.common.annotations.Beta;
14 * A customizable strategy that gets executed when a BaseTopologyManager|BaseNodeManager is created.
15 * If the election should be executed at another moment, you need to pass the NoopRoleChangeStrategy into the Manager
16 * and the role candidate registration needs to happen in your implemented Node/Topology callback
19 public interface RoleChangeStrategy extends RoleChangeListener {
22 * Your pre-election and election logic goes here, e.g you should register your candidate into the ElectionService
23 * @param electionCandidate NodeListener that should receive the subsequent onRoleChanged callback
24 * when a role change occurs.
26 void registerRoleCandidate(NodeListener electionCandidate);
29 * Invoke whenever you want to stop candidate from partaking in election.
31 void unregisterRoleCandidate();
35 * @return True/False based on if this candidate is already registered into ownership service
37 boolean isCandidateRegistered();