From 8ed83d72be6c0011e165eca3cd333a5791f5c34f Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Tue, 6 Jun 2017 17:24:15 -0400 Subject: [PATCH 1/1] Remove protocol-framework config yang The protocol-framework config yang modules aren't used, ie aren't instantiated in any config XML file, so remove them. Change-Id: I8cc8c8c8666ef731a2e7da20a3046300ce5aad45 Signed-off-by: Tom Pantelis --- .../commons/protocol-framework/pom.xml | 39 +---- .../NeverReconnectStrategyFactoryModule.java | 67 -------- ...ReconnectStrategyFactoryModuleFactory.java | 18 --- ...nnectImmediatelyStrategyFactoryModule.java | 67 -------- ...mediatelyStrategyFactoryModuleFactory.java | 18 --- .../TimedReconnectStrategyFactoryModule.java | 93 ----------- ...ReconnectStrategyFactoryModuleFactory.java | 18 --- .../main/yang/odl-protocol-framework-cfg.yang | 151 ------------------ 8 files changed, 6 insertions(+), 465 deletions(-) delete mode 100644 opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/NeverReconnectStrategyFactoryModule.java delete mode 100644 opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/NeverReconnectStrategyFactoryModuleFactory.java delete mode 100644 opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/ReconnectImmediatelyStrategyFactoryModule.java delete mode 100644 opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/ReconnectImmediatelyStrategyFactoryModuleFactory.java delete mode 100644 opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/TimedReconnectStrategyFactoryModule.java delete mode 100644 opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/TimedReconnectStrategyFactoryModuleFactory.java delete mode 100644 opendaylight/commons/protocol-framework/src/main/yang/odl-protocol-framework-cfg.yang diff --git a/opendaylight/commons/protocol-framework/pom.xml b/opendaylight/commons/protocol-framework/pom.xml index 89668163cd..44b7ae69bc 100644 --- a/opendaylight/commons/protocol-framework/pom.xml +++ b/opendaylight/commons/protocol-framework/pom.xml @@ -5,10 +5,10 @@ 4.0.0 - org.opendaylight.controller - config-parent - 0.7.0-SNAPSHOT - ../../config/config-parent + org.opendaylight.odlparent + bundle-parent + 1.8.0-Carbon + org.opendaylight.controller @@ -43,19 +43,13 @@ junit junit - - org.opendaylight.controller - config-api - - - org.opendaylight.controller - netty-config-api - org.opendaylight.yangtools mockito-configuration + 1.2.0-SNAPSHOT + test org.osgi @@ -65,27 +59,6 @@ org.slf4j slf4j-api - - org.opendaylight.controller - config-manager - test - - - org.opendaylight.controller - config-manager - test-jar - test - - - org.opendaylight.controller - config-util - test - - - org.opendaylight.controller - netty-event-executor-config - test - ch.qos.logback logback-classic diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/NeverReconnectStrategyFactoryModule.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/NeverReconnectStrategyFactoryModule.java deleted file mode 100644 index cd8023912d..0000000000 --- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/NeverReconnectStrategyFactoryModule.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2014 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.controller.config.yang.protocol.framework; - -import io.netty.util.concurrent.EventExecutor; - -import org.opendaylight.controller.config.api.JmxAttributeValidationException; -import org.opendaylight.protocol.framework.NeverReconnectStrategy; -import org.opendaylight.protocol.framework.ReconnectStrategy; -import org.opendaylight.protocol.framework.ReconnectStrategyFactory; - -/** -* -*/ -@Deprecated -public final class NeverReconnectStrategyFactoryModule extends org.opendaylight.controller.config.yang.protocol.framework.AbstractNeverReconnectStrategyFactoryModule - { - - public NeverReconnectStrategyFactoryModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public NeverReconnectStrategyFactoryModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, - final NeverReconnectStrategyFactoryModule oldModule, final java.lang.AutoCloseable oldInstance) { - - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - protected void customValidation(){ - JmxAttributeValidationException.checkNotNull(getTimeout(), "value is not set.", timeoutJmxAttribute); - JmxAttributeValidationException.checkCondition(getTimeout() >= 0, "value " + getTimeout() + " is less than 0", - timeoutJmxAttribute); - } - - @Override - public java.lang.AutoCloseable createInstance() { - return new NeverReconnectStrategyFactoryCloseable(getExecutorDependency(), getTimeout()); - } - - private static final class NeverReconnectStrategyFactoryCloseable implements ReconnectStrategyFactory, AutoCloseable { - - private final EventExecutor executor; - private final int timeout; - - public NeverReconnectStrategyFactoryCloseable(final EventExecutor executor, final int timeout) { - this.executor = executor; - this.timeout = timeout; - } - - @Override - public void close() throws Exception { - // no-op - } - - @Override - public ReconnectStrategy createReconnectStrategy() { - return new NeverReconnectStrategy(this.executor, this.timeout); - } - - } -} diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/NeverReconnectStrategyFactoryModuleFactory.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/NeverReconnectStrategyFactoryModuleFactory.java deleted file mode 100644 index 7dfe2c9083..0000000000 --- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/NeverReconnectStrategyFactoryModuleFactory.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2014 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.controller.config.yang.protocol.framework; - -/** -* -*/ -@Deprecated -public class NeverReconnectStrategyFactoryModuleFactory extends org.opendaylight.controller.config.yang.protocol.framework.AbstractNeverReconnectStrategyFactoryModuleFactory -{ - - -} diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/ReconnectImmediatelyStrategyFactoryModule.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/ReconnectImmediatelyStrategyFactoryModule.java deleted file mode 100644 index 40219f89fc..0000000000 --- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/ReconnectImmediatelyStrategyFactoryModule.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2014 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.controller.config.yang.protocol.framework; - -import io.netty.util.concurrent.EventExecutor; - -import org.opendaylight.controller.config.api.JmxAttributeValidationException; -import org.opendaylight.protocol.framework.ReconnectImmediatelyStrategy; -import org.opendaylight.protocol.framework.ReconnectStrategy; -import org.opendaylight.protocol.framework.ReconnectStrategyFactory; - -/** -* -*/ -@Deprecated -public final class ReconnectImmediatelyStrategyFactoryModule extends org.opendaylight.controller.config.yang.protocol.framework.AbstractReconnectImmediatelyStrategyFactoryModule - { - - public ReconnectImmediatelyStrategyFactoryModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public ReconnectImmediatelyStrategyFactoryModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, - final ReconnectImmediatelyStrategyFactoryModule oldModule, final java.lang.AutoCloseable oldInstance) { - - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - protected void customValidation(){ - JmxAttributeValidationException.checkNotNull(getReconnectTimeout(), "value is not set.", reconnectTimeoutJmxAttribute); - JmxAttributeValidationException.checkCondition(getReconnectTimeout() >= 0, "value " + getReconnectTimeout() + " is less than 0", - reconnectTimeoutJmxAttribute); - } - - @Override - public java.lang.AutoCloseable createInstance() { - return new ReconnectImmediatelyStrategyFactoryCloseable(getReconnectExecutorDependency(), getReconnectTimeout()); - } - - private static final class ReconnectImmediatelyStrategyFactoryCloseable implements ReconnectStrategyFactory, AutoCloseable { - - private final EventExecutor executor; - private final int timeout; - - public ReconnectImmediatelyStrategyFactoryCloseable(final EventExecutor executor, final int timeout) { - this.executor = executor; - this.timeout = timeout; - } - - @Override - public void close() throws Exception { - // no-op - } - - @Override - public ReconnectStrategy createReconnectStrategy() { - return new ReconnectImmediatelyStrategy(this.executor, this.timeout); - } - - } -} diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/ReconnectImmediatelyStrategyFactoryModuleFactory.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/ReconnectImmediatelyStrategyFactoryModuleFactory.java deleted file mode 100644 index 7aa31f30cd..0000000000 --- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/ReconnectImmediatelyStrategyFactoryModuleFactory.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2014 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.controller.config.yang.protocol.framework; - -/** -* -*/ -@Deprecated -public class ReconnectImmediatelyStrategyFactoryModuleFactory extends org.opendaylight.controller.config.yang.protocol.framework.AbstractReconnectImmediatelyStrategyFactoryModuleFactory -{ - - -} diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/TimedReconnectStrategyFactoryModule.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/TimedReconnectStrategyFactoryModule.java deleted file mode 100644 index 1820d3da91..0000000000 --- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/TimedReconnectStrategyFactoryModule.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2014 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.controller.config.yang.protocol.framework; - -import io.netty.util.concurrent.EventExecutor; - -import org.opendaylight.controller.config.api.JmxAttributeValidationException; -import org.opendaylight.protocol.framework.ReconnectStrategy; -import org.opendaylight.protocol.framework.ReconnectStrategyFactory; -import org.opendaylight.protocol.framework.TimedReconnectStrategy; - -import com.google.common.base.Preconditions; - -/** -* -*/ -@Deprecated -public final class TimedReconnectStrategyFactoryModule extends org.opendaylight.controller.config.yang.protocol.framework.AbstractTimedReconnectStrategyFactoryModule - { - - public TimedReconnectStrategyFactoryModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public TimedReconnectStrategyFactoryModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, - final TimedReconnectStrategyFactoryModule oldModule, final java.lang.AutoCloseable oldInstance) { - - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - protected void customValidation(){ - JmxAttributeValidationException.checkNotNull(getSleepFactor(), "value is not set.", sleepFactorJmxAttribute); - JmxAttributeValidationException.checkCondition(getSleepFactor().doubleValue() >= 1, "value " + getSleepFactor() - + " is less than 1", sleepFactorJmxAttribute); - - JmxAttributeValidationException.checkNotNull(getConnectTime(), "value is not set.", connectTimeJmxAttribute); - JmxAttributeValidationException.checkCondition(getConnectTime() >= 0, "value " + getConnectTime() - + " is less than 0", connectTimeJmxAttribute); - - JmxAttributeValidationException.checkNotNull(getMinSleep(), "value is not set.", minSleepJmxAttribute); - JmxAttributeValidationException.checkCondition(getMaxSleep() == null || getMinSleep() <= getMaxSleep(), - "value " + getMinSleep() + " is greter than MaxSleep " + getMaxSleep(), minSleepJmxAttribute); - } - - @Override - public java.lang.AutoCloseable createInstance() { - return new TimedReconnectStrategyFactoryCloseable(getTimedReconnectExecutorDependency(), - getConnectTime(), getMinSleep(), getSleepFactor().doubleValue(), getMaxSleep(), getMaxAttempts(), - getDeadline()); - } - - private static final class TimedReconnectStrategyFactoryCloseable implements ReconnectStrategyFactory, AutoCloseable { - - private final EventExecutor executor; - private final Long deadline, maxAttempts, maxSleep; - private final double sleepFactor; - private final int connectTime; - private final long minSleep; - - public TimedReconnectStrategyFactoryCloseable(final EventExecutor executor, final int connectTime, final long minSleep, final double sleepFactor, - final Long maxSleep, final Long maxAttempts, final Long deadline) { - Preconditions.checkArgument(maxSleep == null || minSleep <= maxSleep); - Preconditions.checkArgument(sleepFactor >= 1); - Preconditions.checkArgument(connectTime >= 0); - this.executor = Preconditions.checkNotNull(executor); - this.deadline = deadline; - this.maxAttempts = maxAttempts; - this.minSleep = minSleep; - this.maxSleep = maxSleep; - this.sleepFactor = sleepFactor; - this.connectTime = connectTime; - } - - @Override - public void close() throws Exception { - // no-op - } - - @Override - public ReconnectStrategy createReconnectStrategy() { - return new TimedReconnectStrategy(this.executor, - this.connectTime, this.minSleep, this.sleepFactor, this.maxSleep, this.maxAttempts, - this.deadline); - } - - } -} diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/TimedReconnectStrategyFactoryModuleFactory.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/TimedReconnectStrategyFactoryModuleFactory.java deleted file mode 100644 index eac0c66fd8..0000000000 --- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/controller/config/yang/protocol/framework/TimedReconnectStrategyFactoryModuleFactory.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2014 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.controller.config.yang.protocol.framework; - -/** -* -*/ -@Deprecated -public class TimedReconnectStrategyFactoryModuleFactory extends org.opendaylight.controller.config.yang.protocol.framework.AbstractTimedReconnectStrategyFactoryModuleFactory -{ - - -} diff --git a/opendaylight/commons/protocol-framework/src/main/yang/odl-protocol-framework-cfg.yang b/opendaylight/commons/protocol-framework/src/main/yang/odl-protocol-framework-cfg.yang deleted file mode 100644 index cd84d4a95e..0000000000 --- a/opendaylight/commons/protocol-framework/src/main/yang/odl-protocol-framework-cfg.yang +++ /dev/null @@ -1,151 +0,0 @@ -// vi: set smarttab et sw=4 tabstop=4: -module protocol-framework { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:controller:protocol:framework"; - prefix "pf"; - - import config { prefix config; revision-date 2013-04-05; } - import netty { prefix netty; revision-date 2013-11-19; } - - organization "Cisco Systems, Inc."; - - contact "Milos Fabian "; - - description - "This module contains the base YANG definitions for - protocol framework. - - Copyright (c)2013 Cisco Systems, Inc. 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"; - - revision "2014-03-13" { - description - "Changed reconnect-strategy to reconnect-strategy-factory - represents ReconnectStrategyFactory. - reconnect-strategy-factory modules provides reconnect-strategy-factory service."; - } - - revision "2013-11-09" { - description - "Initial revision"; - } - - identity reconnect-strategy-factory { - description - "Service representing a reconnect strategy factory."; - - base "config:service-type"; - config:java-class "org.opendaylight.protocol.framework.ReconnectStrategyFactory"; - } - - identity never-reconnect-strategy-factory { - base config:module-type; - config:provided-service reconnect-strategy-factory; - config:java-name-prefix NeverReconnectStrategyFactory; - } - - augment "/config:modules/config:module/config:configuration" { - case never-reconnect-strategy-factory { - when "/config:modules/config:module/config:type = 'never-reconnect-strategy-factory'"; - - leaf timeout { - mandatory true; - type int32; - } - - container executor { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity netty:netty-event-executor; - } - } - } - } - } - - identity reconnect-immediately-strategy-factory { - base config:module-type; - config:provided-service reconnect-strategy-factory; - config:java-name-prefix ReconnectImmediatelyStrategyFactory; - } - - augment "/config:modules/config:module/config:configuration" { - case reconnect-immediately-strategy-factory { - when "/config:modules/config:module/config:type = 'reconnect-immediately-strategy-factory'"; - - leaf reconnect-timeout { - mandatory true; - type int32; - } - - container reconnect-executor { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity netty:netty-event-executor; - } - } - } - } - } - - identity timed-reconnect-strategy-factory { - base config:module-type; - config:provided-service reconnect-strategy-factory; - config:java-name-prefix TimedReconnectStrategyFactory; - } - - augment "/config:modules/config:module/config:configuration" { - case timed-reconnect-strategy-factory { - when "/config:modules/config:module/config:type = 'timed-reconnect-strategy-factory'"; - - leaf deadline { - type int64; - units "epoch nanoseconds"; - } - - leaf max-attempts { - mandatory true; - type int64; - } - - leaf max-sleep { - mandatory true; - type int64; - units "milliseconds"; - } - - leaf min-sleep { - mandatory true; - type int64; - units "milliseconds"; - } - - leaf sleep-factor { - mandatory true; - type decimal64 { - fraction-digits 2; - } - } - - leaf connect-time { - mandatory true; - type int32; - units "milliseconds"; - } - - container timed-reconnect-executor { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity netty:netty-event-executor; - } - } - } - } - } -} \ No newline at end of file -- 2.36.6