Class JsonMonitorableMerger

  • All Implemented Interfaces:
    JsonMonitorable

    public class JsonMonitorableMerger
    extends Object
    implements JsonMonitorable
    A simple JsonMonitorable implementation that joins a set of other JsonMonitorables.
    Author:
    Eyal Schneider
    • Constructor Detail

      • JsonMonitorableMerger

        public JsonMonitorableMerger​(JsonMonitorable... monitorables)
        Constructor
        Parameters:
        monitorables - The set of monitorables to join. Note that if they have children with the same names, one will override the other in an arbitrarily manner.
    • Method Detail

      • getOwnMetrics

        public net.minidev.json.JSONObject getOwnMetrics()
        Specified by:
        getOwnMetrics in interface JsonMonitorable
        Returns:
        The json string describing the entity, not including the child entities.
      • getChildren

        public Map<String,​JsonMonitorable> getChildren()
        Specified by:
        getChildren in interface JsonMonitorable
        Returns:
        The monitorable children of this entity, as [id, JsonExportable] pairs. Using this method, the framework can manage a complete tree to be monitored, where every entity has a unique path.