|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinfoservice.tor.TorDirectoryAgent
public class TorDirectoryAgent
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_currentCompressedTorNodesList
Stores the compressed tor nodes list. |
private byte[] |
m_currentTorNodesList
Stores the current tor nodes list. |
private long |
m_updateInterval
Stores the cycle time (in milliseconds) for updating the tor nodes list. |
private static TorDirectoryAgent |
ms_tdaInstance
Stores the instance of TorDirectoryAgent (singleton). |
| Constructor Summary | |
|---|---|
private |
TorDirectoryAgent()
Creates a new instance of TorDirectoryAgent. |
| Method Summary | |
|---|---|
void |
addTorDirectoryServer(TorDirectoryServer a_torDirectoryServer)
Adds a TorDirectoryServer to the database of known tor directory servers. |
byte[] |
getCompressedTorNodesList()
Returns the compressed tor nodes list (same uncompressed data as obtained by the getTorNodesList() call). |
static TorDirectoryAgent |
getInstance()
Returns the instance of TorDirectoryAgent (singleton). |
byte[] |
getTorNodesList()
Returns the current tor nodes list. |
void |
run()
This is the implementation of the tor nodes list update thread. |
void |
startUpdateThread(long a_updateInterval)
This starts the internal tor nodes list update thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String DEFAULT_DIRECTORY_FILE
private static TorDirectoryAgent ms_tdaInstance
private byte[] m_currentTorNodesList
private byte[] m_currentCompressedTorNodesList
private long m_updateInterval
| Constructor Detail |
|---|
private TorDirectoryAgent()
| Method Detail |
|---|
public static TorDirectoryAgent getInstance()
public void addTorDirectoryServer(TorDirectoryServer a_torDirectoryServer)
a_torDirectoryServer - The tor directory server to add.public void startUpdateThread(long a_updateInterval)
a_updateInterval - The cycle time in milliseconds for fetching the current list of the
tor nodes.public byte[] getTorNodesList()
public byte[] getCompressedTorNodesList()
public void run()
run in interface java.lang.Runnable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||