me.edwards.des.net.packet
Enum Packet.PacketTypes

java.lang.Object
  extended by java.lang.Enum<Packet.PacketTypes>
      extended by me.edwards.des.net.packet.Packet.PacketTypes
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Packet.PacketTypes>
Enclosing class:
Packet

public static enum Packet.PacketTypes
extends java.lang.Enum<Packet.PacketTypes>

Enumerates all the types of Packets and their ID's.

Created on: Jan 4, 2015 at 10:50:45 AM

Author:
Matthew Edwards

Enum Constant Summary
ADDR
          Address Packet Type, used to send information about all known peers
BALLOT
          Ballot Packet Type, used to transfer ballot information between nodes
BLOCK
          Block Packet Type, used to transfer block information between nodes
GETADDR
          Get Address Packet Type, used to request address information
GETBLOCKS
          Get Blocks Packet Type, used to request blocks
GETDATA
          Get Data Packet Type, used to request a particular piece of data
INV
          Inventory Packet Type, advertises knowledge of a particular piece of data
INVALID
          Invalid Packet Type, used for internal purposes
NOTFOUND
          Not Found Packet Type, signals that a specific piece of data that was requested could not be found
PING
          Ping Packet Type, used to ensure that connections are alive
PONG
          Pong Packet Type, used to ensure that connections are alive
VERACK
          Version Acknowledge Packet Type, used to complete handshake protocol
VERSION
          Version Packet Type, used for handshake protocol
 
Field Summary
private  byte id
           
 
Method Summary
 byte getID()
          Returns the Packet Type ID
static Packet.PacketTypes valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Packet.PacketTypes[] 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

INVALID

public static final Packet.PacketTypes INVALID
Invalid Packet Type, used for internal purposes


PING

public static final Packet.PacketTypes PING
Ping Packet Type, used to ensure that connections are alive

See Also:
PacketPing

PONG

public static final Packet.PacketTypes PONG
Pong Packet Type, used to ensure that connections are alive

See Also:
PacketPong

VERSION

public static final Packet.PacketTypes VERSION
Version Packet Type, used for handshake protocol

See Also:
PacketVersion

VERACK

public static final Packet.PacketTypes VERACK
Version Acknowledge Packet Type, used to complete handshake protocol

See Also:
PacketVerack

GETADDR

public static final Packet.PacketTypes GETADDR
Get Address Packet Type, used to request address information

See Also:
PacketGetAddr

ADDR

public static final Packet.PacketTypes ADDR
Address Packet Type, used to send information about all known peers

See Also:
PacketAddr

INV

public static final Packet.PacketTypes INV
Inventory Packet Type, advertises knowledge of a particular piece of data

See Also:
PacketInv

NOTFOUND

public static final Packet.PacketTypes NOTFOUND
Not Found Packet Type, signals that a specific piece of data that was requested could not be found

See Also:
PacketNotFound

GETDATA

public static final Packet.PacketTypes GETDATA
Get Data Packet Type, used to request a particular piece of data

See Also:
PacketGetData

BALLOT

public static final Packet.PacketTypes BALLOT
Ballot Packet Type, used to transfer ballot information between nodes

See Also:
PacketBallot

BLOCK

public static final Packet.PacketTypes BLOCK
Block Packet Type, used to transfer block information between nodes

See Also:
PacketBlock

GETBLOCKS

public static final Packet.PacketTypes GETBLOCKS
Get Blocks Packet Type, used to request blocks

See Also:
PacketGetBlocks
Field Detail

id

private byte id
Method Detail

values

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

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

valueOf

public static Packet.PacketTypes valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getID

public byte getID()
Returns the Packet Type ID

Returns:
Packet Type ID