2 * Copyright (c) 2014, 2015 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
9 package org.opendaylight.openflowplugin.test;
11 import java.math.BigInteger;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.errors.rev131116.ErrorType;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.BadActionErrorNotification;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.BadInstructionErrorNotification;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.BadMatchErrorNotification;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.BadRequestErrorNotification;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.ExperimenterErrorNotification;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.FlowModErrorNotification;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.GroupModErrorNotification;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.HelloFailedErrorNotification;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.MeterModErrorNotification;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.PortModErrorNotification;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.QueueOpErrorNotification;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.RoleRequestErrorNotification;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.SwitchConfigErrorNotification;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.TableFeaturesErrorNotification;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.TableModErrorNotification;
29 import org.slf4j.Logger;
30 import org.slf4j.LoggerFactory;
33 * dummy implementation flushing events into log
36 public class NodeErrorListenerLoggingImpl implements NodeErrorListener {
38 private static final Logger LOG = LoggerFactory.getLogger(NodeErrorListenerLoggingImpl.class);
41 public void onBadActionErrorNotification(BadActionErrorNotification notification) {
42 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
46 public void onBadInstructionErrorNotification(BadInstructionErrorNotification notification) {
47 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
51 public void onBadMatchErrorNotification(BadMatchErrorNotification notification) {
52 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
56 public void onBadRequestErrorNotification(BadRequestErrorNotification notification) {
57 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
61 public void onExperimenterErrorNotification(ExperimenterErrorNotification notification) {
62 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
66 public void onFlowModErrorNotification(FlowModErrorNotification notification) {
67 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
71 public void onGroupModErrorNotification(GroupModErrorNotification notification) {
72 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
76 public void onHelloFailedErrorNotification(HelloFailedErrorNotification notification) {
77 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
81 public void onMeterModErrorNotification(MeterModErrorNotification notification) {
82 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
86 public void onPortModErrorNotification(PortModErrorNotification notification) {
87 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
91 public void onQueueOpErrorNotification(QueueOpErrorNotification notification) {
92 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
96 public void onRoleRequestErrorNotification(RoleRequestErrorNotification notification) {
97 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
101 public void onSwitchConfigErrorNotification(SwitchConfigErrorNotification notification) {
102 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
106 public void onTableFeaturesErrorNotification(TableFeaturesErrorNotification notification) {
107 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
111 public void onTableModErrorNotification(TableModErrorNotification notification) {
112 LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
115 private String toStr(ErrorType type, int code, BigInteger xid) {
116 return "[Type="+type+", Code="+ code +", Xid ="+xid+"]";