2 * Copyright (c) 2016 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.persisted;
10 import java.io.Externalizable;
11 import java.io.IOException;
12 import java.io.ObjectInput;
13 import java.io.ObjectOutput;
14 import java.io.Serializable;
17 * Internal message that is stored in the akka's persistent journal to delete journal entries.
19 * @author Thomas Pantelis
21 public sealed class DeleteEntries implements Serializable {
22 @Deprecated(since = "7.0.0", forRemoval = true)
23 private static final class Legacy extends DeleteEntries implements LegacySerializable {
25 private static final long serialVersionUID = 1L;
27 Legacy(final long fromIndex) {
32 @Deprecated(since = "7.0.0", forRemoval = true)
33 private static final class Proxy implements Externalizable {
35 private static final long serialVersionUID = 1L;
37 private DeleteEntries deleteEntries = null;
39 // checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
40 // redundant. It is explicitly needed for Java serialization to be able to create instances via reflection.
41 @SuppressWarnings("checkstyle:RedundantModifier")
47 public void writeExternal(final ObjectOutput out) throws IOException {
48 out.writeLong(deleteEntries.fromIndex);
52 public void readExternal(final ObjectInput in) throws IOException {
53 deleteEntries = new Legacy(in.readLong());
57 private Object readResolve() {
63 private static final long serialVersionUID = 1L;
65 private final long fromIndex;
67 public DeleteEntries(final long fromIndex) {
68 this.fromIndex = fromIndex;
71 public final long getFromIndex() {
76 public final Object writeReplace() {
81 public final String toString() {
82 return "DeleteEntries [fromIndex=" + fromIndex + "]";