2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. 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
8 package org.opendaylight.controller.cluster.datastore.admin;
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface;
12 import org.opendaylight.mdsal.binding.api.RpcProviderService;
13 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.ClusterAdminService;
15 import org.opendaylight.yangtools.concepts.ObjectRegistration;
16 import org.osgi.service.component.annotations.Activate;
17 import org.osgi.service.component.annotations.Component;
18 import org.osgi.service.component.annotations.Deactivate;
19 import org.osgi.service.component.annotations.Reference;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
24 @Component(immediate = true)
25 public final class OSGiClusterAdmin {
26 private static final Logger LOG = LoggerFactory.getLogger(OSGiClusterAdmin.class);
28 @Reference(target = "(type=distributed-config)")
29 DistributedDataStoreInterface configDatastore = null;
30 @Reference(target = "(type=distributed-operational)")
31 DistributedDataStoreInterface operDatastore = null;
33 BindingNormalizedNodeSerializer serializer = null;
35 RpcProviderService rpcProviderService = null;
37 private ObjectRegistration<?> reg;
41 reg = rpcProviderService.registerRpcImplementation(ClusterAdminService.class,
42 new ClusterAdminRpcService(configDatastore, operDatastore, serializer));
43 LOG.info("Cluster Admin services started");
49 LOG.info("Cluster Admin services stopped");