infoservice.tor
Class MixminionDirectoryAgent

java.lang.Object
  extended by infoservice.tor.MixminionDirectoryAgent
All Implemented Interfaces:
java.lang.Runnable

public class MixminionDirectoryAgent
extends java.lang.Object
implements java.lang.Runnable

This class is responsible for fetching the information about the active tor nodes. This class is a singleton.


Field Summary
private static java.lang.String DEFAULT_DIRECTORY_FILE
          The filename where we can find the TOR nodes file on a TOR directory server.
private  byte[] m_currentMixminionNodesList
          Stores the XML container with the current tor nodes list.
private  long m_updateInterval
          Stores the cycle time (in milliseconds) for updating the tor nodes list.
private  java.net.URL m_urlDirectoryServer
           
private static MixminionDirectoryAgent ms_mdaInstance
          Stores the instance of MixminionDirectoryAgent (singleton).
 
Constructor Summary
private MixminionDirectoryAgent()
          Creates a new instance of MixminionDirectoryAgent.
 
Method Summary
 void addDirectoryServer(java.net.URL directoryServer)
           
static MixminionDirectoryAgent getInstance()
          Returns the instance of MixminionDirectoryAgent (singleton).
 byte[] getMixminionNodesList()
          Returns the ZLib commpresed current Mixminion nodes list.
 void run()
          This is the implementation of the mixminion nodes list update thread.
 void startUpdateThread(long a_updateInterval)
          This starts the internal mixminion nodes list update thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DIRECTORY_FILE

private static final java.lang.String DEFAULT_DIRECTORY_FILE
The filename where we can find the TOR nodes file on a TOR directory server.

See Also:
Constant Field Values

ms_mdaInstance

private static MixminionDirectoryAgent ms_mdaInstance
Stores the instance of MixminionDirectoryAgent (singleton).


m_urlDirectoryServer

private java.net.URL m_urlDirectoryServer

m_currentMixminionNodesList

private byte[] m_currentMixminionNodesList
Stores the XML container with the current tor nodes list. If we don't have a topical list, this value is null.


m_updateInterval

private long m_updateInterval
Stores the cycle time (in milliseconds) for updating the tor nodes list. Until the update thread is started, this value is -1.

Constructor Detail

MixminionDirectoryAgent

private MixminionDirectoryAgent()
Creates a new instance of MixminionDirectoryAgent. We do some initialization here.

Method Detail

getInstance

public static MixminionDirectoryAgent getInstance()
Returns the instance of MixminionDirectoryAgent (singleton). If there is no instance, a new one is created.

Returns:
The MixminionDirectoryAgent instance.

addDirectoryServer

public void addDirectoryServer(java.net.URL directoryServer)

startUpdateThread

public void startUpdateThread(long a_updateInterval)
This starts the internal mixminion nodes list update thread. You have to call this method exactly once after the creation of this MixminionDirectoryAgent. After the update thread is started once, later calls of this method are ignored.

Parameters:
a_updateInterval - The cycle time in milliseconds for fetching the current list of the tor nodes.

getMixminionNodesList

public byte[] getMixminionNodesList()
Returns the ZLib commpresed current Mixminion nodes list. If we don't have a topical list, the returned value is null. The xml-struct is as follows: The following does not exist at the moment... * ...

Returns:
The ZLib compressed current mixminion nodes list or null, if we don't have a topical list.

run

public void run()
This is the implementation of the mixminion nodes list update thread.

Specified by:
run in interface java.lang.Runnable