Rice Pastry API

org.mpisws.p2p.transport.peerreview.evidence
Class EvidenceTransferProtocolImpl<Handle extends RawSerializable,Identifier extends RawSerializable>

java.lang.Object
  extended by org.mpisws.p2p.transport.peerreview.evidence.EvidenceTransferProtocolImpl<Handle,Identifier>
All Implemented Interfaces:
EvidenceTransferProtocol<Handle,Identifier>, PeerReviewConstants, StatusConstants, WitnessListener<Handle,Identifier>

public class EvidenceTransferProtocolImpl<Handle extends RawSerializable,Identifier extends RawSerializable>
extends java.lang.Object
implements EvidenceTransferProtocol<Handle,Identifier>, PeerReviewConstants

This protocol transfers evidence to the witnesses


Nested Class Summary
 class EvidenceTransferProtocolImpl.CacheInfo
          Since applications like ePOST must communicate to determine the current witness set of a node (which is expensive), we cache witness sets for a while.
 class EvidenceTransferProtocolImpl.MessageInfo
          When we have a message for a node whose witness set is not (yet) known, it is queued in here
 class EvidenceTransferProtocolImpl.QueryInfo
          Here we remember all the questions we've asked the application about witness sets
 
Field Summary
 
Fields inherited from interface org.mpisws.p2p.transport.peerreview.PeerReviewConstants
AUTH_CACHE_INTERVAL, CERT_MISSING, CHAL_AUDIT, CHAL_SEND, DEFAULT_AUDIT_INTERVAL_MILLIS, DEFAULT_AUTH_PUSH_INTERVAL_MILLIS, DEFAULT_CHECKPOINT_INTERVAL_MILLIS, DEFAULT_LOG_DOWNLOAD_TIMEOUT, DEFAULT_TIME_TOLERANCE_MILLIS, EVT_ACK, EVT_CHECKPOINT, EVT_CHOOSE_Q, EVT_CHOOSE_RAND, EVT_INIT, EVT_MAX_RESERVED, EVT_MAX_SOCKET_EVT, EVT_MIN_SOCKET_EVT, EVT_RECV, EVT_SEND, EVT_SENDSIGN, EVT_SIGN, EVT_SOCKET_CAN_READ, EVT_SOCKET_CAN_RW, EVT_SOCKET_CAN_WRITE, EVT_SOCKET_CLOSE, EVT_SOCKET_CLOSED, EVT_SOCKET_EXCEPTION, EVT_SOCKET_OPEN_INCOMING, EVT_SOCKET_OPEN_OUTGOING, EVT_SOCKET_OPENED_OUTGOING, EVT_SOCKET_READ, EVT_SOCKET_SHUTDOWN_OUTPUT, EVT_SOCKET_WRITE, EVT_VRF, EX_TYPE_ClosedChannel, EX_TYPE_IO, EX_TYPE_Unknown, FLAG_FULL_MESSAGES_ALL, FLAG_FULL_MESSAGES_SENDER, FLAG_INCLUDE_CHECKPOINT, INVALID, INVESTIGATION_INTERVAL_MILLIS, MAINTENANCE_INTERVAL_MILLIS, MAX_ACTIVE_AUDITS, MAX_ACTIVE_INVESTIGATIONS, MAX_ENTRIES_BETWEEN_CHECKPOINTS, MAX_STATUS_INFO, MAX_WITNESSED_NODES, MSG_ACCUSATION, MSG_ACK, MSG_AUTHPUSH, MSG_AUTHREQ, MSG_AUTHRESP, MSG_CHALLENGE, MSG_RESPONSE, MSG_USERDATA, MSG_USERDGRAM, NO_CERTIFICATE, PROGRESS_INTERVAL_MILLIS, PROOF_INCONSISTENT, PROOF_NONCONFORMANT, RESP_AUDIT, RESP_SEND, SIGNATURE_BAD, SIGNATURE_OK, STATE_SEND_AUDIT, STATE_WAIT_FOR_LOG, TI_AUTH_PUSH, TI_CHECKPOINT, TI_MAINTENANCE, TI_MAKE_PROGRESS, TI_MAX_RESERVED, TI_START_AUDITS, TI_STATUS_INFO, VALID
 
