Merge "Refactor LeaderElectionScenarioTests"
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / config / yang / md / sal / binding / impl / BindingNotificationPublishAdapterModule.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
9
10 import org.opendaylight.controller.config.api.DependencyResolver;
11 import org.opendaylight.controller.config.api.ModuleIdentifier;
12 import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
13 import org.opendaylight.controller.md.sal.binding.impl.BindingDOMNotificationPublishServiceAdapter;
14 import org.opendaylight.controller.md.sal.dom.api.DOMNotificationPublishService;
15 import org.opendaylight.controller.sal.core.api.Broker;
16
17 public class BindingNotificationPublishAdapterModule extends AbstractBindingNotificationPublishAdapterModule {
18     public BindingNotificationPublishAdapterModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
19         super(identifier, dependencyResolver);
20     }
21
22     public BindingNotificationPublishAdapterModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver, BindingNotificationPublishAdapterModule oldModule, java.lang.AutoCloseable oldInstance) {
23         super(identifier, dependencyResolver, oldModule, oldInstance);
24     }
25
26     @Override
27     public void customValidation() {
28         // add custom validation form module attributes here.
29     }
30
31     @Override
32     public java.lang.AutoCloseable createInstance() {
33         final BindingToNormalizedNodeCodec codec = getBindingMappingServiceDependency();
34         final Broker.ProviderSession session = getDomAsyncBrokerDependency().registerProvider(new DummyDOMProvider());
35         final DOMNotificationPublishService publishService = session.getService(DOMNotificationPublishService.class);
36         return new BindingDOMNotificationPublishServiceAdapter(codec.getCodecRegistry(), publishService);
37     }
38
39 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.