use of org.apache.jackrabbit.oak.plugins.observation.filter.FilterConfigMBean in project jackrabbit-oak by apache.
the class ConsolidatedListenerMBeanImpl method getLeaderBoard.
@Override
public TabularData getLeaderBoard() {
TabularDataSupport tds;
try {
int id = 0;
TabularType tt = new TabularType(LeaderBoardData.class.getName(), "Leaderboard", LeaderBoardData.TYPE, new String[] { "index" });
tds = new TabularDataSupport(tt);
List<LeaderBoardData> leaderBoard = Lists.newArrayList();
for (Map.Entry<ObjectName, EventListenerMBean> e : eventListeners.entrySet()) {
String listenerId = getListenerId(e.getKey());
EventListenerMBean mbean = e.getValue();
FilterConfigMBean filterConfigMBean = null;
for (Map.Entry<ObjectName, FilterConfigMBean> ef : filterConfigs.entrySet()) {
if (Objects.equal(getListenerId(ef.getKey()), listenerId)) {
filterConfigMBean = ef.getValue();
break;
}
}
leaderBoard.add(new LeaderBoardData(++id, mbean, filterConfigMBean));
}
sort(leaderBoard);
for (LeaderBoardData data : leaderBoard) {
tds.put(data.toCompositeData());
}
} catch (OpenDataException e) {
throw new IllegalStateException(e);
}
return tds;
}
Aggregations