Enum ABIVersion
- java.lang.Object
-
- java.lang.Enum<ABIVersion>
-
- org.opendaylight.controller.cluster.access.ABIVersion
-
- All Implemented Interfaces:
Serializable
,Comparable<ABIVersion>
,WritableObject
@Beta public enum ABIVersion extends Enum<ABIVersion> implements WritableObject
Enumeration of all ABI versions supported by this implementation of the client access API.- Author:
- Robert Varga
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BORON
Initial ABI version, as shipped with Boron Simultaneous release.CHLORINE_SR2
Revised ABI version.MAGNESIUM
Revised ABI version.NEON_SR2
Revised ABI version.SODIUM_SR1
Revised ABI version.TEST_FUTURE_VERSION
Version which is newer than any other version.TEST_PAST_VERSION
Version which is older than any other version.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static @NonNull ABIVersion
current()
Return the codebase-native ABI version.abstract @NonNull NormalizedNodeStreamVersion
getStreamVersion()
Return the NormalizedNode stream version corresponding to this particular ABI.static @NonNull ABIVersion
inexactReadFrom(@NonNull DataInput in)
boolean
lt(@NonNull ABIVersion other)
Returntrue
if this version is earier than someother
version.static @NonNull ABIVersion
readFrom(@NonNull DataInput in)
Read anABIVersion
from aDataInput
.short
shortValue()
Return the unsigned short integer identifying this version.static @NonNull ABIVersion
valueOf(short value)
Return theABIVersion
corresponding to an unsigned short integer.static ABIVersion
valueOf(String name)
Returns the enum constant of this type with the specified name.static ABIVersion[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.void
writeTo(DataOutput out)
-
-
-
Enum Constant Detail
-
TEST_PAST_VERSION
public static final ABIVersion TEST_PAST_VERSION
Version which is older than any other version. This version exists purely for testing purposes.
-
BORON
public static final ABIVersion BORON
Initial ABI version, as shipped with Boron Simultaneous release.
-
NEON_SR2
public static final ABIVersion NEON_SR2
Revised ABI version. The messages remain the same asBORON
, but messages bearing QNames in any shape are usingNormalizedNodeStreamVersion.NEON_SR2
, which improves encoding.
-
SODIUM_SR1
public static final ABIVersion SODIUM_SR1
Revised ABI version. The messages remain the same asBORON
, but messages bearing QNames in any shape are usingNormalizedNodeStreamVersion.SODIUM_SR1
, which improves encoding.
-
MAGNESIUM
public static final ABIVersion MAGNESIUM
Revised ABI version. The messages remain the same asBORON
, but messages bearing QNames in any shape are usingNormalizedNodeStreamVersion.MAGNESIUM
, which improves encoding.
-
CHLORINE_SR2
public static final ABIVersion CHLORINE_SR2
Revised ABI version. The messages remain the same asMAGNESIUM
, the serialization proxies in use are flat objects without any superclasses.
-
TEST_FUTURE_VERSION
public static final ABIVersion TEST_FUTURE_VERSION
Version which is newer than any other version. This version exists purely for testing purposes.
-
-
Method Detail
-
values
public static ABIVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ABIVersion c : ABIVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ABIVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
shortValue
public short shortValue()
Return the unsigned short integer identifying this version.- Returns:
- Unsigned short integer identifying this version
-
current
public static @NonNull ABIVersion current()
Return the codebase-native ABI version. This version is the default version allocated to messages at runtime. Conversion to previous versions may incur additional overhead (such as object allocation).- Returns:
- Current
ABIVersion
-
valueOf
public static @NonNull ABIVersion valueOf(short value) throws FutureVersionException, PastVersionException
Return theABIVersion
corresponding to an unsigned short integer. This method is provided for callers which provide their own recovery strategy in case of version incompatibility.- Parameters:
value
- Short integer as returned fromshortValue()
- Returns:
ABIVersion
- Throws:
FutureVersionException
- if the specified integer identifies a future versionPastVersionException
- if the specified integer identifies a past version which is no longer supported
-
lt
public boolean lt(@NonNull ABIVersion other)
Returntrue
if this version is earier than someother
version.- Parameters:
other
- OtherABIVersion
- Returns:
true
ifother is later
- Throws:
NullPointerException
- ifother
is null
-
writeTo
public void writeTo(DataOutput out) throws IOException
- Specified by:
writeTo
in interfaceWritableObject
- Throws:
IOException
-
getStreamVersion
public abstract @NonNull NormalizedNodeStreamVersion getStreamVersion()
Return the NormalizedNode stream version corresponding to this particular ABI.- Returns:
- Stream Version to use for this ABI version
-
readFrom
public static @NonNull ABIVersion readFrom(@NonNull DataInput in) throws IOException
Read anABIVersion
from aDataInput
. This method is provided for callers which do not have a recovery strategy for dealing with unsupported versions.- Parameters:
in
- Input from which to read- Returns:
- An
ABIVersion
- Throws:
IOException
- If read fails or an unsupported version is encountered
-
inexactReadFrom
public static @NonNull ABIVersion inexactReadFrom(@NonNull DataInput in) throws IOException
- Throws:
IOException
-
-