net.i2p.client.naming
Class LookupDest

java.lang.Object
  extended by net.i2p.client.naming.LookupDest

 class LookupDest
extends Object

Connect via I2CP and ask the router to look up the lease of a hash, convert it to a Destination and return it. Obviously this can take a while. All calls are blocking and return null on failure. Timeout is 15 seconds. To do: Add methods that allow specifying the timeout. As of 0.8.3, standard I2PSessions support lookups, including multiple lookups in parallel, and overriding the default timeout. Using an existing I2PSession is much more efficient and flexible than using this class.


Constructor Summary
protected LookupDest(I2PAppContext context)
           
 
Method Summary
(package private) static Destination lookupBase32Hash(I2PAppContext ctx, String key)
           
(package private) static Destination lookupHash(I2PAppContext ctx, byte[] h)
           
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LookupDest

protected LookupDest(I2PAppContext context)
Method Detail

lookupBase32Hash

static Destination lookupBase32Hash(I2PAppContext ctx,
                                    String key)
                             throws I2PSessionException
Parameters:
key - 52 chars (do not include the .b32.i2p suffix)
Throws:
I2PSessionException

lookupHash

static Destination lookupHash(I2PAppContext ctx,
                              byte[] h)
                       throws I2PSessionException
Parameters:
h - 32 byte hash
Throws:
I2PSessionException

main

public static void main(String[] args)
                 throws I2PSessionException
Throws:
I2PSessionException