class EntityGraph implements ConfigurationChangeListener {

    @Override
    public void onAdd(Entity entity) throws IvoryException {
        Map<Node, Set<Node>> nodeEdges = null;
        switch (entity.getEntityType()) {
            case PROCESS:
                nodeEdges = getEdgesFor((Process) entity);
                break;
            case FEED:
                nodeEdges = getEdgesFor((Feed) entity);
                break;
        }
        if (nodeEdges == null)
            return;
        LOG.trace("Adding edges for " + entity.getName() + ": " + nodeEdges);

        for (Map.Entry<Node, Set<Node>> entry : nodeEdges.entrySet()) {
            if (graph.containsKey(entry.getKey())) {
                graph.get(entry.getKey()).addAll(entry.getValue());
            } else {
                graph.put(entry.getKey(), entry.getValue());
            }
        }
        LOG.trace("Merged edges to graph " + entity.getName());
    }

    private  EntityGraph();

}