diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-08-31 15:16:38 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-08-31 15:39:43 +0200 |
commit | d41b116f0a177683a326a9d18c4f6aa1ece651de (patch) | |
tree | e41057bb035c7ea6762e27f48224ac4822bcd00b /infra/impl/src/main/java | |
parent | 7567ab4670f6cdf44e227ab8d547414a755401df (diff) |
Fixing sonar issues #1
Change-Id: I4c27d0ad2fd1655db2237ae914361f029093084c
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'infra/impl/src/main/java')
-rw-r--r-- | infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java | 84 | ||||
-rw-r--r-- | infra/impl/src/main/java/io/fd/honeycomb/impl/NorthboundFacadeHoneycombDOMBroker.java | 11 |
2 files changed, 52 insertions, 43 deletions
diff --git a/infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java b/infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java index f11848ac7..c978135cb 100644 --- a/infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java +++ b/infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package io.fd.honeycomb.impl; import org.opendaylight.controller.md.sal.binding.api.DataBroker; @@ -28,7 +29,7 @@ import org.opendaylight.yangtools.yang.binding.RpcService; import org.osgi.framework.BundleContext; /** - * Binding aware broker wrapping just a DataBroker + * Binding aware broker wrapping just a DataBroker. */ public final class FakeBindingAwareBroker implements BindingAwareBroker, AutoCloseable { @@ -39,7 +40,6 @@ public final class FakeBindingAwareBroker implements BindingAwareBroker, AutoClo this.netconfBindingBrokerDependency = netconfBindingBrokerDependency; } - @Deprecated @Override public ConsumerContext registerConsumer(final BindingAwareConsumer bindingAwareConsumer, final BundleContext bundleContext) { @@ -50,14 +50,14 @@ public final class FakeBindingAwareBroker implements BindingAwareBroker, AutoClo public ConsumerContext registerConsumer(final BindingAwareConsumer bindingAwareConsumer) { final ConsumerContext consumerContext = new ConsumerContext() { @Override - public <T extends BindingAwareService> T getSALService(final Class<T> aClass) { - return aClass.equals(DataBroker.class) - ? (T) netconfBindingBrokerDependency - : null; + public <T extends BindingAwareService> T getSALService(final Class<T> serviceClass) { + return serviceClass.equals(DataBroker.class) + ? (T) netconfBindingBrokerDependency + : null; } @Override - public <T extends RpcService> T getRpcService(final Class<T> aClass) { + public <T extends RpcService> T getRpcService(final Class<T> serviceClass) { return null; } }; @@ -73,36 +73,7 @@ public final class FakeBindingAwareBroker implements BindingAwareBroker, AutoClo @Override public ProviderContext registerProvider(final BindingAwareProvider bindingAwareProvider) { - final ProviderContext context = new ProviderContext() { - @Override - public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener( - final L l) { - throw new UnsupportedOperationException("Unsupported"); - } - - @Override - public <T extends RpcService> T getRpcService(final Class<T> aClass) { - throw new UnsupportedOperationException("Unsupported"); - } - - @Override - public <T extends RpcService> RpcRegistration<T> addRpcImplementation(final Class<T> aClass, final T t) - throws IllegalStateException { - throw new UnsupportedOperationException("Unsupported"); - } - - @Override - public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation( - final Class<T> aClass, final T t) throws IllegalStateException { - throw new UnsupportedOperationException("Unsupported"); - } - - @Override - public <T extends BindingAwareService> T getSALService(final Class<T> aClass) { - return aClass.equals(DataBroker.class) - ? (T) netconfBindingBrokerDependency - : null; } - }; + final ProviderContext context = new FakeProviderContext(netconfBindingBrokerDependency); bindingAwareProvider.onSessionInitiated(context); return context; } @@ -111,4 +82,43 @@ public final class FakeBindingAwareBroker implements BindingAwareBroker, AutoClo public void close() throws Exception { netconfBindingBrokerDependency = null; } + + private static final class FakeProviderContext implements ProviderContext { + + private Object netconfBindingBrokerDependency; + + FakeProviderContext(final DataBroker netconfBindingBrokerDependency) { + this.netconfBindingBrokerDependency = netconfBindingBrokerDependency; + } + + @Override + public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener( + final L listener) { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public <T extends RpcService> T getRpcService(final Class<T> serviceClass) { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public <T extends RpcService> RpcRegistration<T> addRpcImplementation(final Class<T> rpcClass, final T t) + throws IllegalStateException { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation( + final Class<T> rpcClass, final T type) throws IllegalStateException { + throw new UnsupportedOperationException("Unsupported"); + } + + @Override + public <T extends BindingAwareService> T getSALService(final Class<T> serviceClass) { + return serviceClass.equals(DataBroker.class) + ? (T) netconfBindingBrokerDependency + : null; + } + } } diff --git a/infra/impl/src/main/java/io/fd/honeycomb/impl/NorthboundFacadeHoneycombDOMBroker.java b/infra/impl/src/main/java/io/fd/honeycomb/impl/NorthboundFacadeHoneycombDOMBroker.java index 7e5dfd873..4af0a9d4a 100644 --- a/infra/impl/src/main/java/io/fd/honeycomb/impl/NorthboundFacadeHoneycombDOMBroker.java +++ b/infra/impl/src/main/java/io/fd/honeycomb/impl/NorthboundFacadeHoneycombDOMBroker.java @@ -47,7 +47,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath; import org.osgi.framework.BundleContext; /** - * Implementation of dom broker to facade VPP pipeline for northbound APIs + * Implementation of dom broker to facade VPP pipeline for northbound APIs. */ public class NorthboundFacadeHoneycombDOMBroker implements AutoCloseable, Broker { @@ -82,7 +82,6 @@ public class NorthboundFacadeHoneycombDOMBroker implements AutoCloseable, Broker return session; } - @Deprecated @Override public ConsumerSession registerConsumer(final Consumer consumer, final BundleContext bundleContext) { throw new UnsupportedOperationException(); @@ -115,8 +114,8 @@ public class NorthboundFacadeHoneycombDOMBroker implements AutoCloseable, Broker } @Override - public <T extends BrokerService> T getService(final Class<T> aClass) { - return (T)services.get(aClass); + public <T extends BrokerService> T getService(final Class<T> serviceClass) { + return (T)services.get(serviceClass); } @Override @@ -140,8 +139,8 @@ public class NorthboundFacadeHoneycombDOMBroker implements AutoCloseable, Broker } @Override - public <T extends BrokerService> T getService(final Class<T> aClass) { - return (T)services.get(aClass); + public <T extends BrokerService> T getService(final Class<T> serviceClass) { + return (T)services.get(serviceClass); } @Override |