Class TransientDataStore
- java.lang.Object
-
- net.i2p.router.networkdb.kademlia.TransientDataStore
-
- All Implemented Interfaces:
DataStore
- Direct Known Subclasses:
PersistentDataStore
class TransientDataStore extends Object implements DataStore
Stores in-memory only. See extension.
-
-
Field Summary
Fields Modifier and Type Field Description protected RouterContext_contextprotected Log_log
-
Constructor Summary
Constructors Constructor Description TransientDataStore(RouterContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountLeaseSets()DatabaseEntryget(Hash key)DatabaseEntryget(Hash key, boolean persist)for PersistentDataStore only - don't use hereCollection<DatabaseEntry>getEntries()Set<Hash>getKeys()Set<Map.Entry<Hash,DatabaseEntry>>getMapEntries()booleanisInitialized()booleanisKnown(Hash key)booleanput(Hash key, DatabaseEntry data)booleanput(Hash key, DatabaseEntry data, boolean persist)for PersistentDataStore only - don't use hereDatabaseEntryremove(Hash key)DatabaseEntryremove(Hash key, boolean persist)for PersistentDataStore only - don't use herevoidrescan()voidrestart()intsize()voidstop()StringtoString()
-
-
-
Field Detail
-
_log
protected final Log _log
-
_context
protected final RouterContext _context
-
-
Constructor Detail
-
TransientDataStore
public TransientDataStore(RouterContext ctx)
-
-
Method Detail
-
isInitialized
public boolean isInitialized()
- Specified by:
isInitializedin interfaceDataStore
-
size
public int size()
-
getEntries
public Collection<DatabaseEntry> getEntries()
- Specified by:
getEntriesin interfaceDataStore- Returns:
- Unmodifiable view, not a copy
- Since:
- 0.8.3
-
getMapEntries
public Set<Map.Entry<Hash,DatabaseEntry>> getMapEntries()
- Specified by:
getMapEntriesin interfaceDataStore- 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- Specified by:
getin interfaceDataStore- Throws:
UnsupportedOperationException- always
-
get
public DatabaseEntry get(Hash key)
-
countLeaseSets
public int countLeaseSets()
- Specified by:
countLeaseSetsin interfaceDataStore
-
put
public boolean put(Hash key, DatabaseEntry data, boolean persist)
for PersistentDataStore only - don't use here- Specified by:
putin interfaceDataStore- Throws:
UnsupportedOperationException- always
-
put
public boolean put(Hash key, DatabaseEntry data)
-
remove
public DatabaseEntry remove(Hash key, boolean persist)
for PersistentDataStore only - don't use here- Specified by:
removein interfaceDataStore- Throws:
UnsupportedOperationException- always
-
remove
public DatabaseEntry remove(Hash key)
-
-