public static enum Protos.TwoWayChannelMessage.MessageType extends java.lang.Enum<Protos.TwoWayChannelMessage.MessageType> implements com.google.protobuf.ProtocolMessageEnum
paymentchannels.TwoWayChannelMessage.MessageType
Enum Constant and Description |
---|
CHANNEL_OPEN
Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
secondary to the primary to indicate that the provided contract was received,
verified, and broadcast successfully and the primary can now provide UPDATE messages
at will to begin paying secondary.
|
CLIENT_VERSION
CLIENT_VERSION = 1; |
CLOSE
Either side can send this message.
|
ERROR
Used to indicate an error condition.
|
INITIATE
INITIATE = 3; |
PAYMENT_ACK
Sent by the server to the client after an UPDATE_PAYMENT message is successfully processed.
|
PROVIDE_CONTRACT
PROVIDE_CONTRACT = 6; |
PROVIDE_REFUND
PROVIDE_REFUND = 4; |
RETURN_REFUND
RETURN_REFUND = 5; |
SERVER_VERSION
SERVER_VERSION = 2; |
UPDATE_PAYMENT
UPDATE_PAYMENT = 8; |
Modifier and Type | Field and Description |
---|---|
static int |
CHANNEL_OPEN_VALUE
Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
secondary to the primary to indicate that the provided contract was received,
verified, and broadcast successfully and the primary can now provide UPDATE messages
at will to begin paying secondary.
|
static int |
CLIENT_VERSION_VALUE
CLIENT_VERSION = 1; |
static int |
CLOSE_VALUE
Either side can send this message.
|
static int |
ERROR_VALUE
Used to indicate an error condition.
|
static int |
INITIATE_VALUE
INITIATE = 3; |
static int |
PAYMENT_ACK_VALUE
Sent by the server to the client after an UPDATE_PAYMENT message is successfully processed.
|
static int |
PROVIDE_CONTRACT_VALUE
PROVIDE_CONTRACT = 6; |
static int |
PROVIDE_REFUND_VALUE
PROVIDE_REFUND = 4; |
static int |
RETURN_REFUND_VALUE
RETURN_REFUND = 5; |
static int |
SERVER_VERSION_VALUE
SERVER_VERSION = 2; |
static int |
UPDATE_PAYMENT_VALUE
UPDATE_PAYMENT = 8; |
Modifier and Type | Method and Description |
---|---|
static Protos.TwoWayChannelMessage.MessageType |
forNumber(int value) |
static com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptor() |
com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptorForType() |
int |
getNumber() |
com.google.protobuf.Descriptors.EnumValueDescriptor |
getValueDescriptor() |
static com.google.protobuf.Internal.EnumLiteMap<Protos.TwoWayChannelMessage.MessageType> |
internalGetValueMap() |
static Protos.TwoWayChannelMessage.MessageType |
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) |
static Protos.TwoWayChannelMessage.MessageType |
valueOf(int value)
Deprecated.
Use
forNumber(int) instead. |
static Protos.TwoWayChannelMessage.MessageType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Protos.TwoWayChannelMessage.MessageType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Protos.TwoWayChannelMessage.MessageType CLIENT_VERSION
CLIENT_VERSION = 1;
public static final Protos.TwoWayChannelMessage.MessageType SERVER_VERSION
SERVER_VERSION = 2;
public static final Protos.TwoWayChannelMessage.MessageType INITIATE
INITIATE = 3;
public static final Protos.TwoWayChannelMessage.MessageType PROVIDE_REFUND
PROVIDE_REFUND = 4;
public static final Protos.TwoWayChannelMessage.MessageType RETURN_REFUND
RETURN_REFUND = 5;
public static final Protos.TwoWayChannelMessage.MessageType PROVIDE_CONTRACT
PROVIDE_CONTRACT = 6;
public static final Protos.TwoWayChannelMessage.MessageType CHANNEL_OPEN
Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the secondary to the primary to indicate that the provided contract was received, verified, and broadcast successfully and the primary can now provide UPDATE messages at will to begin paying secondary. If the channel is interrupted after the CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may reopen the channel by setting the contract transaction hash in its CLIENT_VERSION message.
CHANNEL_OPEN = 7;
public static final Protos.TwoWayChannelMessage.MessageType UPDATE_PAYMENT
UPDATE_PAYMENT = 8;
public static final Protos.TwoWayChannelMessage.MessageType PAYMENT_ACK
Sent by the server to the client after an UPDATE_PAYMENT message is successfully processed.
PAYMENT_ACK = 11;
public static final Protos.TwoWayChannelMessage.MessageType CLOSE
Either side can send this message. If the client sends it to the server, then the server takes the most recent signature it received in an UPDATE_PAYMENT and uses it to create a valid transaction, which it then broadcasts on the network. Once broadcast is complete, it sends back another CLOSE message with the settlement field set, containing the final state of the contract. The server is allowed to initiate settlement whenever it wants, in which case the client will asynchronously receive a CLOSE message with the settlement field set. The server is also allowed to send a CLOSE to mark the end of a connection without any settlement taking place, in which case this is just an equivalent to a TCP FIN packet. An explicit end-of-protocol markers can be useful when this protocol is embedded inside another.
CLOSE = 9;
public static final Protos.TwoWayChannelMessage.MessageType ERROR
Used to indicate an error condition. Both parties should make an effort to send either an ERROR or a CLOSE immediately before closing the socket (unless they just received an ERROR or a CLOSE). This is important because the protocol may not run over TCP.
ERROR = 10;
public static final int CLIENT_VERSION_VALUE
CLIENT_VERSION = 1;
public static final int SERVER_VERSION_VALUE
SERVER_VERSION = 2;
public static final int INITIATE_VALUE
INITIATE = 3;
public static final int PROVIDE_REFUND_VALUE
PROVIDE_REFUND = 4;
public static final int RETURN_REFUND_VALUE
RETURN_REFUND = 5;
public static final int PROVIDE_CONTRACT_VALUE
PROVIDE_CONTRACT = 6;
public static final int CHANNEL_OPEN_VALUE
Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the secondary to the primary to indicate that the provided contract was received, verified, and broadcast successfully and the primary can now provide UPDATE messages at will to begin paying secondary. If the channel is interrupted after the CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may reopen the channel by setting the contract transaction hash in its CLIENT_VERSION message.
CHANNEL_OPEN = 7;
public static final int UPDATE_PAYMENT_VALUE
UPDATE_PAYMENT = 8;
public static final int PAYMENT_ACK_VALUE
Sent by the server to the client after an UPDATE_PAYMENT message is successfully processed.
PAYMENT_ACK = 11;
public static final int CLOSE_VALUE
Either side can send this message. If the client sends it to the server, then the server takes the most recent signature it received in an UPDATE_PAYMENT and uses it to create a valid transaction, which it then broadcasts on the network. Once broadcast is complete, it sends back another CLOSE message with the settlement field set, containing the final state of the contract. The server is allowed to initiate settlement whenever it wants, in which case the client will asynchronously receive a CLOSE message with the settlement field set. The server is also allowed to send a CLOSE to mark the end of a connection without any settlement taking place, in which case this is just an equivalent to a TCP FIN packet. An explicit end-of-protocol markers can be useful when this protocol is embedded inside another.
CLOSE = 9;
public static final int ERROR_VALUE
Used to indicate an error condition. Both parties should make an effort to send either an ERROR or a CLOSE immediately before closing the socket (unless they just received an ERROR or a CLOSE). This is important because the protocol may not run over TCP.
ERROR = 10;
public static Protos.TwoWayChannelMessage.MessageType[] values()
for (Protos.TwoWayChannelMessage.MessageType c : Protos.TwoWayChannelMessage.MessageType.values()) System.out.println(c);
public static Protos.TwoWayChannelMessage.MessageType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final int getNumber()
getNumber
in interface com.google.protobuf.Internal.EnumLite
getNumber
in interface com.google.protobuf.ProtocolMessageEnum
@Deprecated public static Protos.TwoWayChannelMessage.MessageType valueOf(int value)
forNumber(int)
instead.public static Protos.TwoWayChannelMessage.MessageType forNumber(int value)
public static com.google.protobuf.Internal.EnumLiteMap<Protos.TwoWayChannelMessage.MessageType> internalGetValueMap()
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
getValueDescriptor
in interface com.google.protobuf.ProtocolMessageEnum
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
getDescriptorForType
in interface com.google.protobuf.ProtocolMessageEnum
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
public static Protos.TwoWayChannelMessage.MessageType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)