2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.config.yang.md.sal.rest.connector;
11 import org.opendaylight.RestconfWrapperProviders;
12 import org.opendaylight.aaa.api.AAAService;
13 import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
14 import org.osgi.framework.BundleContext;
17 public class RestConnectorModule extends org.opendaylight.controller.config.yang.md.sal.rest.connector.AbstractRestConnectorModule {
19 private static RestConnectorRuntimeRegistration runtimeRegistration;
21 private BundleContext bundleContext;
23 public RestConnectorModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
24 super(identifier, dependencyResolver);
27 public RestConnectorModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final org.opendaylight.controller.config.yang.md.sal.rest.connector.RestConnectorModule oldModule, final java.lang.AutoCloseable oldInstance) {
28 super(identifier, dependencyResolver, oldModule, oldInstance);
32 public void customValidation() {
33 // add custom validation form module attributes here.
37 public java.lang.AutoCloseable createInstance() {
39 final WaitingServiceTracker<AAAService> aaaServiceWaitingServiceTracker =
40 WaitingServiceTracker.create(AAAService.class, bundleContext);
41 aaaServiceWaitingServiceTracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
43 final RestconfWrapperProviders wrapperProviders = new RestconfWrapperProviders(getWebsocketPort());
44 wrapperProviders.registerProviders(getDomBrokerDependency());
46 if(runtimeRegistration != null){
47 runtimeRegistration.close();
50 runtimeRegistration = wrapperProviders.runtimeRegistration(getRootRuntimeBeanRegistratorWrapper());
52 return wrapperProviders;
55 public void setBundleContext(final BundleContext bundleContext) {
56 this.bundleContext = bundleContext;