OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / test-provider / src / main / java / org / opendaylight / openflowplugin / test / FlowEventListenerLoggingImpl.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.openflowplugin.test;
9
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeErrorNotification;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeExperimenterErrorNotification;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
19
20 /**
21  * Dummy implementation flushing events into log.
22  */
23 public class FlowEventListenerLoggingImpl implements SalFlowListener {
24
25     private static final Logger LOG = LoggerFactory
26             .getLogger(FlowEventListenerLoggingImpl.class);
27
28     @Override
29     public void onFlowAdded(FlowAdded notification) {
30         LOG.info("flow to be added {}", notification.toString());
31         LOG.info("added flow Xid {}", notification.getTransactionId().getValue());
32     }
33
34     @Override
35     public void onFlowRemoved(FlowRemoved notification) {
36         LOG.debug("removed flow {}", notification.toString());
37         LOG.debug("remove flow Xid {}", notification.getTransactionId().getValue());
38     }
39
40     @Override
41     public void onFlowUpdated(FlowUpdated notification) {
42         LOG.debug("updated flow {}", notification.toString());
43         LOG.debug("updated flow Xid {}", notification.getTransactionId().getValue());
44     }
45
46     @Override
47     public void onNodeErrorNotification(NodeErrorNotification notification) {
48     //commenting as we have a NodeErrorListener
49     /*    LOG.error("Error notification  flow Xid........................."
50                 + notification.getTransactionId().getValue());
51         LOG.debug("notification Begin-Transaction:"
52                 + notification.getTransactionUri()
53                 + "-----------------------------------------------------------------------------------");
54     */
55     }
56
57     @Override
58     public void onNodeExperimenterErrorNotification(
59             NodeExperimenterErrorNotification notification) {
60         // TODO Auto-generated method stub
61
62     }
63
64     @Override
65     public void onSwitchFlowRemoved(SwitchFlowRemoved notification) {
66         LOG.debug("Switch flow removed : Cookies {}", notification.getCookie().toString());
67     }
68 }