2 * Copyright (c) 2015 Brocade Communications 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.config.cluster_admin_provider;
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface;
13 import org.opendaylight.controller.cluster.datastore.admin.ClusterAdminRpcService;
14 import org.opendaylight.controller.config.api.DependencyResolver;
15 import org.opendaylight.controller.config.api.ModuleIdentifier;
17 public class ClusterAdminProviderModule extends AbstractClusterAdminProviderModule {
18 public ClusterAdminProviderModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
19 super(identifier, dependencyResolver);
22 public ClusterAdminProviderModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver,
23 ClusterAdminProviderModule oldModule, java.lang.AutoCloseable oldInstance) {
24 super(identifier, dependencyResolver, oldModule, oldInstance);
28 public void customValidation() {
29 // add custom validation form module attributes here.
33 public AutoCloseable createInstance() {
34 Preconditions.checkArgument(getConfigDataStoreDependency() instanceof DistributedDataStoreInterface,
35 "Injected config DOMStore must be an instance of DistributedDataStoreInterface");
36 Preconditions.checkArgument(getOperDataStoreDependency() instanceof DistributedDataStoreInterface,
37 "Injected operational DOMStore must be an instance of DistributedDataStoreInterface");
38 ClusterAdminRpcService service = new ClusterAdminRpcService(
39 (DistributedDataStoreInterface)getConfigDataStoreDependency(),
40 (DistributedDataStoreInterface)getOperDataStoreDependency());
41 service.start(getRpcRegistryDependency());