java.lang.Object
net.i2p.router.ClientManagerFacade
- All Implemented Interfaces:
Service
- Direct Known Subclasses:
ClientManagerFacadeImpl, DummyClientManagerFacade
Field Summary
FieldsConstructor Summary
ConstructorsModifierConstructorDescriptionprotectedPackage-private constructor for abstract class.Method Summary
Modifier and TypeMethodDescriptionabstract FloodfillNetworkDatabaseFacadegetClientFloodfillNetworkDatabaseFacade(Hash destHash) The FloodfillNetworkDatabaseFacade associated with a particular client destination.abstract SessionConfigReturn the client's current config, or null if not connected.abstract SessionKeyManagerThe session key manager for a given client.A set of all primary hashes.booleanisAlive()Check whether this service is alive.abstract booleanisLocal(Destination dest) Determine if the destination specified is managed locally.abstract booleanDetermine if the destination hash specified is managed locally.Return the list of locally connected clients.abstract voidmessageDeliveryStatusUpdate(Destination fromDest, MessageId id, long messageNonce, int status) Update the delivery status of a message.abstract voidReceive a message from the network for a local client.voidregisterMetaDest(Destination dest) Declare that we're going to publish a meta LS for this destination.voidrenderStatusHTML(Writer out) Render the client status HTML.abstract voidreportAbuse(Destination dest, String reason, int severity) Instruct the client (or all clients) that they are under attack.abstract voidrequestLeaseSet(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.abstract voidrequestLeaseSet(Hash dest, LeaseSet set) Request that the client authorize the Leases contained in the LeaseSet, identified by destination hash.booleanshouldPublishLeaseSet(Hash destinationHash) Does the client specified want their leaseSet published?abstract voidShut down the client manager with a reason message.voidDeclare that we're no longer going to publish a meta LS for this destination.booleanVerify that the client manager is still alive and responding.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Details
PROP_CLIENT_ONLY
Property key for client only.- See Also:
Constructor Details
ClientManagerFacade
protected ClientManagerFacade()Package-private constructor for abstract class.
Method Details
requestLeaseSet
public abstract 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. If that doesn't occur within the timeout specified, queue up the onFailedJob. This call does not block.- Parameters:
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)timeout- ms to wait before failingonCreateJob- Job to run after the LeaseSet is authorizedonFailedJob- Job to run after the timeout passes without receiving authorization
requestLeaseSet
reportAbuse
Instruct the client (or all clients) that they are under attack. This call does not block.- Parameters:
dest- Destination under attack, or null if all destinations are affectedreason- Why the router thinks that there is abusive behaviorseverity- How severe the abuse is, with 0 being not severe and 255 is the max
isLocal
Determine if the destination specified is managed locally. This call DOES block.- Parameters:
dest- Destination to be checked- Returns:
- true if the destination is local
isLocal
Determine if the destination hash specified is managed locally. This call DOES block.- Parameters:
destHash- Hash of Destination to be checked- Returns:
- true if the destination hash is local
messageDeliveryStatusUpdate
public abstract void messageDeliveryStatusUpdate(Destination fromDest, MessageId id, long messageNonce, int status) Update the delivery status of a message.- Parameters:
fromDest- the source destination of the messageid- the router's ID for this messagemessageNonce- the client's ID for this messagestatus- see I2CP MessageStatusMessage for success/failure codes
messageReceived
Receive a message from the network for a local client.- Parameters:
msg- the received client message
verifyClientLiveliness
public boolean verifyClientLiveliness()Verify that the client manager is still alive and responding.- Returns:
- true if the client manager is alive
isAlive
public boolean isAlive()Check whether this service is alive.- Returns:
- true if alive
shouldPublishLeaseSet
Does the client specified want their leaseSet published?- Parameters:
destinationHash- the destination hash to check- Returns:
- true if the leaseSet should be published
listClients
Return the list of locally connected clients.- Returns:
- set of Destination objects
getClientSessionConfig
Return the client's current config, or null if not connected.- Parameters:
dest- the client destination- Returns:
- the client session config, or null
getClientSessionKeyManager
The session key manager for a given client.- Parameters:
dest- the destination hash- Returns:
- the session key manager
renderStatusHTML
Render the client status HTML.- Specified by:
renderStatusHTMLin interfaceService- Parameters:
out- the writer to write to- Throws:
IOException- if an error occurs writing
shutdown
Shut down the client manager with a reason message.- Parameters:
msg- the shutdown reason
registerMetaDest
Declare that we're going to publish a meta LS for this destination. Must be called before publishing the leaseset.- Parameters:
dest- the destination to register- Throws:
I2PSessionException- on duplicate dest
unregisterMetaDest
Declare that we're no longer going to publish a meta LS for this destination.- Parameters:
dest- the destination to unregister
getClientFloodfillNetworkDatabaseFacade
public abstract FloodfillNetworkDatabaseFacade getClientFloodfillNetworkDatabaseFacade(Hash destHash) The FloodfillNetworkDatabaseFacade associated with a particular client destination. This is inside the runner, so it won't be there if the runner isn't ready.- Parameters:
destHash- destination hash associated with the client who's subDb we're looking for- Returns:
- non-null FloodfillNetworkDatabaseFacade
getPrimaryHashes