@Beta public enum PayloadVersion extends Enum<PayloadVersion> implements org.opendaylight.yangtools.concepts.WritableObject
This version effectively defines the protocol version between actors participating on a particular shard. A shard participant instance should oppose RAFT candidates which produce persistence of an unsupported version. If a follower encounters an unsupported version it must not become fully-operational, as it does not have an accurate view of shard state.
Enum Constant and Description |
---|
BORON
Initial ABI version, as shipped with Boron Simultaneous release.
|
TEST_FUTURE_VERSION
Version which is newer than any other version.
|
TEST_PAST_VERSION
Version which is older than any other version.
|
Modifier and Type | Method and Description |
---|---|
static PayloadVersion |
current()
Return the codebase-native persistence version.
|
static PayloadVersion |
readFrom(DataInput in)
Read an
PayloadVersion from a DataInput . |
short |
shortValue()
Return the unsigned short integer identifying this version.
|
static PayloadVersion |
valueOf(short version)
Return the
PayloadVersion corresponding to an unsigned short integer. |
static PayloadVersion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PayloadVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
writeTo(DataOutput out) |
public static final PayloadVersion TEST_PAST_VERSION
public static final PayloadVersion BORON
public static final PayloadVersion TEST_FUTURE_VERSION
public static PayloadVersion[] values()
for (PayloadVersion c : PayloadVersion.values()) System.out.println(c);
public static PayloadVersion valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic short shortValue()
@Nonnull public static PayloadVersion current()
PayloadVersion
@Nonnull public static PayloadVersion valueOf(short version) throws FutureVersionException, PastVersionException
PayloadVersion
corresponding to an unsigned short integer. This method is provided for callers
which provide their own recovery strategy in case of version incompatibility.version
- Short integer as returned from shortValue()
PayloadVersion
FutureVersionException
- if the specified integer identifies a future versionPastVersionException
- if the specified integer identifies a past version which is no longer supportedpublic void writeTo(DataOutput out) throws IOException
writeTo
in interface org.opendaylight.yangtools.concepts.WritableObject
IOException
@Nonnull public static PayloadVersion readFrom(@Nonnull DataInput in) throws IOException
PayloadVersion
from a DataInput
. This method is provided for callers which do not have
a recovery strategy for dealing with unsupported versions.in
- Input from which to readPayloadVersion
IOException
- If read fails or an unsupported version is encounteredCopyright © 2019 OpenDaylight. All rights reserved.