1 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210;
3 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
4 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
5 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
6 import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
7 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
8 import org.opendaylight.controller.sal.binding.api.BindingAwareService;
9 import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
10 import org.opendaylight.yangtools.concepts.ListenerRegistration;
11 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
12 import org.opendaylight.yangtools.yang.binding.RpcService;
13 import org.osgi.framework.BundleContext;
15 public class NetconfBindingBrokerModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractNetconfBindingBrokerModule {
16 public NetconfBindingBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
17 super(identifier, dependencyResolver);
20 public NetconfBindingBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.NetconfBindingBrokerModule oldModule, java.lang.AutoCloseable oldInstance) {
21 super(identifier, dependencyResolver, oldModule, oldInstance);
25 public void customValidation() {
26 // add custom validation form module attributes here.
30 public java.lang.AutoCloseable createInstance() {
31 return new FakeBindingAwareBroker(getNetconfBindingBrokerDependency());
34 private static class FakeBindingAwareBroker implements BindingAwareBroker, AutoCloseable {
36 private DataBroker netconfBindingBrokerDependency;
38 public FakeBindingAwareBroker(final DataBroker netconfBindingBrokerDependency) {
40 this.netconfBindingBrokerDependency = netconfBindingBrokerDependency;
45 public ConsumerContext registerConsumer(final BindingAwareConsumer bindingAwareConsumer,
46 final BundleContext bundleContext) {
47 throw new UnsupportedOperationException("Unsupported");
51 public ConsumerContext registerConsumer(final BindingAwareConsumer bindingAwareConsumer) {
52 final ConsumerContext consumerContext = new ConsumerContext() {
54 public <T extends BindingAwareService> T getSALService(final Class<T> aClass) {
55 return aClass.equals(DataBroker.class)
56 ? (T) netconfBindingBrokerDependency
61 public <T extends RpcService> T getRpcService(final Class<T> aClass) {
65 bindingAwareConsumer.onSessionInitialized(consumerContext);
66 return consumerContext;
70 public ProviderContext registerProvider(final BindingAwareProvider bindingAwareProvider,
71 final BundleContext bundleContext) {
72 throw new UnsupportedOperationException("Unsupported");
76 public ProviderContext registerProvider(final BindingAwareProvider bindingAwareProvider) {
77 final ProviderContext context = new ProviderContext() {
79 public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(
81 throw new UnsupportedOperationException("Unsupported");
85 public <T extends RpcService> T getRpcService(final Class<T> aClass) {
86 throw new UnsupportedOperationException("Unsupported");
90 public <T extends RpcService> RpcRegistration<T> addRpcImplementation(final Class<T> aClass, final T t)
91 throws IllegalStateException {
92 throw new UnsupportedOperationException("Unsupported");
96 public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(
97 final Class<T> aClass, final T t) throws IllegalStateException {
98 throw new UnsupportedOperationException("Unsupported");
102 public <T extends BindingAwareService> T getSALService(final Class<T> aClass) {
103 return aClass.equals(DataBroker.class)
104 ? (T) netconfBindingBrokerDependency
107 bindingAwareProvider.onSessionInitiated(context);
112 public void close() throws Exception {
113 netconfBindingBrokerDependency = null;