public class SSKStore extends StoreCallback<SSKBlock>
store
Modifier and Type | Method and Description |
---|---|
boolean |
collisionPossible()
Can the same key be valid for two different StorableBlocks?
|
SSKBlock |
construct(byte[] data,
byte[] headers,
byte[] routingKey,
byte[] fullKey,
boolean canReadClientCache,
boolean canReadSlashdotCache,
BlockMetadata meta,
DSAPublicKey knownPublicKey)
Construct a StorableBlock from the data, headers, and optionally routing key or full key.
|
boolean |
constructNeedsKey()
Whether we need the key in order to reconstruct a block.
|
int |
dataLength()
Length of a data block.
|
SSKBlock |
fetch(NodeSSK chk,
boolean dontPromote,
boolean canReadClientCache,
boolean canReadSlashdotCache,
boolean ignoreOldBlocks,
BlockMetadata meta) |
int |
fullKeyLength()
Length of a full key.
|
int |
headerLength()
Length of a header block.
|
void |
put(SSKBlock b,
boolean overwrite,
boolean isOldBlock) |
byte[] |
routingKeyFromFullKey(byte[] keyBuf)
Generate a routing key from a full key
|
int |
routingKeyLength()
Length of a routing key.
|
boolean |
storeFullKeys()
Whether we should create a .keys file to keep full keys in in order to reconstruct.
|
getBloomFalsePositive, getMaxKeys, getSessionAccessStats, getStore, getTotalAccessStats, getTotalBlockSize, hits, keyCount, misses, setMaxKeys, setStore, writes
public SSKStore(GetPubkey pubkeyCache)
public SSKBlock construct(byte[] data, byte[] headers, byte[] routingKey, byte[] fullKey, boolean canReadClientCache, boolean canReadSlashdotCache, BlockMetadata meta, DSAPublicKey knownPublicKey) throws SSKVerifyException
StoreCallback
construct
in class StoreCallback<SSKBlock>
SSKVerifyException
public SSKBlock fetch(NodeSSK chk, boolean dontPromote, boolean canReadClientCache, boolean canReadSlashdotCache, boolean ignoreOldBlocks, BlockMetadata meta) throws java.io.IOException
java.io.IOException
public void put(SSKBlock b, boolean overwrite, boolean isOldBlock) throws java.io.IOException, KeyCollisionException
java.io.IOException
KeyCollisionException
public int dataLength()
StoreCallback
dataLength
in class StoreCallback<SSKBlock>
public int fullKeyLength()
StoreCallback
fullKeyLength
in class StoreCallback<SSKBlock>
public int headerLength()
StoreCallback
headerLength
in class StoreCallback<SSKBlock>
public int routingKeyLength()
StoreCallback
routingKeyLength
in class StoreCallback<SSKBlock>
public boolean storeFullKeys()
StoreCallback
storeFullKeys
in class StoreCallback<SSKBlock>
public boolean collisionPossible()
StoreCallback
collisionPossible
in class StoreCallback<SSKBlock>
public boolean constructNeedsKey()
StoreCallback
constructNeedsKey
in class StoreCallback<SSKBlock>
public byte[] routingKeyFromFullKey(byte[] keyBuf)
StoreCallback
routingKeyFromFullKey
in class StoreCallback<SSKBlock>