anon.mixminion.mmrdescription
Class MMRList

java.lang.Object
  extended by anon.mixminion.mmrdescription.MMRList

public class MMRList
extends java.lang.Object


Field Summary
private  java.util.Vector m_exitnodes
           
private  java.util.Vector m_fragexitnodes
           
private  java.util.Vector m_mixminionrouters
           
private  java.util.Hashtable m_mixminionroutersWithNames
           
private  MMRListFetcher m_mmrlistFetcher
           
private  MyRandom m_rand
           
 
Constructor Summary
MMRList(MMRListFetcher fetcher)
          constructor
 
Method Summary
 MMRDescription getByName(java.lang.String name)
          gets an Mixminion router by it's name
 MMRDescription getByRandom()
          selects a MMR randomly
 MMRDescription getByRandom(java.util.Vector allowedNames)
          selects a MMR randomly from a given list of allowed OR names
 java.util.Vector getByRandomWithExit(int hops)
          selects a Routing List randomly, last element is surely an exit-node tries to blanace the probability of exit and non-exit nodes
 java.util.Vector getByRandomWithFrag(int hops, int frags)
           
 java.util.Vector getList()
          returns a List of all Mixminionrouters
 MMRDescription getMMRDescription(java.lang.String name)
          returns a MMRDescription to the given MMRName
 java.util.Vector mytesting()
           
private  boolean parseDocument(byte[] document)
          parses the document and creates a list with all MMRDescriptions
 void remove(java.lang.String name)
          removes an Mixminion router
 void setFetcher(MMRListFetcher fetcher)
           
 int size()
          size of the MMRList
 boolean updateList()
          Updates the list of available MMRouters.
 void vectortostring(java.util.Vector v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_mixminionrouters

private java.util.Vector m_mixminionrouters

m_exitnodes

private java.util.Vector m_exitnodes

m_fragexitnodes

private java.util.Vector m_fragexitnodes

m_mixminionroutersWithNames

private java.util.Hashtable m_mixminionroutersWithNames

m_rand

private MyRandom m_rand

m_mmrlistFetcher

private MMRListFetcher m_mmrlistFetcher
Constructor Detail

MMRList

public MMRList(MMRListFetcher fetcher)
constructor

Method Detail

size

public int size()
size of the MMRList

Returns:
number of routers in the list

setFetcher

public void setFetcher(MMRListFetcher fetcher)

updateList

public boolean updateList()
Updates the list of available MMRouters.

Returns:
true if it was ok, false otherwise

getList

public java.util.Vector getList()
returns a List of all Mixminionrouters

Returns:
List of MMRDescriptions

getByName

public MMRDescription getByName(java.lang.String name)
gets an Mixminion router by it's name

Parameters:
name - name of the MMR
Returns:
MMRDescription of the onion router

remove

public void remove(java.lang.String name)
removes an Mixminion router

Parameters:
name - name of the MMR

getByRandom

public MMRDescription getByRandom(java.util.Vector allowedNames)
selects a MMR randomly from a given list of allowed OR names

Parameters:
mmrlist - list of mixminionrouter names
Returns:

getByRandom

public MMRDescription getByRandom()
selects a MMR randomly

Returns:

getByRandomWithExit

public java.util.Vector getByRandomWithExit(int hops)
selects a Routing List randomly, last element is surely an exit-node tries to blanace the probability of exit and non-exit nodes

Parameters:
hops - int length of the circuit
Returns:
routers vector

getByRandomWithFrag

public java.util.Vector getByRandomWithFrag(int hops,
                                            int frags)

getMMRDescription

public MMRDescription getMMRDescription(java.lang.String name)
returns a MMRDescription to the given MMRName

Parameters:
name - MMRName
Returns:
MMRDescription if the MMR exist, null else

parseDocument

private boolean parseDocument(byte[] document)
                       throws java.lang.Exception
parses the document and creates a list with all MMRDescriptions

Parameters:
strDocument -
Returns:
false if document is not a valid directory, true otherwise
Throws:
java.lang.Exception

vectortostring

public void vectortostring(java.util.Vector v)

mytesting

public java.util.Vector mytesting()