2393a30610be51f7bd860edc45e20fcbbd66fa31
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / persisted / NoopPayload.java
1 /*
2  * Copyright (c) 2016 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.persisted;
9
10 import java.io.Serializable;
11 import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload;
12
13 /**
14  * Payload used for no-op log entries that are put into the journal by the PreLeader in order to commit
15  * entries from the prior term.
16  *
17  * @author Thomas Pantelis
18  */
19 public final class NoopPayload extends Payload implements Serializable {
20     private static final long serialVersionUID = 1L;
21     public static final NoopPayload INSTANCE = new NoopPayload();
22
23     private NoopPayload() {
24     }
25
26     @Override
27     public int size() {
28         return 0;
29     }
30
31     private Object readResolve() {
32         return INSTANCE;
33     }
34 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.