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.
37 public class NodeErrorListenerLoggingImpl implements NodeErrorListener {
39 private static final Logger LOG = LoggerFactory.getLogger(NodeErrorListenerLoggingImpl.class);
42 public void onBadActionErrorNotification(BadActionErrorNotification notification) {
43 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
44 notification.getTransactionId().getValue()));
48 public void onBadInstructionErrorNotification(BadInstructionErrorNotification notification) {
49 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
50 notification.getTransactionId().getValue()));
54 public void onBadMatchErrorNotification(BadMatchErrorNotification notification) {
55 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
56 notification.getTransactionId().getValue()));
60 public void onBadRequestErrorNotification(BadRequestErrorNotification notification) {
61 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
62 notification.getTransactionId().getValue()));
66 public void onExperimenterErrorNotification(ExperimenterErrorNotification notification) {
67 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
68 notification.getTransactionId().getValue()));
72 public void onFlowModErrorNotification(FlowModErrorNotification notification) {
73 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
74 notification.getTransactionId().getValue()));
78 public void onGroupModErrorNotification(GroupModErrorNotification notification) {
79 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
80 notification.getTransactionId().getValue()));
84 public void onHelloFailedErrorNotification(HelloFailedErrorNotification notification) {
85 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
86 notification.getTransactionId().getValue()));
90 public void onMeterModErrorNotification(MeterModErrorNotification notification) {
91 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
92 notification.getTransactionId().getValue()));
96 public void onPortModErrorNotification(PortModErrorNotification notification) {
97 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
98 notification.getTransactionId().getValue()));
102 public void onQueueOpErrorNotification(QueueOpErrorNotification notification) {
103 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
104 notification.getTransactionId().getValue()));
108 public void onRoleRequestErrorNotification(RoleRequestErrorNotification notification) {
109 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
110 notification.getTransactionId().getValue()));
114 public void onSwitchConfigErrorNotification(SwitchConfigErrorNotification notification) {
115 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
116 notification.getTransactionId().getValue()));
120 public void onTableFeaturesErrorNotification(TableFeaturesErrorNotification notification) {
121 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
122 notification.getTransactionId().getValue()));
126 public void onTableModErrorNotification(TableModErrorNotification notification) {
127 LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(),
128 notification.getTransactionId().getValue()));
131 private String toStr(ErrorType type, int code, BigInteger xid) {
132 return "[Type=" + type + ", Code=" + code + ", Xid =" + xid + "]";