|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.tcp.ConnectionTagManager
public class ConnectionTagManager
Organize the tags used to connect with peers.
Field Summary | |
---|---|
protected Log |
_log
|
static int |
MAX_CONNECTION_TAGS
Only keep the keys and tags for up to *cough* 10,000 peers (everyone else will need to use a full DH rekey). |
Constructor Summary | |
---|---|
ConnectionTagManager(RouterContext context)
|
Method Summary | |
---|---|
protected RouterContext |
getContext()
|
SessionKey |
getKey(ByteArray tag)
|
SessionKey |
getKey(Hash peer)
|
ByteArray |
getTag(Hash peer)
Retrieve the associated tag (but do not consume it) |
protected void |
initialize()
|
protected void |
initializeData(java.util.Map keyByPeer,
java.util.Map tagByPeer,
java.util.Map peerByTag)
|
void |
replaceTag(Hash peer,
ByteArray newTag,
SessionKey key)
Update the tag associated with a peer, dropping the old one |
protected void |
saveTags(java.util.Map keyByPeer,
java.util.Map tagByPeer)
Save the tags/keys associated with the peer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Log _log
public static final int MAX_CONNECTION_TAGS
Constructor Detail |
---|
public ConnectionTagManager(RouterContext context)
Method Detail |
---|
protected void initialize()
protected void initializeData(java.util.Map keyByPeer, java.util.Map tagByPeer, java.util.Map peerByTag)
public ByteArray getTag(Hash peer)
public SessionKey getKey(Hash peer)
public SessionKey getKey(ByteArray tag)
public void replaceTag(Hash peer, ByteArray newTag, SessionKey key)
protected void saveTags(java.util.Map keyByPeer, java.util.Map tagByPeer)
keyByPeer
- H(routerIdentity) to SessionKeytagByPeer
- H(routerIdentity) to ByteArrayprotected RouterContext getContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |