public static enum Protos.TwoWayChannelMessage.MessageType extends Enum<Protos.TwoWayChannelMessage.MessageType> implements com.google.protobuf.ProtocolMessageEnum
paymentchannels.TwoWayChannelMessage.MessageType
Enum Constant and Description |
---|
CHANNEL_OPEN
CHANNEL_OPEN = 7; |
CLIENT_VERSION
CLIENT_VERSION = 1; |
CLOSE
CLOSE = 9; |
ERROR
ERROR = 10; |
INITIATE
INITIATE = 3; |
PAYMENT_ACK
PAYMENT_ACK = 11; |
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
CHANNEL_OPEN = 7; |
static int |
CLIENT_VERSION_VALUE
CLIENT_VERSION = 1; |
static int |
CLOSE_VALUE
CLOSE = 9; |
static int |
ERROR_VALUE
ERROR = 10; |
static int |
INITIATE_VALUE
INITIATE = 3; |
static int |
PAYMENT_ACK_VALUE
PAYMENT_ACK = 11; |
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 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) |
static Protos.TwoWayChannelMessage.MessageType |
valueOf(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
CHANNEL_OPEN = 7;
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.
public static final Protos.TwoWayChannelMessage.MessageType UPDATE_PAYMENT
UPDATE_PAYMENT = 8;
public static final Protos.TwoWayChannelMessage.MessageType PAYMENT_ACK
PAYMENT_ACK = 11;
Sent by the server to the client after an UPDATE_PAYMENT message is successfully processed.
public static final Protos.TwoWayChannelMessage.MessageType CLOSE
CLOSE = 9;
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.
public static final Protos.TwoWayChannelMessage.MessageType ERROR
ERROR = 10;
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.
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
CHANNEL_OPEN = 7;
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.
public static final int UPDATE_PAYMENT_VALUE
UPDATE_PAYMENT = 8;
public static final int PAYMENT_ACK_VALUE
PAYMENT_ACK = 11;
Sent by the server to the client after an UPDATE_PAYMENT message is successfully processed.
public static final int CLOSE_VALUE
CLOSE = 9;
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.
public static final int ERROR_VALUE
ERROR = 10;
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.
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(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 final int getNumber()
getNumber
in interface com.google.protobuf.Internal.EnumLite
getNumber
in interface com.google.protobuf.ProtocolMessageEnum
public static Protos.TwoWayChannelMessage.MessageType valueOf(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)
Copyright © 2014. All rights reserved.