Package net.i2p.router.client
Class ClientManagerFacadeImpl
java.lang.Object
net.i2p.router.ClientManagerFacade
net.i2p.router.client.ClientManagerFacadeImpl
- All Implemented Interfaces:
InternalClientManager,Service
Base impl of the client facade
- Author:
- jrandom
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final Stringnote that this is different than the property the client side uses, i2cp.tcp.hoststatic final Stringnote that this is different than the property the client side uses, i2cp.tcp.portFields inherited from class net.i2p.router.ClientManagerFacade
PROP_CLIENT_ONLY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect()The InternalClientManager interface.getClientFloodfillNetworkDatabaseFacade(Hash destHash) get the FloodfillNetworkDatabaseFacade associated with a particular client destination.Return the client's current config, or null if not connectedReturn the client's current manager or null if not connectedget all the primary hashes for all the clients and return them as a setbooleanisAlive()booleanisLocal(Destination dest) Determine if the destination specified is managed locally.booleanDetermine if the destination specified is managed locally.Return the list of locally connected clientsvoidmessageDeliveryStatusUpdate(Destination fromDest, MessageId id, long messageNonce, int status) voidvoidregisterMetaDest(Destination dest) Declare that we're going to publish a meta LS for this destination.voidrenderStatusHTML(Writer out) Deprecated.unusedvoidreportAbuse(Destination dest, String reason, int severity) Instruct the client (or all clients) that they are under attack.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.voidrequestLeaseSet(Hash dest, LeaseSet set) Request that a particular client authorize the Leases contained in the LeaseSet.voidrestart()Perform a soft restart.booleanshouldPublishLeaseSet(Hash destinationHash) Does the client specified want their leaseSet published?voidshutdown()Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully.voidvoidstartup()Instruct the service that it should start normal operation.voidDeclare that we're no longer going to publish a meta LS for this destination.boolean
-
Field Details
-
PROP_CLIENT_PORT
note that this is different than the property the client side uses, i2cp.tcp.port- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
PROP_CLIENT_HOST
note that this is different than the property the client side uses, i2cp.tcp.host- See Also:
-
DEFAULT_HOST
- See Also:
-
-
Constructor Details
-
ClientManagerFacadeImpl
-
-
Method Details
-
startup
public void startup()Description copied from interface:ServiceInstruct the service that it should start normal operation. This call DOES block until the service is ready. -
shutdown
public void shutdown()Description copied from interface:ServiceInstruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully. It should not depend on other components at this point. This call DOES block. -
shutdown
- Specified by:
shutdownin classClientManagerFacade- Parameters:
msg- message to send to the clients- Since:
- 0.8.8
-
restart
public void restart()Description copied from interface:ServicePerform a soft restart. -
isAlive
public boolean isAlive()- Overrides:
isAlivein classClientManagerFacade
-
verifyClientLiveliness
public boolean verifyClientLiveliness()- Overrides:
verifyClientLivelinessin classClientManagerFacade
-
requestLeaseSet
public 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. UNUSED, the call below without jobs is always used.- Specified by:
requestLeaseSetin classClientManagerFacade- 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) 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 authorization
-
requestLeaseSet
Request that a particular client authorize the Leases contained in the LeaseSet.- Specified by:
requestLeaseSetin classClientManagerFacade- 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). The LeaseSet contains Leases only; it is unsigned and does not have the destination set.
-
reportAbuse
Instruct the client (or all clients) that they are under attack. This call does not block.- Specified by:
reportAbusein classClientManagerFacade- 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.- Specified by:
isLocalin classClientManagerFacade- Parameters:
dest- Destination to be checked
-
isLocal
Determine if the destination specified is managed locally. This call DOES block.- Specified by:
isLocalin classClientManagerFacade- Parameters:
destHash- Hash of Destination to be checked
-
shouldPublishLeaseSet
Description copied from class:ClientManagerFacadeDoes the client specified want their leaseSet published?- Overrides:
shouldPublishLeaseSetin classClientManagerFacade
-
messageDeliveryStatusUpdate
public void messageDeliveryStatusUpdate(Destination fromDest, MessageId id, long messageNonce, int status) - Specified by:
messageDeliveryStatusUpdatein classClientManagerFacade- Parameters:
id- the router's ID for this messagemessageNonce- the client's ID for this message, greater than zerostatus- see I2CP MessageStatusMessage for success/failure codes
-
messageReceived
- Specified by:
messageReceivedin classClientManagerFacade
-
getClientSessionConfig
Return the client's current config, or null if not connected- Specified by:
getClientSessionConfigin classClientManagerFacade
-
getClientSessionKeyManager
Return the client's current manager or null if not connected- Specified by:
getClientSessionKeyManagerin classClientManagerFacade
-
renderStatusHTML
Deprecated.unused- Specified by:
renderStatusHTMLin interfaceService- Overrides:
renderStatusHTMLin classClientManagerFacade- Throws:
IOException
-
listClients
Return the list of locally connected clients- Overrides:
listClientsin classClientManagerFacade- Returns:
- set of Destination objects
-
connect
The InternalClientManager interface. Connect to the router, receiving a message queue to talk to the router with.- Specified by:
connectin interfaceInternalClientManager- Throws:
I2PSessionException- if the router isn't ready- Since:
- 0.8.3
-
registerMetaDest
Declare that we're going to publish a meta LS for this destination. Must be called before publishing the leaseset.- Overrides:
registerMetaDestin classClientManagerFacade- Throws:
I2PSessionException- on duplicate dest- Since:
- 0.9.41
-
unregisterMetaDest
Declare that we're no longer going to publish a meta LS for this destination.- Overrides:
unregisterMetaDestin classClientManagerFacade- Since:
- 0.9.41
-
getClientFloodfillNetworkDatabaseFacade
get 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.- Specified by:
getClientFloodfillNetworkDatabaseFacadein classClientManagerFacade- Parameters:
destHash- destination hash associated with the client who's subDb we're looking for- Returns:
- the netdb or null
- Since:
- 0.9.61
-
getPrimaryHashes
get all the primary hashes for all the clients and return them as a set- Specified by:
getPrimaryHashesin classClientManagerFacade- Returns:
- all the hashes or an empty set, non-null
- Since:
- 0.9.61
-