|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mpisws.p2p.transport.peerreview.infostore.PeerInfoStoreImpl<Handle,Identifier>
public class PeerInfoStoreImpl<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.
Field Summary | |
---|---|
protected Environment |
environment
|
protected Logger |
logger
|
Fields inherited from interface org.mpisws.p2p.transport.peerreview.StatusConstants |
---|
STATUS_EXPOSED, STATUS_SUSPECTED, STATUS_TRUSTED |
Constructor Summary | |
---|---|
PeerInfoStoreImpl(IdentityTransport<Handle,Identifier> transport,
IdStrTranslator<Identifier> stringTranslator,
AuthenticatorSerializer authSerializer,
EvidenceSerializer evidenceSerializer,
Environment env)
|
Method Summary | |
---|---|
void |
addEvidence(Identifier originator,
Identifier subject,
long timestamp,
Evidence evidence)
|
void |
addEvidence(Identifier originator,
Identifier subject,
long timestamp,
Evidence evidence,
Handle interestedParty)
|
void |
addResponse(Identifier originator,
Identifier subject,
long timestamp,
Evidence response)
Record a response to a challenge |
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)
|
Authenticator |
getLastCheckedAuth(Identifier id)
|
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 |
setLastCheckedAuth(Identifier id,
Authenticator auth)
|
void |
setStatusChangeListener(StatusChangeListener<Identifier> listener)
|
boolean |
setStorageDirectory(java.io.File directory)
|
EvidenceRecord<Handle,Identifier> |
statFirstUnansweredChallenge(Identifier subject)
Look up the first unanswered challenge to a given node |
EvidenceRecord<Handle,Identifier> |
statProof(Identifier subject)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Environment environment
protected Logger logger
Constructor Detail |
---|
public PeerInfoStoreImpl(IdentityTransport<Handle,Identifier> transport, IdStrTranslator<Identifier> stringTranslator, AuthenticatorSerializer authSerializer, EvidenceSerializer evidenceSerializer, Environment env)
Method Detail |
---|
public static boolean isProof(Evidence e)
public void setStatusChangeListener(StatusChangeListener<Identifier> listener)
setStatusChangeListener
in interface PeerInfoStore<Handle,Identifier>
public EvidenceRecord<Handle,Identifier> findEvidence(Identifier originator, Identifier subject, long timestamp)
findEvidence
in interface PeerInfoStore<Handle,Identifier>
public EvidenceRecord<Handle,Identifier> findEvidence(Identifier originator, Identifier subject, long timestamp, boolean create)
findEvidence
in interface PeerInfoStore<Handle,Identifier>
public void markEvidenceAvailable(Identifier originator, Identifier subject, long timestamp, boolean isProof, Handle interestedParty)
public void markResponseAvailable(Identifier originator, Identifier subject, long timestamp)
public void addEvidence(Identifier originator, Identifier subject, long timestamp, Evidence evidence) throws java.io.IOException
addEvidence
in interface PeerInfoStore<Handle,Identifier>
java.io.IOException
public void addEvidence(Identifier originator, Identifier subject, long timestamp, Evidence evidence, Handle interestedParty) throws java.io.IOException
addEvidence
in interface PeerInfoStore<Handle,Identifier>
java.io.IOException
protected java.io.File getFile(Identifier subject, Identifier originator, long timestamp, java.lang.String suffix)
public int getStatus(Identifier id)
getStatus
in interface PeerInfoStore<Handle,Identifier>
public boolean setStorageDirectory(java.io.File directory) throws java.io.IOException
setStorageDirectory
in interface PeerInfoStore<Handle,Identifier>
java.io.IOException
public PeerInfoRecord<Handle,Identifier> find(Identifier id)
public PeerInfoRecord<Handle,Identifier> find(Identifier id, boolean create)
public Authenticator getLastCheckedAuth(Identifier id)
getLastCheckedAuth
in interface PeerInfoStore<Handle,Identifier>
public void setLastCheckedAuth(Identifier id, Authenticator auth)
setLastCheckedAuth
in interface PeerInfoStore<Handle,Identifier>
public Evidence getEvidence(Identifier originator, Identifier subject, long timestamp) throws java.io.IOException
getEvidence
in interface PeerInfoStore<Handle,Identifier>
java.io.IOException
public void addResponse(Identifier originator, Identifier subject, long timestamp, Evidence response) throws java.io.IOException
addResponse
in interface PeerInfoStore<Handle,Identifier>
java.io.IOException
public java.lang.String getHistoryName(Identifier subject)
getHistoryName
in interface PeerInfoStore<Handle,Identifier>
public void notifyStatusChanged(Identifier subject, int newStatus)
notifyStatusChanged
in interface PeerInfoStore<Handle,Identifier>
public EvidenceRecord<Handle,Identifier> statFirstUnansweredChallenge(Identifier subject)
statFirstUnansweredChallenge
in interface PeerInfoStore<Handle,Identifier>
public EvidenceRecord<Handle,Identifier> statProof(Identifier subject)
statProof
in interface PeerInfoStore<Handle,Identifier>
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |