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
18 extends org.opendaylight.controller.config.yang.md.sal.rest.connector.AbstractRestConnectorModule {
20 private static RestConnectorRuntimeRegistration runtimeRegistration;
22 private BundleContext bundleContext;
24 public RestConnectorModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
25 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
26 super(identifier, dependencyResolver);
29 public RestConnectorModule(
30 final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
31 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
32 final org.opendaylight.controller.config.yang.md.sal.rest.connector.RestConnectorModule oldModule,
33 final java.lang.AutoCloseable oldInstance) {
34 super(identifier, dependencyResolver, oldModule, oldInstance);
38 public void customValidation() {
39 // add custom validation form module attributes here.
43 public java.lang.AutoCloseable createInstance() {
45 final WaitingServiceTracker<AAAService> aaaServiceWaitingServiceTracker =
46 WaitingServiceTracker.create(AAAService.class, bundleContext);
47 aaaServiceWaitingServiceTracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
49 final RestconfWrapperProviders wrapperProviders = new RestconfWrapperProviders(getWebsocketPort());
50 wrapperProviders.registerProviders(getDomBrokerDependency());
52 if (runtimeRegistration != null) {
53 runtimeRegistration.close();
56 runtimeRegistration = wrapperProviders.runtimeRegistration(getRootRuntimeBeanRegistratorWrapper());
58 return wrapperProviders;
61 public void setBundleContext(final BundleContext bundleContext) {
62 this.bundleContext = bundleContext;