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;
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;
21 * dummy implementation flushing events into log
23 public class FlowEventListenerLoggingImpl implements SalFlowListener {
25 private static Logger LOG = LoggerFactory
26 .getLogger(FlowEventListenerLoggingImpl.class);
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 LOG.info("-----------------------------------------------------------------------------------");
36 public void onFlowRemoved(FlowRemoved notification) {
37 LOG.debug("removed flow.........................." + notification.toString());
38 LOG.debug("remove flow Xid........................." + notification.getTransactionId().getValue());
39 LOG.debug("-----------------------------------------------------------------------------------");
43 public void onFlowUpdated(FlowUpdated notification) {
44 LOG.debug("updated flow.........................." + notification.toString());
45 LOG.debug("updated flow Xid........................." + notification.getTransactionId().getValue());
46 LOG.debug("-----------------------------------------------------------------------------------");
50 public void onNodeErrorNotification(NodeErrorNotification notification) {
51 //commenting as we have a NodeErrorListener
52 /* LOG.error("Error notification flow Xid........................."
53 + notification.getTransactionId().getValue());
54 LOG.debug("notification Begin-Transaction:"
55 + notification.getTransactionUri()
56 + "-----------------------------------------------------------------------------------");
61 public void onNodeExperimenterErrorNotification(
62 NodeExperimenterErrorNotification notification) {
63 // TODO Auto-generated method stub
68 public void onSwitchFlowRemoved(SwitchFlowRemoved notification) {
69 LOG.debug("Switch flow removed : Cookies..................."
70 + notification.getCookie().toString());
71 LOG.debug("-----------------------------------------------------------------------------------");