Fields inherited from interface org.mpisws.p2p.transport.peerreview.StatusConstants
STATUS_EXPOSED, STATUS_SUSPECTED, STATUS_TRUSTED
 
Constructor Summary
EvidenceTransferProtocolImpl(PeerReview<Handle,Identifier> peerreview, IdentityTransport<Handle,Identifier> transport, PeerInfoStore<Handle,Identifier> infoStore)
           
 
Method Summary
protected  java.util.Collection<Handle> getWitnesses(Identifier subject)
          Either returns the valid cached value, or returns null Often requestWitnesses() is called next If it returns null, then notifyWitnessSet() will be called later
 void notifyWitnessSet(Identifier subject, java.util.Collection<Handle> witnesses)
          Called when the local node learns about the members of another node's witness set.
 void requestWitnesses(java.util.Collection<Identifier> subjectList, Continuation<java.util.Map<Identifier,java.util.Collection<Handle>>,java.lang.Exception> c)
           
protected  void requestWitnesses(Identifier subject)
          Only call me if there isn't already a valid witness set
 void sendEvidence(Handle target, Identifier subject)
          When this is called, some node has asked us for evidence about another node, and we have found either (a) an unanswered challenge, or (b) a proof of misbehavior.
 void sendMessageToWitnesses(Identifier subject, PeerReviewMessage message, MessageCallback<Handle,java.nio.ByteBuffer> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Object> options)
          Send a message to all the members of the target node's witness set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvidenceTransferProtocolImpl

public EvidenceTransferProtocolImpl(PeerReview<Handle,Identifier> peerreview,
                                    IdentityTransport<Handle,Identifier> transport,
                                    PeerInfoStore<Handle,Identifier> infoStore)
Method Detail

notifyWitnessSet

public void notifyWitnessSet(Identifier subject,
                             java.util.Collection<Handle> witnesses)
Called when the local node learns about the members of another node's witness set. 1) Send any pending messages to the witnesses 2) Try to fill in any pending queries, (there is usually only going to be 1 or zero)

Specified by:
notifyWitnessSet in interface WitnessListener<Handle extends RawSerializable,Identifier extends RawSerializable>

sendMessageToWitnesses

public void sendMessageToWitnesses(Identifier subject,
                                   PeerReviewMessage message,
                                   MessageCallback<Handle,java.nio.ByteBuffer> deliverAckToMe,
                                   java.util.Map<java.lang.String,java.lang.Object> options)
Send a message to all the members of the target node's witness set. If the witness set is not known, we need to make an upcall to the application first

Specified by:
sendMessageToWitnesses in interface EvidenceTransferProtocol<Handle extends RawSerializable,Identifier extends RawSerializable>

requestWitnesses

public void requestWitnesses(java.util.Collection<Identifier> subjectList,
                             Continuation<java.util.Map<Identifier,java.util.Collection<Handle>>,java.lang.Exception> c)
Specified by:
requestWitnesses in interface EvidenceTransferProtocol<Handle extends RawSerializable,Identifier extends RawSerializable>

getWitnesses

protected java.util.Collection<Handle> getWitnesses(Identifier subject)
Either returns the valid cached value, or returns null Often requestWitnesses() is called next If it returns null, then notifyWitnessSet() will be called later

Parameters:
subject -
Returns:

requestWitnesses

protected void requestWitnesses(Identifier subject)
Only call me if there isn't already a valid witness set

Parameters:
subject -

sendEvidence

public void sendEvidence(Handle target,
                         Identifier subject)
When this is called, some node has asked us for evidence about another node, and we have found either (a) an unanswered challenge, or (b) a proof of misbehavior. We send back an ACCUSATION message that contains the evidence.

Specified by:
sendEvidence in interface EvidenceTransferProtocol<Handle extends RawSerializable,Identifier extends RawSerializable>

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection