Enum PersistenceProtocol
- java.lang.Object
-
- java.lang.Enum<PersistenceProtocol>
-
- org.opendaylight.controller.cluster.access.commands.PersistenceProtocol
-
- All Implemented Interfaces:
Serializable
,Comparable<PersistenceProtocol>
,WritableObject
@Beta public enum PersistenceProtocol extends Enum<PersistenceProtocol> implements WritableObject
Enumeration of transaction persistence protocols. These govern which protocol is executed between the frontend and backend to drive persistence of a particular transaction.- Author:
- Robert Varga
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ABORT
Abort protocol.READY
Transaction is ready.SIMPLE
Simple commit protocol.THREE_PHASE
Three-phase commit protocol (3PC).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PersistenceProtocol
readFrom(DataInput in)
static PersistenceProtocol
valueOf(String name)
Returns the enum constant of this type with the specified name.static PersistenceProtocol[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.void
writeTo(DataOutput out)
-
-
-
Enum Constant Detail
-
ABORT
public static final PersistenceProtocol ABORT
Abort protocol. The transaction has been aborted on the frontend and its effects should not be visible in the global history. This is a simple request/reply protocol.
-
SIMPLE
public static final PersistenceProtocol SIMPLE
Simple commit protocol. The transaction should be committed to the global history. The receiving backend is the only entity which needs to persist its effects, hence a simple request/reply protocol is sufficient.
-
THREE_PHASE
public static final PersistenceProtocol THREE_PHASE
Three-phase commit protocol (3PC). The transaction should be committed to the global history, but it is a part of a transaction spanning multiple entities and coordination is needed to drive persistence.
-
READY
public static final PersistenceProtocol READY
Transaction is ready. This is not a really a persistence protocol, but an indication that frontend has completed modifications on the transaction and considers it ready, without deciding the actual commit protocol.
-
-
Method Detail
-
values
public static PersistenceProtocol[] 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 (PersistenceProtocol c : PersistenceProtocol.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PersistenceProtocol 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
-
writeTo
public final void writeTo(DataOutput out) throws IOException
- Specified by:
writeTo
in interfaceWritableObject
- Throws:
IOException
-
readFrom
public static PersistenceProtocol readFrom(DataInput in) throws IOException
- Throws:
IOException
-
-