89603a134cc084c53e81bc938be518c5b221e5ba
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / main / java / org / opendaylight / controller / remote / rpc / registry / ClusterWrapperImpl.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.remote.rpc.registry;
10
11
12 import akka.actor.ActorSystem;
13 import akka.actor.Address;
14 import akka.cluster.Cluster;
15 import akka.cluster.ClusterEvent;
16
17
18 public class ClusterWrapperImpl  implements ClusterWrapper{
19
20   private Cluster cluster;
21
22   public ClusterWrapperImpl(ActorSystem actorSystem) {
23     cluster = Cluster.get(actorSystem);
24   }
25
26   @Override
27   public ClusterEvent.CurrentClusterState getState() {
28     return cluster.state();
29   }
30
31   @Override
32   public Address getAddress() {
33     return cluster.selfAddress();
34   }
35 }