Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / persisted / MigratedSerializable.java
1 /*
2  * Copyright (c) 2016 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 package org.opendaylight.controller.cluster.raft.persisted;
9
10 import java.io.Serializable;
11 import org.eclipse.jdt.annotation.NonNull;
12
13 /**
14  * Transitional marker interface for use with evolution of serializable classes held in persistence. This interface
15  * should be implemented by replacement classes for as long as the old classes are supported.
16  *
17  * @author Robert Varga
18  */
19 public interface MigratedSerializable extends Serializable {
20     /**
21      * Return true if this object was created from a previous serialization format.
22      *
23      * @return true if this object was created from a previous serialization format, false otherwise.
24      */
25     boolean isMigrated();
26
27     /**
28      * Return a serialization proxy. Implementations should not return this object, but rather use Externalizable
29      * proxy pattern so their serialization format is not tied to this interface.
30      *
31      * @return Serialization proxy.
32      */
33     @NonNull Object writeReplace();
34 }