Search in sources :

Example 36 with Event

use of org.onosproject.event.Event in project onos by opennetworkinglab.

the class TopologyEventsListCommand method json.

/**
 * Produces a JSON array of topology events.
 *
 * @param events the topology events with the data
 * @return JSON array with the topology events
 */
private JsonNode json(List<Event> events) {
    ObjectMapper mapper = new ObjectMapper();
    ArrayNode result = mapper.createArrayNode();
    for (Event event : events) {
        result.add(json(mapper, event));
    }
    return result;
}
Also used : TopologyEvent(org.onosproject.net.topology.TopologyEvent) Event(org.onosproject.event.Event) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 37 with Event

use of org.onosproject.event.Event in project onos by opennetworkinglab.

the class OpenstackRouterManagerTest method validateEvents.

private void validateEvents(Enum... types) {
    int i = 0;
    assertEquals("Number of events did not match", types.length, testListener.events.size());
    for (Event event : testListener.events) {
        assertEquals("Incorrect event received", types[i], event.type());
        i++;
    }
    testListener.events.clear();
}
Also used : OpenstackRouterEvent(org.onosproject.openstacknetworking.api.OpenstackRouterEvent) Event(org.onosproject.event.Event)

Example 38 with Event

use of org.onosproject.event.Event in project onos by opennetworkinglab.

the class OpenstackNodeManagerTest method validateEvents.

private void validateEvents(Enum... types) {
    int i = 0;
    assertEquals("Number of events did not match", types.length, testListener.events.size());
    for (Event event : testListener.events) {
        assertEquals("Incorrect event received", types[i], event.type());
        i++;
    }
    testListener.events.clear();
}
Also used : Event(org.onosproject.event.Event) OpenstackNodeEvent(org.onosproject.openstacknode.api.OpenstackNodeEvent)

Example 39 with Event

use of org.onosproject.event.Event in project onos by opennetworkinglab.

the class OpenstackVtapManagerTest method validateEvents.

private void validateEvents(Enum... types) {
    int i = 0;
    assertEquals("Number of events did not match", types.length, testListener.events.size());
    for (Event event : testListener.events) {
        assertEquals("Incorrect event received", types[i], event.type());
        i++;
    }
    testListener.events.clear();
}
Also used : Event(org.onosproject.event.Event)

Example 40 with Event

use of org.onosproject.event.Event in project onos by opennetworkinglab.

the class MQEventHandlerTest method validateEvents.

protected void validateEvents(Enum... types) {
    int i = 0;
    for (Event event : listener.events) {
        assertEquals("incorrect event type", types[i], event.type());
        i++;
    }
    listener.events.clear();
}
Also used : Event(org.onosproject.event.Event) TopologyEvent(org.onosproject.net.topology.TopologyEvent) DeviceEvent(org.onosproject.net.device.DeviceEvent) LinkEvent(org.onosproject.net.link.LinkEvent) ConnectPoint(org.onosproject.net.ConnectPoint)

Aggregations

Event (org.onosproject.event.Event)47 TopologyEvent (org.onosproject.net.topology.TopologyEvent)9 DeviceEvent (org.onosproject.net.device.DeviceEvent)7 LinkEvent (org.onosproject.net.link.LinkEvent)6 ConnectPoint (org.onosproject.net.ConnectPoint)5 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 HostEvent (org.onosproject.net.host.HostEvent)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 Map (java.util.Map)2 Set (java.util.Set)2 CompletableFuture (java.util.concurrent.CompletableFuture)2 ExecutorService (java.util.concurrent.ExecutorService)2 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)2 Collectors (java.util.stream.Collectors)2 ClusterEvent (org.onosproject.cluster.ClusterEvent)2 MastershipEvent (org.onosproject.mastership.MastershipEvent)2 Link (org.onosproject.net.Link)2 IntentEvent (org.onosproject.net.intent.IntentEvent)2