org.klomp.snark
Class TrackerClient

java.lang.Object
  extended by java.lang.Thread
      extended by net.i2p.util.I2PThread
          extended by net.i2p.util.I2PAppThread
              extended by org.klomp.snark.TrackerClient
All Implemented Interfaces:
java.lang.Runnable

public class TrackerClient
extends I2PAppThread

Informs metainfo tracker of events and gets new peers for peer coordinator.

Author:
Mark Wielaard (mark@klomp.org)

Nested Class Summary
 
Nested classes/interfaces inherited from class net.i2p.util.I2PThread
I2PThread.OOMEventListener
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TrackerClient(I2PSnarkUtil util, MetaInfo meta, PeerCoordinator coordinator)
           
 
Method Summary
 void halt()
          Interrupts this Thread to stop it.
 boolean halted()
           
(package private) static boolean isValidAnnounce(java.lang.String ann)
           
 void run()
           
 void start()
           
 boolean started()
           
static java.lang.String urlencode(byte[] bs)
          Very lazy byte[] to URL encoder.
 
Methods inherited from class net.i2p.util.I2PAppThread
addOOMEventThreadListener, fireOOM, removeOOMEventThreadListener
 
Methods inherited from class net.i2p.util.I2PThread
addOOMEventListener, finalize, main, removeOOMEventListener
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrackerClient

public TrackerClient(I2PSnarkUtil util,
                     MetaInfo meta,
                     PeerCoordinator coordinator)
Method Detail

start

public void start()
Overrides:
start in class java.lang.Thread

halted

public boolean halted()

started

public boolean started()

halt

public void halt()
Interrupts this Thread to stop it.


run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class I2PThread

urlencode

public static java.lang.String urlencode(byte[] bs)
Very lazy byte[] to URL encoder. Just encodes almost everything, even some "normal" chars. By not encoding about 1/4 of the chars, we make random data like hashes about 16% smaller. RFC1738: 0-9a-zA-Z$-_.+!*'(), Us: 0-9a-zA-Z


isValidAnnounce

static boolean isValidAnnounce(java.lang.String ann)
Returns:
true for i2p hosts only
Since:
0.7.12