<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-parent</artifactId>
- <version>0.7.0-SNAPSHOT</version>
- <relativePath>../../config/config-parent</relativePath>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>bundle-parent</artifactId>
+ <version>1.8.0-Carbon</version>
+ <relativePath/>
</parent>
<groupId>org.opendaylight.controller</groupId>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>netty-config-api</artifactId>
- </dependency>
<!-- Testing dependencies -->
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>mockito-configuration</artifactId>
+ <version>1.2.0-SNAPSHOT</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-manager</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-manager</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-util</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>netty-event-executor-config</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
+++ /dev/null
-/*
- * 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);
- }
-
- }
-}
+++ /dev/null
-/*
- * 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
-{
-
-
-}
+++ /dev/null
-/*
- * 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);
- }
-
- }
-}
+++ /dev/null
-/*
- * 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
-{
-
-
-}
+++ /dev/null
-/*
- * 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);
- }
-
- }
-}
+++ /dev/null
-/*
- * 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
-{
-
-
-}
+++ /dev/null
-// 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 <milfabia@cisco.com>";
-
- 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