NodeIDType
- public abstract class ReconfigurationPacket<NodeIDType> extends ProtocolPacket<NodeIDType,ReconfigurationPacket.PacketType> implements Byteable
Modifier and Type | Class and Description |
---|---|
static class |
ReconfigurationPacket.PacketType
End of ReconfigurationpacketType
|
ProtocolPacket.Keys
Modifier and Type | Field and Description |
---|---|
static ReconfigurationPacket.PacketType[] |
clientPacketTypes |
static java.lang.String |
HANDLER_METHOD_PREFIX
Used for reflection for invoking packet handling methods.
|
static java.lang.String |
PACKET_TYPE
Reconfiguration packet type JSON key.
|
static ReconfigurationPacket.PacketType[] |
serverPacketTypes |
type
Modifier | Constructor and Description |
---|---|
|
ReconfigurationPacket(org.json.JSONObject json,
Stringifiable<NodeIDType> unstringer) |
protected |
ReconfigurationPacket(NodeIDType initiator)
End of ReconfigurationpacketType class map
|
Modifier and Type | Method and Description |
---|---|
static void |
assertPacketTypeChecks(java.util.Map<ReconfigurationPacket.PacketType,java.lang.Class<?>> typeMap,
java.lang.Class<?> target) |
static void |
assertPacketTypeChecks(java.util.Map<ReconfigurationPacket.PacketType,java.lang.Class<?>> typeMap,
java.lang.Class<?> target,
java.lang.String handlerMethodPrefix) |
static void |
assertPacketTypeChecks(ReconfigurationPacket.PacketType[] types,
java.lang.Class<?> target,
java.lang.String handlerMethodPrefix) |
static void |
assertPacketTypeChecks(ReconfigurationPacket.PacketType type,
java.lang.String packetName,
java.lang.Class<?> target,
java.lang.String handlerMethodPrefix) |
static ReconfigurationPacket.PacketType[] |
concatenate(ReconfigurationPacket.PacketType[]... types) |
java.lang.Object |
getMessage() |
ReconfigurationPacket.PacketType |
getPacketType(org.json.JSONObject json) |
static java.lang.String |
getPacketTypeCanonicalClassName(ReconfigurationPacket.PacketType type) |
static java.lang.Class<?> |
getPacketTypeClass(ReconfigurationPacket.PacketType type) |
static java.lang.String |
getPacketTypeClassName(ReconfigurationPacket.PacketType type) |
static BasicReconfigurationPacket<?> |
getReconfigurationPacket(org.json.JSONObject json,
Stringifiable<?> unstringer) |
static BasicReconfigurationPacket<?> |
getReconfigurationPacket(Request request,
Stringifiable<?> unstringer) |
static BasicReconfigurationPacket<?> |
getReconfigurationPacketSuppressExceptions(org.json.JSONObject json,
Stringifiable<?> unstringer) |
static BasicReconfigurationPacket<?> |
getReconfigurationPacketSuppressExceptions(java.lang.String str,
Stringifiable<?> unstringer) |
ReconfigurationPacket.PacketType |
getReconfigurationPacketType() |
static ReconfigurationPacket.PacketType |
getReconfigurationPacketType(org.json.JSONObject json) |
static boolean |
isReconfigurationPacket(org.json.JSONObject json) |
void |
putPacketType(org.json.JSONObject json,
ReconfigurationPacket.PacketType type) |
byte[] |
toBytes()
The recommendation that the first four bytes contain the integer packet
type is for bring able to write efficient demultiplexers that will not
attempt to decode an incoming packet unless the type matches one of the
types they expect to receive.
|
org.json.JSONObject |
toJSONObjectImpl() |
java.lang.String |
toString() |
flip, getInitiator, getKey, getSender, getType, setKey, setSender, setType, toJSONObject
public static final java.lang.String PACKET_TYPE
public static final java.lang.String HANDLER_METHOD_PREFIX
public static final ReconfigurationPacket.PacketType[] clientPacketTypes
public static final ReconfigurationPacket.PacketType[] serverPacketTypes
protected ReconfigurationPacket(NodeIDType initiator)
public ReconfigurationPacket(org.json.JSONObject json, Stringifiable<NodeIDType> unstringer) throws org.json.JSONException
org.json.JSONException
public org.json.JSONObject toJSONObjectImpl() throws org.json.JSONException
toJSONObjectImpl
in class ProtocolPacket<NodeIDType,ReconfigurationPacket.PacketType>
org.json.JSONException
public java.lang.Object getMessage()
getMessage
in interface ProtocolEvent<ReconfigurationPacket.PacketType,java.lang.String>
getMessage
in class ProtocolPacket<NodeIDType,ReconfigurationPacket.PacketType>
public ReconfigurationPacket.PacketType getPacketType(org.json.JSONObject json) throws org.json.JSONException
getPacketType
in class ProtocolPacket<NodeIDType,ReconfigurationPacket.PacketType>
org.json.JSONException
public void putPacketType(org.json.JSONObject json, ReconfigurationPacket.PacketType type) throws org.json.JSONException
putPacketType
in class ProtocolPacket<NodeIDType,ReconfigurationPacket.PacketType>
org.json.JSONException
public java.lang.String toString()
toString
in class ProtocolPacket<NodeIDType,ReconfigurationPacket.PacketType>
public ReconfigurationPacket.PacketType getReconfigurationPacketType()
public static final boolean isReconfigurationPacket(org.json.JSONObject json) throws org.json.JSONException
org.json.JSONException
public static final ReconfigurationPacket.PacketType getReconfigurationPacketType(org.json.JSONObject json) throws org.json.JSONException
org.json.JSONException
public static final java.lang.String getPacketTypeCanonicalClassName(ReconfigurationPacket.PacketType type)
public static final java.lang.String getPacketTypeClassName(ReconfigurationPacket.PacketType type)
public static final java.lang.Class<?> getPacketTypeClass(ReconfigurationPacket.PacketType type)
public static BasicReconfigurationPacket<?> getReconfigurationPacketSuppressExceptions(org.json.JSONObject json, Stringifiable<?> unstringer)
public static BasicReconfigurationPacket<?> getReconfigurationPacketSuppressExceptions(java.lang.String str, Stringifiable<?> unstringer)
public static BasicReconfigurationPacket<?> getReconfigurationPacket(org.json.JSONObject json, Stringifiable<?> unstringer) throws org.json.JSONException
org.json.JSONException
public static BasicReconfigurationPacket<?> getReconfigurationPacket(Request request, Stringifiable<?> unstringer) throws org.json.JSONException
org.json.JSONException
public static void assertPacketTypeChecks(ReconfigurationPacket.PacketType[] types, java.lang.Class<?> target, java.lang.String handlerMethodPrefix)
public static void assertPacketTypeChecks(java.util.Map<ReconfigurationPacket.PacketType,java.lang.Class<?>> typeMap, java.lang.Class<?> target, java.lang.String handlerMethodPrefix)
public static void assertPacketTypeChecks(ReconfigurationPacket.PacketType type, java.lang.String packetName, java.lang.Class<?> target, java.lang.String handlerMethodPrefix)
public static void assertPacketTypeChecks(java.util.Map<ReconfigurationPacket.PacketType,java.lang.Class<?>> typeMap, java.lang.Class<?> target)
public static ReconfigurationPacket.PacketType[] concatenate(ReconfigurationPacket.PacketType[]... types)
public byte[] toBytes()
Byteable
toBytes
in interface Byteable