@Override
  public boolean updateData(TopologyUpdateEvent update) throws AmbariException {
    boolean changed = super.updateData(update);
    if (changed) {
      // it is not allowed to change existent update event before arriving to listener and converting to json
      // so it is better to create copy
      TopologyUpdateEvent copiedUpdate = update.deepCopy();
      TopologyAgentUpdateEvent topologyAgentUpdateEvent = new TopologyAgentUpdateEvent(copiedUpdate.getClusters(),
        copiedUpdate.getHash(),
        copiedUpdate.getEventType()
      );
      prepareAgentTopology(topologyAgentUpdateEvent);
      LOG.debug("Publishing Topology Agent Update Event hash={}", topologyAgentUpdateEvent.getHash());
      STOMPUpdatePublisher.publish(topologyAgentUpdateEvent);
    }

    return changed;
  }
Is used during agent registering to provide base info about clusters topology.
@return filled TopologyUpdateEvent with info about all components and hosts in all clusters
ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/TopologyHolder.java