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 org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface;
11 import org.opendaylight.controller.eos.akka.DataCenterControl;
12 import org.opendaylight.mdsal.binding.api.RpcProviderService;
13 import org.opendaylight.yangtools.concepts.Registration;
14 import org.osgi.service.component.annotations.Activate;
15 import org.osgi.service.component.annotations.Component;
16 import org.osgi.service.component.annotations.Deactivate;
17 import org.osgi.service.component.annotations.Reference;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
21 @Component(service = { })
22 public final class OSGiClusterAdmin {
23 private static final Logger LOG = LoggerFactory.getLogger(OSGiClusterAdmin.class);
25 private final Registration reg;
28 public OSGiClusterAdmin(
29 @Reference(target = "(type=distributed-config)") final DistributedDataStoreInterface configDatastore,
30 @Reference(target = "(type=distributed-operational)") final DistributedDataStoreInterface operDatastore,
31 @Reference final RpcProviderService rpcProviderService,
32 @Reference final DataCenterControl dataCenterControls,
33 @Reference final DataCenterControl dataCenterControl) {
34 reg = new ClusterAdminRpcService(configDatastore, operDatastore, dataCenterControl)
35 .registerWith(rpcProviderService);
36 LOG.info("Cluster Admin services started");
42 LOG.info("Cluster Admin services stopped");