use of org.onosproject.cluster.LeadershipAdminService in project onos by opennetworkinglab.
the class LeaderCommand method doExecute.
@Override
protected void doExecute() {
LeadershipAdminService leaderService = get(LeadershipAdminService.class);
Map<String, Leadership> leaderBoard = leaderService.getLeaderBoard();
if (topicPattern == null) {
allTopics = true;
} else {
allTopics = false;
pattern = Pattern.compile(topicPattern);
}
if (outputJson()) {
print("%s", json(leaderBoard));
return;
}
if (showCandidates) {
displayCandidates(leaderBoard);
} else {
displayLeaders(leaderBoard);
}
}
Aggregations