anon.tor.ordescription
Class PlainORListFetcher

java.lang.Object
  extended by anon.tor.ordescription.PlainORListFetcher
All Implemented Interfaces:
ORListFetcher

public final class PlainORListFetcher
extends java.lang.Object
implements ORListFetcher

get descriptor and status documents from a directory server via HTTP

Author:
dhoske

Field Summary
private  int m_ORListPort
           
private  java.lang.String m_ORListServer
           
 
Constructor Summary
PlainORListFetcher(java.lang.String addr, int port)
          Constructor
 
Method Summary
 byte[] getAllDescriptors()
          gets descriptors for all known ORs
 byte[] getDescriptor(java.lang.String digest)
          gets descriptor for OR with given digest
 byte[] getDescriptorByFingerprint(java.lang.String fingerprint)
           
private  byte[] getDocument(java.lang.String path)
          fetch document from directory server
 byte[] getRouterStatus()
          gets authoritive network-status
 byte[] getStatus(java.lang.String fingerprint)
          gets network-status for host with given fingerprint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_ORListServer

private java.lang.String m_ORListServer

m_ORListPort

private int m_ORListPort
Constructor Detail

PlainORListFetcher

public PlainORListFetcher(java.lang.String addr,
                          int port)
Constructor

Parameters:
addr - address of the directory server
port - port of the directory server
Method Detail

getRouterStatus

public byte[] getRouterStatus()
Description copied from interface: ORListFetcher
gets authoritive network-status

Specified by:
getRouterStatus in interface ORListFetcher
Returns:
status document

getDescriptor

public byte[] getDescriptor(java.lang.String digest)
Description copied from interface: ORListFetcher
gets descriptor for OR with given digest

Specified by:
getDescriptor in interface ORListFetcher
Returns:
descriptor

getDescriptorByFingerprint

public byte[] getDescriptorByFingerprint(java.lang.String fingerprint)
Specified by:
getDescriptorByFingerprint in interface ORListFetcher

getAllDescriptors

public byte[] getAllDescriptors()
Description copied from interface: ORListFetcher
gets descriptors for all known ORs

Specified by:
getAllDescriptors in interface ORListFetcher
Returns:
concatenated descriptors

getStatus

public byte[] getStatus(java.lang.String fingerprint)
Description copied from interface: ORListFetcher
gets network-status for host with given fingerprint

Specified by:
getStatus in interface ORListFetcher
Returns:
status document

getDocument

private byte[] getDocument(java.lang.String path)
fetch document from directory server

Parameters:
path - path to document
Returns:
the document