net.i2p.router.networkdb.kademlia
Class TransientDataStore

java.lang.Object
  extended by net.i2p.router.networkdb.kademlia.TransientDataStore
All Implemented Interfaces:
DataStore
Direct Known Subclasses:
PersistentDataStore

 class TransientDataStore
extends Object
implements DataStore


Field Summary
protected  RouterContext _context
           
 
Constructor Summary
TransientDataStore(RouterContext ctx)
           
 
Method Summary
 int countLeaseSets()
           
 DatabaseEntry get(Hash key)
           
 DatabaseEntry get(Hash key, boolean persist)
          for PersistentDataStore only - don't use here @throws IAE always
 Collection<DatabaseEntry> getEntries()
           
 Set<Hash> getKeys()
           
 Set<Map.Entry<Hash,DatabaseEntry>> getMapEntries()
           
 boolean isInitialized()
           
 boolean isKnown(Hash key)
           
 boolean put(Hash key, DatabaseEntry data)
           
 boolean put(Hash key, DatabaseEntry data, boolean persist)
          for PersistentDataStore only - don't use here @throws IAE always
 DatabaseEntry remove(Hash key)
           
 DatabaseEntry remove(Hash key, boolean persist)
          for PersistentDataStore only - don't use here
 void rescan()
           
 void restart()
           
 int size()
           
 void stop()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_context

protected RouterContext _context
Constructor Detail

TransientDataStore

public TransientDataStore(RouterContext ctx)
Method Detail

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface DataStore

stop

public void stop()
Specified by:
stop in interface DataStore

restart

public void restart()
Specified by:
restart in interface DataStore

rescan

public void rescan()
Specified by:
rescan in interface DataStore

size

public int size()
Specified by:
size in interface DataStore
Returns:
total size (RI and LS)
Since:
0.8.8

getKeys

public Set<Hash> getKeys()
Specified by:
getKeys in interface DataStore
Returns:
Unmodifiable view, not a copy

getEntries

public Collection<DatabaseEntry> getEntries()
Specified by:
getEntries in interface DataStore
Returns:
Unmodifiable view, not a copy
Since:
0.8.3

getMapEntries

public Set<Map.Entry<Hash,DatabaseEntry>> getMapEntries()
Specified by:
getMapEntries in interface DataStore
Returns:
Unmodifiable view, not a copy
Since:
0.8.3

get

public DatabaseEntry get(Hash key,
                         boolean persist)
for PersistentDataStore only - don't use here @throws IAE always

Specified by:
get in interface DataStore

get

public DatabaseEntry get(Hash key)
Specified by:
get in interface DataStore

isKnown

public boolean isKnown(Hash key)
Specified by:
isKnown in interface DataStore

countLeaseSets

public int countLeaseSets()
Specified by:
countLeaseSets in interface DataStore

put

public boolean put(Hash key,
                   DatabaseEntry data,
                   boolean persist)
for PersistentDataStore only - don't use here @throws IAE always

Specified by:
put in interface DataStore

put

public boolean put(Hash key,
                   DatabaseEntry data)
Specified by:
put in interface DataStore
Parameters:
data - must be validated before here
Returns:
success

toString

public String toString()
Overrides:
toString in class Object

remove

public DatabaseEntry remove(Hash key,
                            boolean persist)
for PersistentDataStore only - don't use here

Specified by:
remove in interface DataStore

remove

public DatabaseEntry remove(Hash key)
Specified by:
remove in interface DataStore