public abstract class ClientReconfigurationPacket extends BasicReconfigurationPacket<java.net.InetSocketAddress> implements ReconfiguratorRequest
CreateServiceName,
DeleteServiceName, and RequestActiveReplicas. The
same implementation of ClientReconfigurationPacket is used for both
the request and the corresponding response. The method isRequest()
says whether the packet is an incoming request or an outgoing
response.| Modifier and Type | Class and Description |
|---|---|
static class |
ClientReconfigurationPacket.Keys |
static class |
ClientReconfigurationPacket.ResponseCodes |
ReconfigurationPacket.PacketType| Modifier and Type | Field and Description |
|---|---|
static Stringifiable<java.net.InetSocketAddress> |
unstringer
Unstringer needed to handle client InetSocketAddresses as opposed to
NodeIDType.
|
epochNumber, serviceNameclientPacketTypes, HANDLER_METHOD_PREFIX, PACKET_TYPE, serverPacketTypestype| Constructor and Description |
|---|
ClientReconfigurationPacket(java.net.InetSocketAddress initiator,
ReconfigurationPacket.PacketType type,
java.lang.String name,
int epochNumber) |
ClientReconfigurationPacket(java.net.InetSocketAddress initiator,
ReconfigurationPacket.PacketType type,
java.lang.String name,
int epochNumber,
java.net.InetSocketAddress myReceiver)
myReceiver may need to be set at creation time in create/delete
responses.
|
ClientReconfigurationPacket(org.json.JSONObject json) |
ClientReconfigurationPacket(org.json.JSONObject json,
Stringifiable<?> unstringer) |
ClientReconfigurationPacket(java.lang.String name,
ClientReconfigurationPacket crp) |
| Modifier and Type | Method and Description |
|---|---|
long |
getCreateTime() |
java.net.InetSocketAddress |
getCreator() |
java.net.InetSocketAddress |
getForwader() |
java.net.InetSocketAddress |
getForwardee() |
java.util.Set<java.net.InetSocketAddress> |
getHashRCs() |
java.net.InetSocketAddress |
getMyReceiver() |
IntegerPacketType |
getRequestType() |
ClientReconfigurationPacket.ResponseCodes |
getResponseCode() |
java.lang.String |
getResponseMessage() |
java.lang.String |
getSummary()
Implementations are encouraged to return an inline created new Object()
whose toString() method will return the actual String instead of just
returning the String directly.
|
boolean |
isFailed() |
boolean |
isForwardable() |
boolean |
isForwarded() |
boolean |
isRecursiveRedirectEnabled() |
boolean |
isRedirectedResponse()
The sender will be different from the forwarder.
|
boolean |
isRequest() |
ClientReconfigurationPacket |
makeResponse() |
ClientReconfigurationPacket |
setFailed() |
ClientReconfigurationPacket |
setFailed(ClientReconfigurationPacket.ResponseCodes code)
Sets as failed and marks as response.
|
ClientReconfigurationPacket |
setForwader(java.net.InetSocketAddress isa) |
ClientReconfigurationPacket |
setForwardee(java.net.InetSocketAddress isa) |
ClientReconfigurationPacket |
setHashRCs(java.util.Set<java.net.InetSocketAddress> RCs) |
void |
setRecursiveRedirect(boolean b) |
ClientReconfigurationPacket |
setResponseMessage(java.lang.String msg)
Sets response message and marks as response.
|
org.json.JSONObject |
toJSONObjectImpl() |
getEpochNumber, getServiceNameassertPacketTypeChecks, assertPacketTypeChecks, assertPacketTypeChecks, assertPacketTypeChecks, concatenate, getMessage, getPacketType, getPacketTypeCanonicalClassName, getPacketTypeClass, getPacketTypeClassName, getReconfigurationPacket, getReconfigurationPacket, getReconfigurationPacketSuppressExceptions, getReconfigurationPacketSuppressExceptions, getReconfigurationPacketType, getReconfigurationPacketType, isReconfigurationPacket, putPacketType, toBytes, toStringflip, getInitiator, getKey, getSender, getType, setKey, setSender, setType, toJSONObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetServiceName, toBytes, toStringgetSummarypublic static final Stringifiable<java.net.InetSocketAddress> unstringer
public ClientReconfigurationPacket(java.net.InetSocketAddress initiator,
ReconfigurationPacket.PacketType type,
java.lang.String name,
int epochNumber)
initiator - type - name - epochNumber - public ClientReconfigurationPacket(java.net.InetSocketAddress initiator,
ReconfigurationPacket.PacketType type,
java.lang.String name,
int epochNumber,
java.net.InetSocketAddress myReceiver)
initiator - type - name - epochNumber - myReceiver - public ClientReconfigurationPacket(java.lang.String name,
ClientReconfigurationPacket crp)
name - crp - public ClientReconfigurationPacket(org.json.JSONObject json,
Stringifiable<?> unstringer)
throws org.json.JSONException
json - unstringer - org.json.JSONExceptionpublic ClientReconfigurationPacket(org.json.JSONObject json)
throws org.json.JSONException
json - org.json.JSONExceptionpublic org.json.JSONObject toJSONObjectImpl()
throws org.json.JSONException
toJSONObjectImpl in class BasicReconfigurationPacket<java.net.InetSocketAddress>org.json.JSONExceptionpublic IntegerPacketType getRequestType()
getRequestType in interface RequestgetRequestType in class BasicReconfigurationPacket<java.net.InetSocketAddress>public ClientReconfigurationPacket setFailed(ClientReconfigurationPacket.ResponseCodes code)
code - public ClientReconfigurationPacket setFailed()
setFailed in interface ReconfiguratorRequestpublic boolean isFailed()
isFailed in interface ReconfiguratorRequestpublic ClientReconfigurationPacket setResponseMessage(java.lang.String msg)
setResponseMessage in interface ReconfiguratorRequestmsg - thispublic java.lang.String getResponseMessage()
getResponseMessage in interface ReconfiguratorRequestpublic ClientReconfigurationPacket.ResponseCodes getResponseCode()
public ClientReconfigurationPacket setHashRCs(java.util.Set<java.net.InetSocketAddress> RCs)
RCs - Set of consistently hashed reconfigurators for this name.thispublic java.util.Set<java.net.InetSocketAddress> getHashRCs()
public void setRecursiveRedirect(boolean b)
b - public boolean isRecursiveRedirectEnabled()
public boolean isRequest()
public ClientReconfigurationPacket makeResponse()
this marked as a response.public java.net.InetSocketAddress getForwader()
public java.net.InetSocketAddress getForwardee()
public java.net.InetSocketAddress getMyReceiver()
public java.net.InetSocketAddress getCreator()
public ClientReconfigurationPacket setForwader(java.net.InetSocketAddress isa)
isa - thispublic ClientReconfigurationPacket setForwardee(java.net.InetSocketAddress isa)
isa - thispublic boolean isForwardable()
public boolean isForwarded()
public boolean isRedirectedResponse()
public long getCreateTime()
public java.lang.String getSummary()
SummarizablegetSummary in interface RequestgetSummary in interface SummarizablegetSummary in class BasicReconfigurationPacket<java.net.InetSocketAddress>