org.mpisws.p2p.transport.peerreview.infostore
Class PeerInfoStoreImpl<Handle,Identifier>
java.lang.Object
org.mpisws.p2p.transport.peerreview.infostore.PeerInfoStoreImpl<Handle,Identifier>
- All Implemented Interfaces:
- PeerInfoStore<Handle,Identifier>, PeerReviewConstants
public class PeerInfoStoreImpl<Handle,Identifier>
- extends java.lang.Object
- implements PeerInfoStore<Handle,Identifier>
In this class, the PeerReview library keeps information about its peers.
Specifically, it stores the last checked authenticator plus any challenges,
responses or proofs that are known about the peer.
Fields inherited from interface org.mpisws.p2p.transport.peerreview.PeerReviewConstants |
CHAL_AUDIT, CHAL_SEND, DEFAULT_AUTH_PUSH_INTERVAL_MICROS, DEFAULT_CHECKPOINT_INTERVAL_MICROS, DEFAULT_TIME_TOLERANCE_MICROS, EVT_ACK, EVT_CHECKPOINT, EVT_INIT, 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, EX_TYPE_ClosedChannel, EX_TYPE_IO, EX_TYPE_Unknown, MAINTENANCE_INTERVAL_MICROS, MAX_STATUS_INFO, MSG_ACCUSATION, MSG_ACK, MSG_AUTHPUSH, MSG_AUTHREQ, MSG_AUTHRESP, MSG_CHALLENGE, MSG_RESPONSE, MSG_USERDATA, MSG_USERDGRAM, PROOF_INCONSISTENT, PROOF_NONCONFORMANT, STATUS_EXPOSED, STATUS_SUSPECTED, STATUS_TRUSTED, TI_AUTH_PUSH, TI_CHECKPOINT, TI_MAINTENANCE, TI_MAX_RESERVED, TI_STATUS_INFO |
Method Summary |
void |
addEvidence(Identifier originator,
Identifier subject,
long timestamp,
Evidence evidence,
Handle interestedParty)
|
PeerInfoRecord<Handle,Identifier> |
find(Identifier id)
|
PeerInfoRecord<Handle,Identifier> |
find(Identifier id,
boolean create)
|
EvidenceRecord<Handle,Identifier> |
findEvidence(Identifier originator,
Identifier subject,
long timestamp)
|
EvidenceRecord<Handle,Identifier> |
findEvidence(Identifier originator,
Identifier subject,
long timestamp,
boolean create)
|
Evidence |
getEvidence(Identifier originator,
Identifier subject,
long timestamp)
Get the actual bytes of a piece of evidence |
protected java.io.File |
getFile(Identifier subject,
Identifier originator,
long timestamp,
java.lang.String suffix)
|
java.lang.String |
getHistoryName(Identifier subject)
|
int |
getStatus(Identifier id)
|
static boolean |
isProof(Evidence e)
|
void |
markEvidenceAvailable(Identifier originator,
Identifier subject,
long timestamp,
boolean isProof,
Handle interestedParty)
This is called when new evidence becomes available, or (during startup) for
all evidence files on disk. |
void |
markResponseAvailable(Identifier originator,
Identifier subject,
long timestamp)
This is called when another node answers one of our challenges. |
void |
notifyStatusChanged(Identifier subject,
int newStatus)
|
void |
setStatusChangeListener(StatusChangeListener<Identifier> listener)
|
boolean |
setStorageDirectory(java.io.File directory)
|
EvidenceRecord<Handle,Identifier> |
statProof(Identifier subject)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
environment
protected Environment environment
logger
protected Logger logger
PeerInfoStoreImpl
public PeerInfoStoreImpl(IdentityTransport<Handle,Identifier> transport,
IdStrTranslator<Identifier> stringTranslator,
AuthenticatorSerializer authSerializer,
EvidenceSerializer evidenceSerializer,
Environment env)
isProof
public static boolean isProof(Evidence e)
setStatusChangeListener
public void setStatusChangeListener(StatusChangeListener<Identifier> listener)
- Specified by:
setStatusChangeListener
in interface PeerInfoStore<Handle,Identifier>
findEvidence
public EvidenceRecord<Handle,Identifier> findEvidence(Identifier originator,
Identifier subject,
long timestamp)
findEvidence
public EvidenceRecord<Handle,Identifier> findEvidence(Identifier originator,
Identifier subject,
long timestamp,
boolean create)
markEvidenceAvailable
public void markEvidenceAvailable(Identifier originator,
Identifier subject,
long timestamp,
boolean isProof,
Handle interestedParty)
- This is called when new evidence becomes available, or (during startup) for
all evidence files on disk. We only keep some metadata in memory; the
actual evidence is stored in a separate file on disk.
markResponseAvailable
public void markResponseAvailable(Identifier originator,
Identifier subject,
long timestamp)
- This is called when another node answers one of our challenges. Again, we
only update the metadata in memory; the actual response is kept in a file
on disk.
addEvidence
public void addEvidence(Identifier originator,
Identifier subject,
long timestamp,
Evidence evidence,
Handle interestedParty)
throws java.io.IOException
- Specified by:
addEvidence
in interface PeerInfoStore<Handle,Identifier>
- Throws:
java.io.IOException
getFile
protected java.io.File getFile(Identifier subject,
Identifier originator,
long timestamp,
java.lang.String suffix)
getStatus
public int getStatus(Identifier id)
- Specified by:
getStatus
in interface PeerInfoStore<Handle,Identifier>
setStorageDirectory
public boolean setStorageDirectory(java.io.File directory)
throws java.io.IOException
- Specified by:
setStorageDirectory
in interface PeerInfoStore<Handle,Identifier>
- Throws:
java.io.IOException
find
public PeerInfoRecord<Handle,Identifier> find(Identifier id)
find
public PeerInfoRecord<Handle,Identifier> find(Identifier id,
boolean create)
getEvidence
public Evidence getEvidence(Identifier originator,
Identifier subject,
long timestamp)
throws java.io.IOException
- Get the actual bytes of a piece of evidence
- Throws:
java.io.IOException
getHistoryName
public java.lang.String getHistoryName(Identifier subject)
notifyStatusChanged
public void notifyStatusChanged(Identifier subject,
int newStatus)
- Specified by:
notifyStatusChanged
in interface PeerInfoStore<Handle,Identifier>
statProof
public EvidenceRecord<Handle,Identifier> statProof(Identifier subject)
Copyright © 2001-2005 - Rice Pastry.