BUG-8618: refactor SyncStatusTracker state
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / NoopRaftActorSnapshotCohort.java
1 /*
2  * Copyright (c) 2017 Brocade Communications 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 package org.opendaylight.controller.cluster.raft;
9
10 import akka.actor.ActorRef;
11 import com.google.common.io.ByteSource;
12 import java.io.IOException;
13 import java.io.OutputStream;
14 import java.util.Optional;
15 import org.opendaylight.controller.cluster.raft.persisted.EmptyState;
16 import org.opendaylight.controller.cluster.raft.persisted.Snapshot.State;
17
18 /**
19  * RaftActorSnapshotCohort implementation that does nothing.
20  *
21  * @author Thomas Pantelis
22  */
23 public final class NoopRaftActorSnapshotCohort implements RaftActorSnapshotCohort {
24     public static final NoopRaftActorSnapshotCohort INSTANCE = new NoopRaftActorSnapshotCohort();
25
26     private NoopRaftActorSnapshotCohort() {
27     }
28
29     @Override
30     public void createSnapshot(ActorRef actorRef, Optional<OutputStream> installSnapshotStream) {
31     }
32
33     @Override
34     public void applySnapshot(State snapshotState) {
35     }
36
37     @Override
38     public State deserializeSnapshot(ByteSource snapshotBytes) throws IOException {
39         return EmptyState.INSTANCE;
40     }
41 }