From: Robert Varga Date: Tue, 10 Jun 2014 12:06:08 +0000 (+0200) Subject: BUG-272: fix sal-remoterpc-connector X-Git-Tag: release/helium~664^2~5 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=ef6ec4567577db01766ef1d572ee3453aa73e8a5 BUG-272: fix sal-remoterpc-connector Fixes various offences in sal-remoterpc-connector Change-Id: I7ede148251ba0e4a84d2bdcaf213c27218d7804b Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/remote/rpc/ZeroMQServerModule.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/remote/rpc/ZeroMQServerModule.java index f55566acc3..e3ac9bab30 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/remote/rpc/ZeroMQServerModule.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/remote/rpc/ZeroMQServerModule.java @@ -7,7 +7,10 @@ */ package org.opendaylight.controller.config.yang.md.sal.remote.rpc; -import org.opendaylight.controller.sal.connector.remoterpc.*; +import org.opendaylight.controller.sal.connector.remoterpc.ClientImpl; +import org.opendaylight.controller.sal.connector.remoterpc.RemoteRpcProvider; +import org.opendaylight.controller.sal.connector.remoterpc.RoutingTableProvider; +import org.opendaylight.controller.sal.connector.remoterpc.ServerImpl; import org.opendaylight.controller.sal.core.api.Broker; import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry; import org.osgi.framework.BundleContext; @@ -16,51 +19,51 @@ import org.osgi.framework.BundleContext; * */ public final class ZeroMQServerModule - extends org.opendaylight.controller.config.yang.md.sal.remote.rpc.AbstractZeroMQServerModule { +extends org.opendaylight.controller.config.yang.md.sal.remote.rpc.AbstractZeroMQServerModule { - private static final Integer ZEROMQ_ROUTER_PORT = 5554; - private BundleContext bundleContext; + private static final Integer ZEROMQ_ROUTER_PORT = 5554; + private BundleContext bundleContext; - public ZeroMQServerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, - org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } + public ZeroMQServerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, + final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } - public ZeroMQServerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, - org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, - ZeroMQServerModule oldModule, java.lang.AutoCloseable oldInstance) { + public ZeroMQServerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, + final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, + final ZeroMQServerModule oldModule, final java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } + super(identifier, dependencyResolver, oldModule, oldInstance); + } - @Override - protected void customValidation() { - // Add custom validation for module attributes here. - } + @Override + protected void customValidation() { + // Add custom validation for module attributes here. + } - @Override - public java.lang.AutoCloseable createInstance() { + @Override + public java.lang.AutoCloseable createInstance() { - Broker broker = getDomBrokerDependency(); + Broker broker = getDomBrokerDependency(); - final int port = getPort() != null ? getPort() : ZEROMQ_ROUTER_PORT; + final int port = getPort() != null ? getPort() : ZEROMQ_ROUTER_PORT; - ServerImpl serverImpl = new ServerImpl(port); + ServerImpl serverImpl = new ServerImpl(port); - ClientImpl clientImpl = new ClientImpl(); + ClientImpl clientImpl = new ClientImpl(); - RoutingTableProvider provider = new RoutingTableProvider(bundleContext);//,serverImpl); + RoutingTableProvider provider = new RoutingTableProvider(bundleContext);//,serverImpl); - RemoteRpcProvider facade = new RemoteRpcProvider(serverImpl, clientImpl); - facade.setRoutingTableProvider(provider); - facade.setContext(bundleContext); - facade.setRpcProvisionRegistry((RpcProvisionRegistry) broker); + RemoteRpcProvider facade = new RemoteRpcProvider(serverImpl, clientImpl); + facade.setRoutingTableProvider(provider); + facade.setContext(bundleContext); + facade.setRpcProvisionRegistry((RpcProvisionRegistry) broker); - broker.registerProvider(facade, bundleContext); - return facade; - } + broker.registerProvider(facade, bundleContext); + return facade; + } - public void setBundleContext(BundleContext bundleContext) { - this.bundleContext = bundleContext; - } + public void setBundleContext(final BundleContext bundleContext) { + this.bundleContext = bundleContext; + } } diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImpl.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImpl.java index e721084763..200ebaee6a 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImpl.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImpl.java @@ -26,7 +26,6 @@ import org.opendaylight.controller.sal.connector.remoterpc.api.SystemException; import org.opendaylight.controller.sal.connector.remoterpc.dto.Message; import org.opendaylight.controller.sal.connector.remoterpc.dto.RouteIdentifierImpl; import org.opendaylight.controller.sal.connector.remoterpc.util.XmlUtils; -import org.opendaylight.controller.sal.core.api.RpcImplementation; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.RpcError; import org.opendaylight.yangtools.yang.common.RpcResult; @@ -41,7 +40,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; /** - * An implementation of {@link RpcImplementation} that makes + * An implementation of {@link org.opendaylight.controller.sal.core.api.RpcImplementation} that makes * remote RPC calls */ public class ClientImpl implements RemoteRpcClient { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/consumer-service/pom.xml b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/consumer-service/pom.xml index dd216c0881..89695c124a 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/consumer-service/pom.xml +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/consumer-service/pom.xml @@ -1,85 +1,83 @@ - - 4.0.0 - - sal-remoterpc-connector-test-parent - org.opendaylight.controller.tests - 1.0-SNAPSHOT - - sal-remoterpc-connector-test-consumer - bundle - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - + + + 4.0.0 + + org.opendaylight.controller.tests + sal-remoterpc-connector-test-parent + 1.1-SNAPSHOT + + sal-remoterpc-connector-test-consumer + bundle + - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.controller.sample.zeromq.consumer.ExampleConsumer - - - - - + + org.opendaylight.controller + containermanager + 0.5.2-SNAPSHOT + - - - org.opendaylight.controller - sal-binding-api - 1.0-SNAPSHOT - - - org.opendaylight.controller - sal-common-util - 1.0-SNAPSHOT - - - org.opendaylight.controller - sal-core-api - 1.0-SNAPSHOT - + + org.opendaylight.controller + sal + 0.8.1-SNAPSHOT + + + org.opendaylight.controller + sal-binding-api + 1.1-SNAPSHOT + + + org.opendaylight.controller + sal-common-util + 1.1-SNAPSHOT + + + org.opendaylight.controller + sal-common-util + 1.1-SNAPSHOT + + + org.opendaylight.controller + sal-core-api + 1.1-SNAPSHOT + + + org.opendaylight.yangtools + yang-binding + + + org.opendaylight.yangtools + yang-common + + + org.opendaylight.yangtools + yang-data-api + + + org.opendaylight.yangtools + yang-data-impl + ${yangtools.version} + + - - org.opendaylight.controller - containermanager - 0.5.1-SNAPSHOT - - - - org.opendaylight.controller - sal - 0.5.1-SNAPSHOT - - - org.opendaylight.yangtools - yang-binding - - - org.opendaylight.yangtools - yang-common - - - org.opendaylight.yangtools - yang-data-api - - - org.opendaylight.yangtools - yang-data-impl - ${yangtools.version} - - - - org.opendaylight.controller - sal-common-util - 1.0-SNAPSHOT - - + + + + org.apache.felix + maven-bundle-plugin + + + org.opendaylight.controller.sample.zeromq.consumer.ExampleConsumer + + + + + + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/consumer-service/src/main/java/org/opendaylight/controller/sample/zeromq/consumer/ExampleConsumer.java b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/consumer-service/src/main/java/org/opendaylight/controller/sample/zeromq/consumer/ExampleConsumer.java index 7119a66113..aac6da47ba 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/consumer-service/src/main/java/org/opendaylight/controller/sample/zeromq/consumer/ExampleConsumer.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/consumer-service/src/main/java/org/opendaylight/controller/sample/zeromq/consumer/ExampleConsumer.java @@ -11,7 +11,7 @@ import java.io.FileNotFoundException; import java.io.InputStream; import java.net.URI; import java.util.Hashtable; -import java.util.concurrent.*; +import java.util.concurrent.Future; import org.opendaylight.controller.sal.core.api.AbstractConsumer; import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession; @@ -25,7 +25,6 @@ import org.osgi.framework.ServiceRegistration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.opendaylight.yangtools.yang.data.impl.XmlTreeBuilder; -import org.opendaylight.yangtools.yang.data.impl.CompositeNodeTOImpl; import javax.xml.stream.XMLStreamException; diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/pom.xml b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/pom.xml index 5bfbcba5f8..3f47700f8d 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/pom.xml +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/pom.xml @@ -1,20 +1,15 @@ - + + 4.0.0 org.opendaylight.controller sal-parent - 1.0-SNAPSHOT + 1.1-SNAPSHOT ../.. - pom org.opendaylight.controller.tests sal-remoterpc-connector-test-parent - - scm:git:ssh://git.opendaylight.org:29418/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - + pom consumer-service @@ -22,5 +17,10 @@ test-it test-nb + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/provider-service/pom.xml b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/provider-service/pom.xml index a13a5aeba0..bd0e43bada 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/provider-service/pom.xml +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/provider-service/pom.xml @@ -4,7 +4,7 @@ sal-remoterpc-connector-test-parent org.opendaylight.controller.tests - 1.0-SNAPSHOT + 1.1-SNAPSHOT sal-remoterpc-connector-test-provider bundle @@ -33,30 +33,30 @@ org.opendaylight.controller sal-binding-api - 1.0-SNAPSHOT + 1.1-SNAPSHOT org.opendaylight.controller sal-common-util - 1.0-SNAPSHOT + 1.1-SNAPSHOT org.opendaylight.controller sal-core-api - 1.0-SNAPSHOT + 1.1-SNAPSHOT org.opendaylight.controller containermanager - 0.5.1-SNAPSHOT + 0.5.2-SNAPSHOT org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.8.1-SNAPSHOT org.opendaylight.yangtools @@ -77,12 +77,12 @@ org.opendaylight.controller sal-common-util - 1.0-SNAPSHOT + 1.1-SNAPSHOT org.opendaylight.controller sal-remoterpc-connector - 1.0-SNAPSHOT + 1.1-SNAPSHOT diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/provider-service/src/main/java/org/opendaylight/controller/sample/zeromq/provider/ExampleProvider.java b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/provider-service/src/main/java/org/opendaylight/controller/sample/zeromq/provider/ExampleProvider.java index 5703799bb5..ff930db6fd 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/provider-service/src/main/java/org/opendaylight/controller/sample/zeromq/provider/ExampleProvider.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/provider-service/src/main/java/org/opendaylight/controller/sample/zeromq/provider/ExampleProvider.java @@ -26,7 +26,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.URI; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; public class ExampleProvider extends AbstractProvider implements RpcImplementation { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/pom.xml b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/pom.xml index 4c7e15dbb0..84e9d29c72 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/pom.xml +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/pom.xml @@ -4,7 +4,7 @@ sal-remoterpc-connector-test-parent org.opendaylight.controller.tests - 1.0-SNAPSHOT + 1.1-SNAPSHOT sal-remoterpc-connector-test-it @@ -95,17 +95,17 @@ org.opendaylight.controller.tests sal-remoterpc-connector-test-provider - 1.0-SNAPSHOT + 1.1-SNAPSHOT org.opendaylight.controller.tests sal-remoterpc-connector-test-consumer - 1.0-SNAPSHOT + 1.1-SNAPSHOT org.opendaylight.controller sal-broker-impl - 1.0-SNAPSHOT + 1.1-SNAPSHOT org.ops4j.pax.exam @@ -318,6 +318,7 @@ org.opendaylight.controller ietf-netconf-monitoring + 0.2.5-SNAPSHOT org.opendaylight.yangtools diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/src/test/java/org/opendaylight/controller/sample/zeromq/test/it/RouterTest.java b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/src/test/java/org/opendaylight/controller/sample/zeromq/test/it/RouterTest.java index 30f8fd4ed1..e02e290a29 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/src/test/java/org/opendaylight/controller/sample/zeromq/test/it/RouterTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-it/src/test/java/org/opendaylight/controller/sample/zeromq/test/it/RouterTest.java @@ -9,8 +9,6 @@ package org.opendaylight.controller.sample.zeromq.test.it; import junit.framework.Assert; -import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -42,12 +40,11 @@ import javax.inject.Inject; import java.io.IOException; import java.net.URI; -import java.util.Hashtable; import static org.opendaylight.controller.test.sal.binding.it.TestHelper.baseModelBundles; import static org.opendaylight.controller.test.sal.binding.it.TestHelper.bindingAwareSalBundles; -import static org.ops4j.pax.exam.CoreOptions.*; +//import static org.ops4j.pax.exam.CoreOptions.*; @RunWith(PaxExam.class) public class RouterTest { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-nb/pom.xml b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-nb/pom.xml index a6bbe31684..b041cb430a 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-nb/pom.xml +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-nb/pom.xml @@ -5,7 +5,7 @@ sal-remoterpc-connector-test-parent org.opendaylight.controller.tests - 1.0-SNAPSHOT + 1.1-SNAPSHOT sal-remoterpc-connector-test-nb diff --git a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-nb/src/main/java/org/opendaylight/controller/tests/zmqrouter/rest/Router.java b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-nb/src/main/java/org/opendaylight/controller/tests/zmqrouter/rest/Router.java index edd49485af..e97be52f3d 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-nb/src/main/java/org/opendaylight/controller/tests/zmqrouter/rest/Router.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/integrationtest/test-nb/src/main/java/org/opendaylight/controller/tests/zmqrouter/rest/Router.java @@ -19,7 +19,8 @@ import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.osgi.framework.*; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory;