2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.openflowplugin.test;
11 import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
12 import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener.Component;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeErrorNotification;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
22 * Dummy implementation flushing events into log.
25 public final class FlowEventListenerLoggingImpl {
26 private static final Logger LOG = LoggerFactory.getLogger(FlowEventListenerLoggingImpl.class);
28 private FlowEventListenerLoggingImpl() {
32 static CompositeListener newListener() {
33 return new CompositeListener(Set.of(
34 new Component<>(FlowAdded.class, notification -> {
35 LOG.info("flow to be added {}", notification);
36 LOG.info("added flow Xid {}", notification.getTransactionId().getValue());
38 new Component<>(FlowRemoved.class, notification -> {
39 LOG.debug("removed flow {}", notification);
40 LOG.debug("remove flow Xid {}", notification.getTransactionId().getValue());
42 new Component<>(FlowUpdated.class, notification -> {
43 LOG.debug("updated flow {}", notification);
44 LOG.debug("updated flow Xid {}", notification.getTransactionId().getValue());
46 new Component<>(NodeErrorNotification.class, notification -> {
47 //commenting as we have a NodeErrorListener
48 /* LOG.error("Error notification flow Xid........................."
49 + notification.getTransactionId().getValue());
50 LOG.debug("notification Begin-Transaction:"
51 + notification.getTransactionUri()
52 + "-----------------------------------------------------------------------------------");
55 new Component<>(SwitchFlowRemoved.class, notification -> {
56 LOG.debug("Switch flow removed : Cookies {}", notification.getCookie().toString());