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
8 package org.opendaylight.controller.cluster.raft.behaviors;
10 import akka.actor.ActorRef;
11 import org.opendaylight.controller.cluster.raft.RaftState;
14 * A RaftActorBehavior implementation that delegates to another implementation.
16 * @author Thomas Pantelis
18 public class DelegatingRaftActorBehavior implements RaftActorBehavior {
19 private RaftActorBehavior delegate;
21 public RaftActorBehavior getDelegate() {
25 public void setDelegate(RaftActorBehavior delegate) {
26 this.delegate = delegate;
30 public void close() throws Exception {
35 public RaftActorBehavior handleMessage(ActorRef sender, Object message) {
36 return delegate.handleMessage(sender, message);
40 public RaftState state() {
41 return delegate.state();
45 public String getLeaderId() {
46 return delegate.getLeaderId();
50 public void setReplicatedToAllIndex(long replicatedToAllIndex) {
51 delegate.setReplicatedToAllIndex(replicatedToAllIndex);
55 public long getReplicatedToAllIndex() {
56 return delegate.getReplicatedToAllIndex();
60 public short getLeaderPayloadVersion() {
61 return delegate.getLeaderPayloadVersion();