public boolean process(String type, String message, Object object) {
Topology topology = (Topology) object;
if (CompleteTopologyEvent.class.getName().equals(type)) {
// Parse complete message and build event
CompleteTopologyEvent event = (CompleteTopologyEvent) Util.jsonToObject(message, CompleteTopologyEvent.class);
// if topology has not already initialized
if (!topology.isInitialized()) {
// Apply service filter
if (TopologyServiceFilter.getInstance().isActive()) {
// Add services included in service filter
for (Service service : event.getTopology().getServices()) {
if (TopologyServiceFilter.getInstance()
.serviceNameIncluded(service.getServiceName())) {
topology.addService(service);
} else {
if (log.isDebugEnabled()) {
log.debug(String.format(
"Service is excluded: [service] %s",
service.getServiceName()));
}
}
}
} else {
// Add all services
topology.addServices(event.getTopology().getServices());
}
// Apply cluster filter
if (TopologyClusterFilter.getInstance().isActive()) {
for (Service service : topology.getServices()) {