org.bitcoin.paymentchannel
Enum Protos.TwoWayChannelMessage.MessageType

java.lang.Object
  extended by java.lang.Enum<Protos.TwoWayChannelMessage.MessageType>
      extended by org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType
All Implemented Interfaces:
com.google.protobuf.Internal.EnumLite, com.google.protobuf.ProtocolMessageEnum, Serializable, Comparable<Protos.TwoWayChannelMessage.MessageType>
Enclosing class:
Protos.TwoWayChannelMessage

public static enum Protos.TwoWayChannelMessage.MessageType
extends Enum<Protos.TwoWayChannelMessage.MessageType>
implements com.google.protobuf.ProtocolMessageEnum

Protobuf enum paymentchannels.TwoWayChannelMessage.MessageType


Enum Constant Summary
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;
 
Field Summary
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;
 
Method Summary
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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CLIENT_VERSION

public static final Protos.TwoWayChannelMessage.MessageType CLIENT_VERSION
CLIENT_VERSION = 1;


SERVER_VERSION

public static final Protos.TwoWayChannelMessage.MessageType SERVER_VERSION
SERVER_VERSION = 2;


INITIATE

public static final Protos.TwoWayChannelMessage.MessageType INITIATE
INITIATE = 3;


PROVIDE_REFUND

public static final Protos.TwoWayChannelMessage.MessageType PROVIDE_REFUND
PROVIDE_REFUND = 4;


RETURN_REFUND

public static final Protos.TwoWayChannelMessage.MessageType RETURN_REFUND
RETURN_REFUND = 5;


PROVIDE_CONTRACT

public static final Protos.TwoWayChannelMessage.MessageType PROVIDE_CONTRACT
PROVIDE_CONTRACT = 6;


CHANNEL_OPEN

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.
 


UPDATE_PAYMENT

public static final Protos.TwoWayChannelMessage.MessageType UPDATE_PAYMENT
UPDATE_PAYMENT = 8;


PAYMENT_ACK

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.
 


CLOSE

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.
 


ERROR

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.
 

Field Detail

CLIENT_VERSION_VALUE

public static final int CLIENT_VERSION_VALUE
CLIENT_VERSION = 1;

See Also:
Constant Field Values

SERVER_VERSION_VALUE

public static final int SERVER_VERSION_VALUE
SERVER_VERSION = 2;

See Also:
Constant Field Values

INITIATE_VALUE

public static final int INITIATE_VALUE
INITIATE = 3;

See Also:
Constant Field Values

PROVIDE_REFUND_VALUE

public static final int PROVIDE_REFUND_VALUE
PROVIDE_REFUND = 4;

See Also:
Constant Field Values

RETURN_REFUND_VALUE

public static final int RETURN_REFUND_VALUE
RETURN_REFUND = 5;

See Also:
Constant Field Values

PROVIDE_CONTRACT_VALUE

public static final int PROVIDE_CONTRACT_VALUE
PROVIDE_CONTRACT = 6;

See Also:
Constant Field Values

CHANNEL_OPEN_VALUE

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.
 

See Also:
Constant Field Values

UPDATE_PAYMENT_VALUE

public static final int UPDATE_PAYMENT_VALUE
UPDATE_PAYMENT = 8;

See Also:
Constant Field Values

PAYMENT_ACK_VALUE

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.
 

See Also:
Constant Field Values

CLOSE_VALUE

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.
 

See Also:
Constant Field Values

ERROR_VALUE

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.
 

See Also:
Constant Field Values
Method Detail

values

public static Protos.TwoWayChannelMessage.MessageType[] 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 (Protos.TwoWayChannelMessage.MessageType c : Protos.TwoWayChannelMessage.MessageType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Protos.TwoWayChannelMessage.MessageType 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 name
NullPointerException - if the argument is null

getNumber

public final int getNumber()
Specified by:
getNumber in interface com.google.protobuf.Internal.EnumLite
Specified by:
getNumber in interface com.google.protobuf.ProtocolMessageEnum

valueOf

public static Protos.TwoWayChannelMessage.MessageType valueOf(int value)

internalGetValueMap

public static com.google.protobuf.Internal.EnumLiteMap<Protos.TwoWayChannelMessage.MessageType> internalGetValueMap()

getValueDescriptor

public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
Specified by:
getValueDescriptor in interface com.google.protobuf.ProtocolMessageEnum

getDescriptorForType

public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
Specified by:
getDescriptorForType in interface com.google.protobuf.ProtocolMessageEnum

getDescriptor

public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()

valueOf

public static Protos.TwoWayChannelMessage.MessageType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)


Copyright © 2014. All rights reserved.