public final class ORList
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
m_countHibernate |
private java.util.Date |
m_datePublished |
private java.util.Vector |
m_exitnodes |
private java.util.Vector |
m_middlenodes |
private java.util.Vector |
m_onionrouters |
private java.util.Hashtable |
m_onionroutersWithNames |
private ORListFetcher |
m_orlistFetcher |
private MyRandom |
m_rand |
private static java.text.DateFormat |
ms_DateFormat |
Constructor and Description |
---|
ORList(ORListFetcher fetcher)
constructor
|
Modifier and Type | Method and Description |
---|---|
int |
active() |
void |
add(ORDescriptor ord)
add an onion rotuer
|
ORDescriptor |
getByName(java.lang.String name)
gets an onion router by it's name
|
ORDescriptor |
getByRandom()
selects a OR randomly (it should not hibernate)
|
ORDescriptor |
getByRandom(int length)
selects a OR randomly
tries to blanace the probability of exit and non-exit nodes
|
ORDescriptor |
getByRandom(java.util.Vector allowedNames)
selects a OR randomly from a given list of allowed OR names
|
java.util.Vector |
getList()
returns a List of all onionrouters
|
ORDescriptor |
getORDescriptor(java.lang.String name)
returns a ORDescription to the given ORName
|
java.util.Date |
getPublished()
gets the date when the List was pubished
|
private boolean |
parseFirstDocument(byte[] document)
parses the document and creates a list with all ORDescriptions
|
private boolean |
parseStatus(byte[] document,
boolean change)
parse router status
|
void |
remove(java.lang.String name)
removes an onion router
|
void |
setFetcher(ORListFetcher fetcher) |
int |
size()
size of the ORList
|
boolean |
updateList()
Updates the list of available ORRouters.
|
private java.util.Vector m_onionrouters
private java.util.Vector m_exitnodes
private java.util.Vector m_middlenodes
private java.util.Hashtable m_onionroutersWithNames
private MyRandom m_rand
private ORListFetcher m_orlistFetcher
private java.util.Date m_datePublished
private int m_countHibernate
private static final java.text.DateFormat ms_DateFormat
public ORList(ORListFetcher fetcher)
public int size()
public int active()
public void setFetcher(ORListFetcher fetcher)
public boolean updateList()
public java.util.Vector getList()
public java.util.Date getPublished()
public ORDescriptor getByName(java.lang.String name)
name
- name of the ORpublic void remove(java.lang.String name)
name
- name of the ORpublic void add(ORDescriptor ord)
ord
- descriptor for routerpublic ORDescriptor getByRandom(java.util.Vector allowedNames)
orlist
- list of onionrouter namespublic ORDescriptor getByRandom()
public ORDescriptor getByRandom(int length)
length
- length of the circuitpublic ORDescriptor getORDescriptor(java.lang.String name)
name
- ORNameprivate boolean parseStatus(byte[] document, boolean change) throws java.lang.Exception
java.lang.Exception
private boolean parseFirstDocument(byte[] document) throws java.lang.Exception
strDocument
- java.lang.Exception
Copyright © 2023. All rights reserved.