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
_context
protected Log
_log
-
Constructor Summary
Constructors Constructor Description TransientDataStore(RouterContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countLeaseSets()
boolean
forcePut(Hash key, DatabaseEntry data)
DatabaseEntry
get(Hash key)
DatabaseEntry
get(Hash key, boolean persist)
for PersistentDataStore only - don't use hereCollection<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 hereDatabaseEntry
remove(Hash key)
DatabaseEntry
remove(Hash key, boolean persist)
for PersistentDataStore only - don't use herevoid
rescan()
int
size()
void
stop()
String
toString()
-
-
-
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:
isInitialized
in interfaceDataStore
-
size
public int size()
-
getEntries
public Collection<DatabaseEntry> getEntries()
- Specified by:
getEntries
in interfaceDataStore
- Returns:
- Unmodifiable view, not a copy
- Since:
- 0.8.3
-
getMapEntries
public Set<Map.Entry<Hash,DatabaseEntry>> getMapEntries()
- Specified by:
getMapEntries
in 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:
get
in interfaceDataStore
- Throws:
UnsupportedOperationException
- always
-
get
public DatabaseEntry get(Hash key)
-
countLeaseSets
public int countLeaseSets()
- Specified by:
countLeaseSets
in interfaceDataStore
-
put
public boolean put(Hash key, DatabaseEntry data, boolean persist)
for PersistentDataStore only - don't use here- Specified by:
put
in interfaceDataStore
- Throws:
UnsupportedOperationException
- always
-
put
public boolean put(Hash key, DatabaseEntry data)
-
forcePut
public boolean forcePut(Hash key, DatabaseEntry data)
-
remove
public DatabaseEntry remove(Hash key, boolean persist)
for PersistentDataStore only - don't use here- Specified by:
remove
in interfaceDataStore
- Throws:
UnsupportedOperationException
- always
-
remove
public DatabaseEntry remove(Hash key)
-
-