net.i2p.router.networkdb.kademlia
Class StoreState

java.lang.Object
  extended by net.i2p.router.networkdb.kademlia.StoreState

 class StoreState
extends java.lang.Object


Constructor Summary
StoreState(RouterContext ctx, Hash key, DataStructure data)
           
StoreState(RouterContext ctx, Hash key, DataStructure data, java.util.Set<Hash> toSkip)
           
 
Method Summary
 void addPending(java.util.Collection<Hash> pending)
           
 void addPending(Hash peer)
           
 void addPending(Hash peer, MessageWrapper.WrappedMessage msg)
           
 void addSkipped(Hash peer)
          we aren't even going to try to contact this peer
 void complete(boolean completed)
           
 boolean completed()
           
 long confirmed(Hash peer)
           
 java.util.Set<Hash> getAttempted()
           
 int getCompleteCount()
           
 DataStructure getData()
           
 java.util.Set<Hash> getFailed()
          public Set getSuccessfulExploratory() { synchronized (_successfulExploratoryPeers) { return (Set)_successfulExploratoryPeers.clone(); } }
 java.util.Set<Hash> getPending()
           
 MessageWrapper.WrappedMessage getPendingMessage(Hash peer)
           
 java.util.Set<Hash> getSuccessful()
           
 Hash getTarget()
           
 long getWhenCompleted()
           
 long getWhenStarted()
           
 void replyTimeout(Hash peer)
          public long confirmedExploratory(Hash peer) { long rv = -1; synchronized (_pendingPeers) { _pendingPeers.remove(peer); Long when = _pendingPeerTimes.remove(peer); if (when !
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StoreState

public StoreState(RouterContext ctx,
                  Hash key,
                  DataStructure data)

StoreState

public StoreState(RouterContext ctx,
                  Hash key,
                  DataStructure data,
                  java.util.Set<Hash> toSkip)
Method Detail

getTarget

public Hash getTarget()

getData

public DataStructure getData()

getPending

public java.util.Set<Hash> getPending()

getAttempted

public java.util.Set<Hash> getAttempted()

getSuccessful

public java.util.Set<Hash> getSuccessful()

getFailed

public java.util.Set<Hash> getFailed()
public Set getSuccessfulExploratory() { synchronized (_successfulExploratoryPeers) { return (Set)_successfulExploratoryPeers.clone(); } }


completed

public boolean completed()

complete

public void complete(boolean completed)

getCompleteCount

public int getCompleteCount()

getWhenStarted

public long getWhenStarted()

getWhenCompleted

public long getWhenCompleted()

addPending

public void addPending(Hash peer,
                       MessageWrapper.WrappedMessage msg)

getPendingMessage

public MessageWrapper.WrappedMessage getPendingMessage(Hash peer)

addPending

public void addPending(Hash peer)

addPending

public void addPending(java.util.Collection<Hash> pending)

addSkipped

public void addSkipped(Hash peer)
we aren't even going to try to contact this peer


confirmed

public long confirmed(Hash peer)

replyTimeout

public void replyTimeout(Hash peer)
public long confirmedExploratory(Hash peer) { long rv = -1; synchronized (_pendingPeers) { _pendingPeers.remove(peer); Long when = _pendingPeerTimes.remove(peer); if (when != null) rv = _context.clock().now() - when.longValue(); } synchronized (_successfulExploratoryPeers) { _successfulExploratoryPeers.add(peer); } return rv; }


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object