From 39425ea1c0db0d8ac03a97f5656b7970e8fa27da Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Wed, 8 Dec 2021 23:16:53 -0800 Subject: [PATCH] Remove node-errors.yang node-errors.yang and its deprecated notifications are only used in test-provider. Remove the data model and the implementation in test-provider. JIRA: OPNFLWPLUG-1119 Change-Id: I43a488d6e86c025837341a16d20e0617d0f4161f Signed-off-by: Sangwook Ha --- .../src/main/yang/node-errors.yang | 186 ------------------ .../test/NodeErrorListenerLoggingImpl.java | 149 -------------- ...lowPluginBulkGroupTransactionProvider.java | 9 +- ...OpenflowPluginBulkTransactionProvider.java | 9 +- .../test/OpenflowpluginTestActivator.java | 4 +- .../OpenflowpluginTestCommandProvider.java | 3 - 6 files changed, 4 insertions(+), 356 deletions(-) delete mode 100644 model/model-flow-service/src/main/yang/node-errors.yang delete mode 100644 test-provider/src/main/java/org/opendaylight/openflowplugin/test/NodeErrorListenerLoggingImpl.java diff --git a/model/model-flow-service/src/main/yang/node-errors.yang b/model/model-flow-service/src/main/yang/node-errors.yang deleted file mode 100644 index d2cddf5d04..0000000000 --- a/model/model-flow-service/src/main/yang/node-errors.yang +++ /dev/null @@ -1,186 +0,0 @@ -module node-error { - namespace "urn:opendaylight:node:error:service"; - prefix node-error; - - import sal-flow {prefix flow; revision-date "2013-08-19";} - import flow-errors {prefix error; revision-date "2013-11-16";} - import flow-capable-transaction {prefix tr; revision-date "2015-03-04";} - - description "Openflow error messages notifications - depricated in lithium. - Error messages wont be published as standalone entities but rather packed into - special exception which will be delivered inside of RpcResult in case of failure."; - - revision "2014-04-10" { - description "Initial revision of errors received from a node"; - } - - notification hello-failed-error-notification { - description "Model for ofp_error-Type=0, Hello protocol failed"; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification bad-request-error-notification { - description "Model for ofp_error-Type=1, Request was not understood."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification bad-action-error-notification { - description "Model for ofp_error-Type=2, Error in action description."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification bad-instruction-error-notification { - description "Model for ofp_error-Type=3, Error in instruction list."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification bad-match-error-notification { - description "Model for ofp_error-Type=4, Error in match."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification flow-mod-error-notification { - description "Model for ofp_error-Type=5 - Problem modifying flow entry."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification group-mod-error-notification { - description "Model for ofp_error-Type=6 - Problem modifying group entry."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification port-mod-error-notification { - description "Model for ofp_error-Type=7 - Port mod request failed."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification table-mod-error-notification { - description "Model for ofp_error-Type=8 - Table mod request failed."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification queue-op-error-notification { - description "Model for ofp_error-Type=9 - Queue operation failed."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification switch-config-error-notification { - description "Model for ofp_error-Type=10 - Switch Config request failed."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification role-request-error-notification { - description "Model for ofp_error-Type=11 - Controller Role request failed."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification meter-mod-error-notification { - description "Model for ofp_error-Type=12 - Error in meter."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification table-features-error-notification { - description "Model for ofp_error-Type=13 - Setting table features failed."; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - notification experimenter-error-notification { - description "Model for ofp_error-Type=65535 - Experimenter Error Messages"; - status deprecated; - - uses error:error-message; - uses tr:transaction-aware; - uses tr:transaction-metadata; - uses flow:base-node-error-notification; - uses flow:node-error-reference; - } - - container node-error-container { - uses error:error-message; - } -} - diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/NodeErrorListenerLoggingImpl.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/NodeErrorListenerLoggingImpl.java deleted file mode 100644 index 876dae8255..0000000000 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/NodeErrorListenerLoggingImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowplugin.test; - -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.errors.rev131116.ErrorType; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.BadActionErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.BadInstructionErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.BadMatchErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.BadRequestErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.ExperimenterErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.FlowModErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.GroupModErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.HelloFailedErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.MeterModErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.PortModErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.QueueOpErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.RoleRequestErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.SwitchConfigErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.TableFeaturesErrorNotification; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.TableModErrorNotification; -import org.opendaylight.yangtools.yang.common.Uint16; -import org.opendaylight.yangtools.yang.common.Uint64; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Dummy implementation flushing events into log. - * - * @author kramesha - */ -public class NodeErrorListenerLoggingImpl implements NodeErrorListener { - - private static final Logger LOG = LoggerFactory.getLogger(NodeErrorListenerLoggingImpl.class); - - @Override - @Deprecated - public void onBadActionErrorNotification(final BadActionErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onBadInstructionErrorNotification(final BadInstructionErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onBadMatchErrorNotification(final BadMatchErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onBadRequestErrorNotification(final BadRequestErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onExperimenterErrorNotification(final ExperimenterErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onFlowModErrorNotification(final FlowModErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onGroupModErrorNotification(final GroupModErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onHelloFailedErrorNotification(final HelloFailedErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onMeterModErrorNotification(final MeterModErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onPortModErrorNotification(final PortModErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onQueueOpErrorNotification(final QueueOpErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onRoleRequestErrorNotification(final RoleRequestErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onSwitchConfigErrorNotification(final SwitchConfigErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onTableFeaturesErrorNotification(final TableFeaturesErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - @Override - @Deprecated - public void onTableModErrorNotification(final TableModErrorNotification notification) { - LOG.error("Error notification {}", toStr(notification.getType(), notification.getCode(), - notification.getTransactionId().getValue())); - } - - private static String toStr(final ErrorType type, final Uint16 code, final Uint64 xid) { - return "[Type=" + type + ", Code=" + code + ", Xid =" + xid + "]"; - } -} diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java index 19277ed3b6..ce2880ef24 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java @@ -13,7 +13,6 @@ import java.util.Map; import org.eclipse.osgi.framework.console.CommandInterpreter; import org.eclipse.osgi.framework.console.CommandProvider; import org.opendaylight.mdsal.binding.api.DataBroker; -import org.opendaylight.mdsal.binding.api.NotificationService; import org.opendaylight.mdsal.binding.api.ReadWriteTransaction; import org.opendaylight.mdsal.common.api.CommitInfo; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -87,7 +86,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.util.BindingMap; import org.opendaylight.yangtools.yang.common.Uint16; @@ -103,20 +101,15 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid private final DataBroker dataBroker; private final BundleContext ctx; private final String originalFlowName = "Foo"; - private final NodeErrorListener nodeErrorListener = new NodeErrorListenerLoggingImpl(); private Node testNode12; private final String originalGroupName = "Foo"; - private final NotificationService notificationService; - public OpenflowPluginBulkGroupTransactionProvider(final DataBroker dataBroker, - final NotificationService notificationService, final BundleContext ctx) { + public OpenflowPluginBulkGroupTransactionProvider(final DataBroker dataBroker, final BundleContext ctx) { this.dataBroker = dataBroker; - this.notificationService = notificationService; this.ctx = ctx; } public void init() { - notificationService.registerNotificationListener(nodeErrorListener); ctx.registerService(CommandProvider.class.getName(), this, null); createTestFlow(createTestNode(null), null, null); } diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java index 245e4d556d..d7a97d4cc3 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java @@ -13,7 +13,6 @@ import org.eclipse.jdt.annotation.NonNull; import org.eclipse.osgi.framework.console.CommandInterpreter; import org.eclipse.osgi.framework.console.CommandProvider; import org.opendaylight.mdsal.binding.api.DataBroker; -import org.opendaylight.mdsal.binding.api.NotificationService; import org.opendaylight.mdsal.binding.api.ReadWriteTransaction; import org.opendaylight.mdsal.common.api.CommitInfo; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -93,7 +92,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.util.BindingMap; import org.opendaylight.yangtools.yang.common.Uint16; @@ -110,18 +108,13 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider { private final DataBroker dataBroker; private final BundleContext ctx; private final String originalFlowName = "Foo"; - private final NodeErrorListener nodeErrorListener = new NodeErrorListenerLoggingImpl(); - private final NotificationService notificationService; - public OpenflowPluginBulkTransactionProvider(final DataBroker dataBroker, - final NotificationService notificationService, final BundleContext ctx) { + public OpenflowPluginBulkTransactionProvider(final DataBroker dataBroker, final BundleContext ctx) { this.dataBroker = dataBroker; - this.notificationService = notificationService; this.ctx = ctx; } public void init() { - notificationService.registerNotificationListener(nodeErrorListener); ctx.registerService(CommandProvider.class.getName(), this, null); createTestFlow(createTestNode(null), null, null); } diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.java index 7865b0817e..a7aeb6482f 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.java @@ -77,10 +77,10 @@ public class OpenflowpluginTestActivator implements AutoCloseable { new OpenflowpluginTestTopologyNotification(notificationService); this.cmdTopologyNotification = openflowpluginTestTopologyNotification; OpenflowPluginBulkTransactionProvider openflowPluginBulkTransactionProvider = - new OpenflowPluginBulkTransactionProvider(dataBroker, notificationService, ctx); + new OpenflowPluginBulkTransactionProvider(dataBroker, ctx); this.bulkCmdProvider = openflowPluginBulkTransactionProvider; OpenflowPluginBulkGroupTransactionProvider openflowPluginBulkGroupTransactionProvider = - new OpenflowPluginBulkGroupTransactionProvider(dataBroker, notificationService, ctx); + new OpenflowPluginBulkGroupTransactionProvider(dataBroker, ctx); this.groupCmdProvider = openflowPluginBulkGroupTransactionProvider; } diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestCommandProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestCommandProvider.java index eff31def55..f9675f5dab 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestCommandProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestCommandProvider.java @@ -160,7 +160,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.protocol.match.fields.PbbBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.util.BindingMap; import org.opendaylight.yangtools.yang.common.Uint16; @@ -183,7 +182,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider { private static final String DEST_MAC_ADDRESS = "ff:ff:ff:ff:ff:ff"; private static final String SRC_MAC_ADDRESS = "00:00:00:00:23:ae"; private final SalFlowListener flowEventListener = new FlowEventListenerLoggingImpl(); - private final NodeErrorListener nodeErrorListener = new NodeErrorListenerLoggingImpl(); private final NotificationService notificationService; public OpenflowpluginTestCommandProvider(final DataBroker dataBroker, final NotificationService notificationService, @@ -196,7 +194,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider { public void init() { // For switch events notificationService.registerNotificationListener(flowEventListener); - notificationService.registerNotificationListener(nodeErrorListener); ctx.registerService(CommandProvider.class.getName(), this, null); createTestFlow(createTestNode(null), null, null); } -- 2.36.6