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.controller.eos.akka.DataCenterControl;
13 import org.opendaylight.mdsal.binding.api.RpcProviderService;
14 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.ClusterAdminService;
16 import org.opendaylight.yangtools.concepts.ObjectRegistration;
17 import org.osgi.service.component.annotations.Activate;
18 import org.osgi.service.component.annotations.Component;
19 import org.osgi.service.component.annotations.Deactivate;
20 import org.osgi.service.component.annotations.Reference;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
25 @Component(immediate = true)
26 public final class OSGiClusterAdmin {
27 private static final Logger LOG = LoggerFactory.getLogger(OSGiClusterAdmin.class);
29 @Reference(target = "(type=distributed-config)")
30 DistributedDataStoreInterface configDatastore = null;
31 @Reference(target = "(type=distributed-operational)")
32 DistributedDataStoreInterface operDatastore = null;
34 BindingNormalizedNodeSerializer serializer = null;
36 RpcProviderService rpcProviderService = null;
38 DataCenterControl dataCenterControl = null;
40 private ObjectRegistration<?> reg;
44 reg = rpcProviderService.registerRpcImplementation(ClusterAdminService.class,
45 new ClusterAdminRpcService(configDatastore, operDatastore, serializer, dataCenterControl));
46 LOG.info("Cluster Admin services started");
52 LOG.info("Cluster Admin services stopped");