Class | +Description | +
---|---|
VMServices | +
+ This class is used by the trusted client to add and remove replicas from the group
+ |
+
AsynchServiceProxy(int processId)
AsynchServiceProxy(int processId)
+AsynchServiceProxy(int processId,
- java.lang.String configHome)
AsynchServiceProxy(int processId,
+AsynchServiceProxy(int processId,
java.lang.String configHome,
java.util.Comparator<byte[]> replyComparator,
- Extractor replyExtractor)
+ Extractor replyExtractor,
+ KeyLoader loader)
+AsynchServiceProxy(int processId,
+ java.lang.String configHome,
+ KeyLoader loader)
+void
cleanAsynchRequest(int requestId)
cleanAsynchRequest(int requestId)
+int
invokeAsynchRequest(byte[] request,
int[] targets,
bftsmart.communication.client.ReplyListener replyListener,
- bftsmart.tom.core.messages.TOMMessageType reqType)
int
getInvokeTimeout, getInvokeUnorderedHashedTimeout, invoke, invokeOrdered, invokeUnordered, invokeUnorderedHashed, setInvokeTimeout, setInvokeUnorderedHashedTimeout
+getInvokeTimeout, getInvokeUnorderedHashedTimeout, getReplyQuorum, invoke, invokeOrdered, invokeUnordered, invokeUnorderedHashed, reconfigureTo, setInvokeTimeout, setInvokeUnorderedHashedTimeout
close, generateOperationId, generateRequestId, getCommunicationSystem, getProcessId, getSession, getViewManager, init, init, sendMessageToTargets, sendMessageToTargets, TOMulticast, TOMulticast, TOMulticast
close, generateOperationId, generateRequestId, getCommunicationSystem, getProcessId, getSession, getViewManager, init, init, sendMessageToTargets, TOMulticast, TOMulticast
public AsynchServiceProxy(int processId, java.lang.String configHome)+
processId
- Replica idconfigHome
- Configuration folderbellow
public AsynchServiceProxy(int processId, + java.lang.String configHome, + KeyLoader loader)+
bellow
public AsynchServiceProxy(int processId, java.lang.String configHome, java.util.Comparator<byte[]> replyComparator, - Extractor replyExtractor)+ Extractor replyExtractor, + KeyLoader loader) +
processId
- Process id for this client (should be different from replicas)configHome
- Configuration directory for BFT-SMARTreplyComparator
- Used for comparing replies from different servers
+ to extract one returned by f+1replyExtractor
- Used for extracting the response from the matching
+ quorum of repliesloader
- Used to load signature keys from diskrequest
- replyListener
- reqType
- Request typebellow
request
- targets
- replyListener
- request
- Request to be senttargets
- The IDs for the replicas to which to send the requestreplyListener
- Callback object that handles reception of repliesreqType
- Request typepublic void cleanAsynchRequest(int requestId)+
requestId
- RequestrequestId
- A unique identification for a previously sent requestpublic void replyReceived(bftsmart.tom.core.messages.TOMMessage reply)-
ServiceProxy
Modifier and Type | Method and Description | ||
---|---|---|---|
int |
-getConsensusId() |
+getConsensusId()
+Returns the ID of the consensus in which this request was ordered (-1
+ if readonly).
+ |
|
bftsmart.tom.core.messages.TOMMessage |
-getFirstInBatch() |
+getFirstInBatch()
+Returns the first request in the ordered batch
+ |
|
int |
-getLeader() |
+getLeader()
+Returns the id of the leader replica in which this message was ordered
+ (-1 if readonly).
+ |
|
byte[] |
-getNonces() |
+getNonces()
+Returns the nonces as generated by the leader
+ |
|
int |
-getNumOfNonces() |
+getNumOfNonces()
+Returns the number of nonces as generated by the leader
+ |
|
int |
-getOperationId() |
+getOperationId()
+Returns the operation ID
+ |
|
java.util.Set<bftsmart.consensus.messages.ConsensusMessage> |
-getProof() |
+getProof()
+Returns the proof for the consensus.
+ |
|
int |
-getRegency() |
+getRegency()
+Returns the current regency in which the message was ordered.
+ |
|
int |
-getReplyServer() |
+getReplyServer()
+Returns the ID of the server expected to send a non-hashed reply when the clients sends an unordered hashed request.
+ |
|
long |
-getSeed() |
+getSeed()
+Returns the seed as generated by the leader
+ |
|
int |
getSender()
-Returns the sender of the message
+Returns the ID of the client that sent the message
|
||
int |
-getSequence() |
+getSequence()
+Returns the request's sequence number
+ |
|
static long |
-getSerialVersionUID() |
+int |
+getSession()
+Returns the client's session
+ |
int |
-getSession() |
+byte[] |
+getSignature()
+Returns the client's signature.
+ |
byte[] |
-getSignature() |
+long |
+getTimestamp()
+Returns the timestamp as generated by the leader
+ |
long |
-getTimestamp() |
+bftsmart.tom.core.messages.TOMMessageType |
+getType()
+Returns the request type
+ |
bftsmart.tom.core.messages.TOMMessageType |
-getType() |
+int |
+getViewID()
+Returns the view ID
+ |
int |
-getViewID() |
+boolean |
+isLastInBatch()
+Returns the last request in the ordered batch
+ |
boolean |
-isLastInBatch() |
+isNoOp()
+Returns true if the consensus instance has no operations to deliver to the application
+ |
|
boolean |
-isNoOp() |
-||
bftsmart.tom.core.messages.TOMMessage |
recreateTOMMessage(byte[] content)
Generates a TOMMessage for its associated requests using the new info that it now supports since the previous commit.
|
||
void |
-setLastInBatch() |
+setLastInBatch()
+Deprecated.
+ |
sender
- viewID
- type
- session
- sequence
- operationId
- replyServer
- signature
- timestamp
- numOfNonces
- seed
- regency
- leader
- consensusId
- proof
- firstInBatch
- noOp
- sender
- The sender IDviewID
- The view IDtype
- The request typesession
- Client's sessionsequence
- Request's sequence numberoperationId
- The operation IDreplyServer
- ID of the server expected to send a non-hashed reply when the clients sends an unordered hashed request.signature
- Client's signature.timestamp
- The timestamp as generated by the leadernumOfNonces
- The nonces as generated by the leaderseed
- The seed as generated by the leaderregency
- The current regency in which the message was ordered.leader
- The leader with which the batch was decidedconsensusId
- The ID of the consensus in which this request was orderedproof
- The proof for the consensusfirstInBatch
- The first request in the ordered batchnoOp
- true if the consensus instance has no operations to deliver to the applicationpublic static long getSerialVersionUID()-
public int getViewID()+
public bftsmart.tom.core.messages.TOMMessageType getType()+
public int getSession()+
public int getSequence()+
public int getOperationId()+
public int getReplyServer()+
public byte[] getSignature()+
public int getSender()-
public long getTimestamp()+
public byte[] getNonces()+
public int getNumOfNonces()+
public long getSeed()+
public int getConsensusId()+
public int getLeader()+
public java.util.Set<bftsmart.consensus.messages.ConsensusMessage> getProof()+
public int getRegency()+
public bftsmart.tom.core.messages.TOMMessage getFirstInBatch()+
public void setLastInBatch()+
public boolean isLastInBatch()+
public boolean isNoOp()+
ReplicaContext(bftsmart.communication.ServerCommunicationSystem cs,
- bftsmart.reconfiguration.ServerViewController SVController)
bftsmart.communication.ServerCommunicationSystem
getServerCommunicationSystem()
getServerCommunicationSystem()
+bftsmart.reconfiguration.util.TOMConfiguration
void
setServerCommunicationSystem(bftsmart.communication.ServerCommunicationSystem cs)
public bftsmart.communication.ServerCommunicationSystem getServerCommunicationSystem()-
public void setServerCommunicationSystem(bftsmart.communication.ServerCommunicationSystem cs)+
RequestContext(int reqId,
+RequestContext(int reqId,
int operationId,
bftsmart.tom.core.messages.TOMMessageType requestType,
int[] targets,
long sendingTime,
- bftsmart.communication.client.ReplyListener replyListener)
+ bftsmart.communication.client.ReplyListener replyListener,
+ byte[] request)
+int
getOperationId()
getOperationId()
+bftsmart.communication.client.ReplyListener
getReplyListener()
getReplyListener()
+int
getReqId()
getReqId()
+bftsmart.tom.core.messages.TOMMessageType
getRequestType()
byte[]
getRequest()
+long
getSendingTime()
bftsmart.tom.core.messages.TOMMessageType
getRequestType()
+long
getSendingTime()
+int[]
getTargets()
getTargets()
+reqId
- Request IDoperationId
- Operation IDrequestType
- The request typetargets
- IDs of the targets to which the request was sentsendingTime
- Sending timereplyListener
- Reply listener associated to the requestrequest
- Payload of the requestpublic final int getReqId()+
public final int getOperationId()+
public final bftsmart.tom.core.messages.TOMMessageType getRequestType()+
public final long getSendingTime()+
public bftsmart.communication.client.ReplyListener getReplyListener()+
public int[] getTargets()+
public byte[] getRequest()+
public class ServiceProxy -extends TOMSender+extends bftsmart.tom.core.TOMSender
ServiceProxy(int processId,
+ServiceProxy(int processId,
java.lang.String configHome,
java.util.Comparator<byte[]> replyComparator,
- Extractor replyExtractor)
+ Extractor replyExtractor,
+ KeyLoader loader)
+Constructor
+
+
ServiceProxy(int processId,
+ java.lang.String configHome,
+ KeyLoader loader)
Modifier and Type | Method and Description | @@ -210,51 +218,75 @@|
---|---|---|
int |
-getInvokeUnorderedHashedTimeout() |
+getInvokeUnorderedHashedTimeout()
+Get the amount of time (in seconds) that this proxy will wait for
+ servers unordered hashed replies before returning null.
+ |
protected int |
+getReplyQuorum()
+Retrieves the required quorum size for the amount of replies
+ |
+|
byte[] |
invoke(byte[] request,
bftsmart.tom.core.messages.TOMMessageType reqType)
This method sends a request to the replicas, and returns the related reply.
|
|
byte[] |
-invokeOrdered(byte[] request) |
-|
byte[] |
-invokeUnordered(byte[] request) |
+invokeOrdered(byte[] request)
+This method sends an ordered request to the replicas, and returns the related reply.
+ |
byte[] |
-invokeUnorderedHashed(byte[] request) |
+invokeUnordered(byte[] request)
+This method sends an unordered request to the replicas, and returns the related reply.
+ |
byte[] |
+invokeUnorderedHashed(byte[] request)
+This method sends an unordered request to the replicas, and returns the related reply.
+ |
+|
protected void |
+reconfigureTo(bftsmart.reconfiguration.views.View v)
+Deprecated.
+ |
+|
void |
replyReceived(bftsmart.tom.core.messages.TOMMessage reply)
This is the method invoked by the client side communication system.
|
|
void |
setInvokeTimeout(int invokeTimeout)
Set the amount of time (in seconds) that this proxy will wait for
servers replies before returning null.
|
|
void |
-setInvokeUnorderedHashedTimeout(int timeout) |
+setInvokeUnorderedHashedTimeout(int timeout)
+Set the amount of time (in seconds) that this proxy will wait for
+ servers unordered hashed replies before returning null.
+ |
close, generateOperationId, generateRequestId, getCommunicationSystem, getProcessId, getSession, getViewManager, init, init, sendMessageToTargets, sendMessageToTargets, TOMulticast, TOMulticast, TOMulticast
close, generateOperationId, generateRequestId, getCommunicationSystem, getProcessId, getSession, getViewManager, init, init, sendMessageToTargets, TOMulticast, TOMulticast
public ServiceProxy(int processId, + java.lang.String configHome, + KeyLoader loader)+
bellow
public ServiceProxy(int processId, java.lang.String configHome, java.util.Comparator<byte[]> replyComparator, - Extractor replyExtractor)+ Extractor replyExtractor, + KeyLoader loader)
processId
- Process id for this client (should be different from replicas)configHome
- Configuration directory for BFT-SMARTreplyComparator
- used for comparing replies from different servers
+replyComparator
- Used for comparing replies from different servers
to extract one returned by f+1replyExtractor
- used for extracting the response from the matching
+replyExtractor
- Used for extracting the response from the matching
quorum of repliesloader
- Used to load signature keys from diskpublic int getInvokeUnorderedHashedTimeout()+
invokeTimeout
- the invokeTimeout to setinvokeTimeout
- the timeout value to setpublic void setInvokeUnorderedHashedTimeout(int timeout)+
timeout
- the timeout value to setpublic byte[] invokeOrdered(byte[] request)+
request
- to be sentpublic byte[] invokeUnordered(byte[] request)+
request
- to be sentpublic byte[] invokeUnorderedHashed(byte[] request)+
request
- to be sentrequest
- Request to be sentreqType
- TOM_NORMAL_REQUESTS for service requests, and other for
- reconfig requests.reqType
- ORDERED_REQUEST/UNORDERED_REQUEST/UNORDERED_HASHED_REQUEST for normal requests, and RECONFIG for
+ reconfiguration requests.protected void reconfigureTo(bftsmart.reconfiguration.views.View v)+
public void replyReceived(bftsmart.tom.core.messages.TOMMessage reply)@@ -472,6 +573,20 @@
protected int getReplyQuorum()+
public ServiceReplica(int id, java.lang.String configHome, - boolean isToJoin, Executable executor, Recoverable recoverer, - RequestVerifier verifier)+ RequestVerifier verifier, + Replier replier, + KeyLoader loader) +
id
- Replica IDconfigHome
- Configuration directory for BFT-SMARTexecutor
- The executor implementationrecoverer
- The recoverer implementationverifier
- Requests Verifierreplier
- Can be used to override the targets of the replies associated to each request.loader
- Used to load signature keys from diskpublic void setReplyController(Replier replier)-
public void joinMsgReceived(bftsmart.reconfiguration.VMMessage msg)+
public final void receiveReadonlyMessage(bftsmart.tom.core.messages.TOMMessage message, MessageContext msgCtx)-
message
- the request received from the delivery threadpublic void kill()+
public void restart()+
public final ReplicaContext getReplicaContext()+
public void leave()-
public bftsmart.communication.ServerCommunicationSystem getServerCommunicationSystem()+
public final ReplicaContext getReplicaContext()-
public int getId()+