APISonar


org.onosproject.net.topology.Topology.time

> org > onosproject > net > topology > Topology > time
org APIs onosproject APIs net APIs topology APIs Topology APIs time APIs

Example 1
public ObjectNode encode(Topology topology, CodecContext context) {
        checkNotNull(topology, "Topology cannot be null");

        return context.mapper().createObjectNode()
                .put("time", topology.time())
                .put("devices", topology.deviceCount())
                .put("links", topology.linkCount())
                .put("clusters", topology.clusterCount());
    }
Example 2
public static JsonObject json(TopologyEvent event) {
        Topology topology = event.subject();
        JsonObject jo = new JsonObject();
        jo.addProperty(TOPO_TYPE, TopologyEvent.Type.TOPOLOGY_CHANGED.name());
        jo.addProperty(CLUSTER_COUNT, topology.clusterCount());
        jo.addProperty(COMPUTE_COST, topology.computeCost());
        jo.addProperty(CREATE_TIME, new Date(topology.creationTime()).toString());
        jo.addProperty(DEVICE_COUNT, topology.deviceCount());
        jo.addProperty(LINK_COUNT, topology.linkCount());
        jo.addProperty(AVAILABLE, new Date(topology.time()).toString());
        return jo;
    }