class ClientManager extends Object
| Modifier and Type | Field and Description |
|---|---|
protected RouterContext |
_ctx |
protected boolean |
_isStarted |
protected List<ClientListenerRunner> |
_listeners |
protected int |
_port |
protected boolean |
_wasStarted |
static net.i2p.data.i2cp.SessionId |
UNKNOWN_SESSION_ID
65535
|
| Constructor and Description |
|---|
ClientManager(RouterContext context,
int port)
Does not start the listeners.
|
| Modifier and Type | Method and Description |
|---|---|
int |
destinationEstablished(ClientConnectionRunner runner,
net.i2p.data.Destination dest)
Add to the clients list.
|
(package private) void |
distributeMessage(net.i2p.data.Destination fromDest,
net.i2p.data.Destination toDest,
net.i2p.data.Payload payload,
net.i2p.data.i2cp.MessageId msgId,
long messageNonce,
long expiration,
int flags)
Distribute message to a local or remote destination.
|
net.i2p.data.i2cp.SessionConfig |
getClientSessionConfig(net.i2p.data.Destination dest)
Return the client's current config, or null if not connected
|
net.i2p.crypto.SessionKeyManager |
getClientSessionKeyManager(net.i2p.data.Hash dest)
Return the client's SessionKeyManager
Use this instead of the RouterContext.sessionKeyManager()
to prevent correlation attacks across destinations
|
(package private) ClientConnectionRunner |
getRunner(net.i2p.data.Destination dest)
Unsynchronized
|
(package private) Set<net.i2p.data.Destination> |
getRunnerDestinations() |
net.i2p.internal.I2CPMessageQueue |
internalConnect()
The InternalClientManager interface.
|
boolean |
isAlive()
As of 0.9.45, this returns true iff the ClientManager is running.
|
boolean |
isLocal(net.i2p.data.Destination dest)
Unsynchronized.
|
boolean |
isLocal(net.i2p.data.Hash destHash)
Unsynchronized.
|
Set<net.i2p.data.Destination> |
listClients()
Unsynchronized.
|
void |
messageDeliveryStatusUpdate(net.i2p.data.Destination fromDest,
net.i2p.data.i2cp.MessageId id,
long messageNonce,
int status) |
void |
messageReceived(ClientMessage msg) |
void |
registerConnection(ClientConnectionRunner runner) |
boolean |
registerEncryptedDestination(ClientConnectionRunner runner,
net.i2p.data.Hash hash)
Call after destinationEstablished(),
when an encrypted leaseset is created, so we know it's local.
|
void |
registerMetaDest(net.i2p.data.Destination dest)
Declare that we're going to publish a meta LS for this destination.
|
void |
renderStatusHTML(Writer out)
Deprecated.
unused
|
void |
reportAbuse(net.i2p.data.Destination dest,
String reason,
int severity)
Unused
|
void |
requestLeaseSet(net.i2p.data.Destination dest,
net.i2p.data.LeaseSet set,
long timeout,
Job onCreateJob,
Job onFailedJob)
Request that a particular client authorize the Leases contained in the
LeaseSet, after which the onCreateJob is queued up.
|
void |
requestLeaseSet(net.i2p.data.Hash dest,
net.i2p.data.LeaseSet ls)
Request that a particular client authorize the Leases contained in the
LeaseSet.
|
void |
restart() |
boolean |
shouldPublishLeaseSet(net.i2p.data.Hash destHash) |
void |
shutdown(String msg) |
void |
start() |
protected void |
startListeners()
Call from synchronized method
Todo: Start a 3rd listener for IPV6?
|
void |
unregisterConnection(ClientConnectionRunner runner)
Remove all sessions for this runner.
|
void |
unregisterEncryptedDestination(ClientConnectionRunner runner,
net.i2p.data.Hash hash)
Remove the hash for the encrypted LS.
|
void |
unregisterMetaDest(net.i2p.data.Destination dest)
Declare that we're no longer going to publish a meta LS for this destination.
|
void |
unregisterSession(net.i2p.data.i2cp.SessionId id,
net.i2p.data.Destination dest)
Remove only the following session.
|
protected final List<ClientListenerRunner> _listeners
protected final RouterContext _ctx
protected final int _port
protected volatile boolean _isStarted
protected volatile boolean _wasStarted
public static final net.i2p.data.i2cp.SessionId UNKNOWN_SESSION_ID
public ClientManager(RouterContext context, int port)
public void start()
protected void startListeners()
public void restart()
public void shutdown(String msg)
msg - message to send to the clientspublic net.i2p.internal.I2CPMessageQueue internalConnect()
throws net.i2p.client.I2PSessionException
net.i2p.client.I2PSessionException - if the router isn't readypublic boolean isAlive()
public void registerConnection(ClientConnectionRunner runner)
public void unregisterConnection(ClientConnectionRunner runner)
public void unregisterSession(net.i2p.data.i2cp.SessionId id,
net.i2p.data.Destination dest)
public void unregisterEncryptedDestination(ClientConnectionRunner runner, net.i2p.data.Hash hash)
public int destinationEstablished(ClientConnectionRunner runner, net.i2p.data.Destination dest)
public boolean registerEncryptedDestination(ClientConnectionRunner runner, net.i2p.data.Hash hash)
hash - the location of the encrypted LS, will change every daypublic void registerMetaDest(net.i2p.data.Destination dest)
throws net.i2p.client.I2PSessionException
net.i2p.client.I2PSessionException - on duplicate destpublic void unregisterMetaDest(net.i2p.data.Destination dest)
void distributeMessage(net.i2p.data.Destination fromDest,
net.i2p.data.Destination toDest,
net.i2p.data.Payload payload,
net.i2p.data.i2cp.MessageId msgId,
long messageNonce,
long expiration,
int flags)
msgId - the router's ID for this messagemessageNonce - the client's ID for this messageflags - ignored for localpublic void requestLeaseSet(net.i2p.data.Destination dest,
net.i2p.data.LeaseSet set,
long timeout,
Job onCreateJob,
Job onFailedJob)
dest - Destination from which the LeaseSet's authorization should be requestedset - LeaseSet with requested leases - this object must be updated to contain the
signed version (as well as any changed/added/removed Leases).
The LeaseSet contains Leases only; it is unsigned and does not have the destination set.timeout - ms to wait before failingonCreateJob - Job to run after the LeaseSet is authorizedonFailedJob - Job to run after the timeout passes without receiving authorizationpublic void requestLeaseSet(net.i2p.data.Hash dest,
net.i2p.data.LeaseSet ls)
dest - Destination from which the LeaseSet's authorization should be requestedls - LeaseSet with requested leases - this object must be updated to contain the
signed version (as well as any changed/added/removed Leases).
The LeaseSet contains Leases only; it is unsigned and does not have the destination set.public boolean isLocal(net.i2p.data.Destination dest)
public boolean isLocal(net.i2p.data.Hash destHash)
public boolean shouldPublishLeaseSet(net.i2p.data.Hash destHash)
public Set<net.i2p.data.Destination> listClients()
ClientConnectionRunner getRunner(net.i2p.data.Destination dest)
public net.i2p.data.i2cp.SessionConfig getClientSessionConfig(net.i2p.data.Destination dest)
public net.i2p.crypto.SessionKeyManager getClientSessionKeyManager(net.i2p.data.Hash dest)
public void messageDeliveryStatusUpdate(net.i2p.data.Destination fromDest,
net.i2p.data.i2cp.MessageId id,
long messageNonce,
int status)
id - the router's ID for this messagemessageNonce - the client's ID for this message, greater than zerostatus - see I2CP MessageStatusMessage for success/failure codesSet<net.i2p.data.Destination> getRunnerDestinations()
public void reportAbuse(net.i2p.data.Destination dest,
String reason,
int severity)
dest - null for all local destinations@Deprecated public void renderStatusHTML(Writer out) throws IOException
IOExceptionpublic void messageReceived(ClientMessage msg)