class ClientManager
extends java.lang.Object
修飾子とタイプ | フィールド | 説明 |
---|---|---|
protected RouterContext |
_ctx |
|
protected boolean |
_isStarted |
|
protected java.util.List<ClientListenerRunner> |
_listeners |
|
protected int |
_port |
|
static SessionId |
UNKNOWN_SESSION_ID |
65535
|
コンストラクタ | 説明 |
---|---|
ClientManager(RouterContext context,
int port) |
Does not start the listeners.
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
int |
destinationEstablished(ClientConnectionRunner runner,
Destination dest) |
Add to the clients list.
|
(package private) void |
distributeMessage(Destination fromDest,
Destination toDest,
Payload payload,
MessageId msgId,
long messageNonce,
long expiration,
int flags) |
Distribute message to a local or remote destination.
|
SessionConfig |
getClientSessionConfig(Destination dest) |
Return the client's current config, or null if not connected
|
SessionKeyManager |
getClientSessionKeyManager(Hash dest) |
Return the client's SessionKeyManager
Use this instead of the RouterContext.sessionKeyManager()
to prevent correlation attacks across destinations
|
(package private) ClientConnectionRunner |
getRunner(Destination dest) |
Unsynchronized
|
(package private) java.util.Set<Destination> |
getRunnerDestinations() |
|
I2CPMessageQueue |
internalConnect() |
The InternalClientManager interface.
|
boolean |
isAlive() |
|
boolean |
isLocal(Destination dest) |
Unsynchronized
|
boolean |
isLocal(Hash destHash) |
Unsynchronized
|
java.util.Set<Destination> |
listClients() |
Unsynchronized
|
void |
messageDeliveryStatusUpdate(Destination fromDest,
MessageId id,
long messageNonce,
int status) |
|
void |
messageReceived(ClientMessage msg) |
|
void |
registerConnection(ClientConnectionRunner runner) |
|
void |
renderStatusHTML(java.io.Writer out) |
推奨されていません。
unused
|
void |
reportAbuse(Destination dest,
java.lang.String reason,
int severity) |
Unused
|
void |
requestLeaseSet(Destination dest,
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(Hash dest,
LeaseSet ls) |
Request that a particular client authorize the Leases contained in the
LeaseSet.
|
void |
restart() |
|
boolean |
shouldPublishLeaseSet(Hash destHash) |
|
void |
shutdown(java.lang.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 |
unregisterSession(SessionId id,
Destination dest) |
Remove only the following session.
|
protected final java.util.List<ClientListenerRunner> _listeners
protected final RouterContext _ctx
protected final int _port
protected volatile boolean _isStarted
public static final SessionId UNKNOWN_SESSION_ID
public ClientManager(RouterContext context, int port)
public void start()
protected void startListeners()
public void restart()
public void shutdown(java.lang.String msg)
msg
- message to send to the clientspublic I2CPMessageQueue internalConnect() throws I2PSessionException
I2PSessionException
- if the router isn't readypublic boolean isAlive()
public void registerConnection(ClientConnectionRunner runner)
public void unregisterConnection(ClientConnectionRunner runner)
public void unregisterSession(SessionId id, Destination dest)
public int destinationEstablished(ClientConnectionRunner runner, Destination dest)
void distributeMessage(Destination fromDest, Destination toDest, Payload payload, 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(Destination dest, 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(Hash dest, 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(Destination dest)
public boolean isLocal(Hash destHash)
public boolean shouldPublishLeaseSet(Hash destHash)
public java.util.Set<Destination> listClients()
ClientConnectionRunner getRunner(Destination dest)
public SessionConfig getClientSessionConfig(Destination dest)
public SessionKeyManager getClientSessionKeyManager(Hash dest)
public void messageDeliveryStatusUpdate(Destination fromDest, MessageId id, long messageNonce, int status)
id
- the router's ID for this messagemessageNonce
- the client's ID for this messagestatus
- see I2CP MessageStatusMessage for success/failure codesjava.util.Set<Destination> getRunnerDestinations()
public void reportAbuse(Destination dest, java.lang.String reason, int severity)
dest
- null for all local destinations@Deprecated public void renderStatusHTML(java.io.Writer out) throws java.io.IOException
java.io.IOException
public void messageReceived(ClientMessage msg)