Package convex.net
Enum Class MessageType
- All Implemented Interfaces:
Serializable
,Comparable<MessageType>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCommunication of a latest Belief by a Peer.A message that requests the remote endpoint to respond with a signed response.A control command to a peer.A message relaying data.Communication of an intention to shutdown.A request to provide missing data.A request to perform the specified query and return results.A response to a challenge.Message containing the result for a corresponding COMMAND, QUERY or TRANSACT message.Request for a peer status update.A message requesting a transaction be performed by the receiving peer and included in the next available block. -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageType
decode
(int i) byte
static MessageType
Returns the enum constant of this class with the specified name.static MessageType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CHALLENGE
A message that requests the remote endpoint to respond with a signed response. The challenge must be signed to authenticate the challenger. The challenge is sent with a vector of [hash accountKey-of-the-challenged] -
RESPONSE
A response to a challenge. The challengee must sign the response as proof of possession of the claimed address. -
DATA
A message relaying data. Data is presented "as-is", and may be: - the result of a missing data request - data sent ahead of another message requiring composite data -
COMMAND
A control command to a peer. Should only be accepted and acted upon when originating from trusted, authenticated senders. -
MISSING_DATA
A request to provide missing data. Peers should not send this message unless both: a) they are unable to locate the given data in their local store b) They have reason to believe the targeted peer may be able to provide it Excessive invalid missing data requests may be considered a DoS attack by peers. Peers under load may need to ignore missing data requests. Payload is the missing data hash. Receiver should respond with a DATA message if the specified data is available in their store. -
QUERY
A request to perform the specified query and return results. Payload is: [id form address?] Receiver may may determine policies regarding whether to accept or reject queries, typically receiver will want to authenticate the sender and ensure good standing? -
TRANSACT
A message requesting a transaction be performed by the receiving peer and included in the next available block. Payload is: [id signed-data] -
RESULT
Message containing the result for a corresponding COMMAND, QUERY or TRANSACT message. Payload is: [id result error-flag] Where: - Result is the result of the request, or the message if an error occurred - error-flag is nil if the transaction succeeded, or error code if it failed -
BELIEF
Communication of a latest Belief by a Peer. Payload is a SignedData -
GOODBYE
Communication of an intention to shutdown. -
STATUS
Request for a peer status update. Payload is the message ID as a Long. Expected Result is a Vector: [signed-belief-hash states-hash initial-state-hash peer-key consensus-state-hash]
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getMessageCode
public byte getMessageCode() -
decode
- Throws:
BadFormatException
-