public class Network
extends java.lang.Object
Constructor and Description |
---|
Network() |
Modifier and Type | Method and Description |
---|---|
MicroblogStatus |
getNetworkTweet()
Returns a tweet using a random template with a random running relay or
group of running relays.
|
java.lang.String |
getRandomAs()
Get a random AS number that has at least one relay running in the Tor
network.
|
java.lang.String |
getRandomCountry()
Get a random 2-letter country code that has at least one relay running in
the Tor network.
|
Bridge |
getRandomRunningBridge()
Get a random relay from the Tor network.
|
Relay |
getRandomRunningRelay()
Get a random relay from the Tor network.
|
MicroblogStatus |
getRelayTweet()
Returns a tweet using a random template with a random running relay or
group of running relays.
|
java.util.List<Bridge> |
getRunningBridges() |
java.util.List<Relay> |
getRunningRelays() |
java.util.List<Relay> |
getRunningRelaysForAs()
Returns a list of running relay details for a random AS.
|
java.util.List<Relay> |
getRunningRelaysForAs(java.lang.String as)
Returns a list of running relays details for a chosen AS.
|
java.util.List<Relay> |
getRunningRelaysForCountry()
Returns a list of relay details for a random country.
|
java.util.List<Relay> |
getRunningRelaysForCountry(java.lang.String country)
Returns a list of relay details for a chosen country.
|
void |
update()
Fetch and cache the latest details document from Onionoo containing all
currently running relays and bridges.
|
public void update()
public Relay getRandomRunningRelay()
public Bridge getRandomRunningBridge()
public java.lang.String getRandomCountry()
getRunningRelaysForCountry(String)
.getRunningRelaysForCountry()
,
getRunningRelaysForCountry(String)
public java.lang.String getRandomAs()
getRunningRelaysForAs(String)
.getRunningRelaysForAs()
,
getRunningRelaysForAs(String)
public java.util.List<Relay> getRunningRelaysForAs()
getRunningRelaysForAs(String)
.getRunningRelaysForAs(String)
public java.util.List<Relay> getRunningRelaysForAs(java.lang.String as)
as
- A string in the for "ASx" where x is an integer with no leading
zeros.public java.util.List<Relay> getRunningRelaysForCountry()
getRunningRelaysForCountry(String)
.getRunningRelaysForCountry(String)
public java.util.List<Relay> getRunningRelaysForCountry(java.lang.String country)
public MicroblogStatus getNetworkTweet() throws OnionooMissingInformationException
The following functions may be called to generate the tweets:
RelayStatusGenerator#generateAgeTweet(RelayImpl)
RelayStatusGenerator#generateBandwidthTweet(RelayImpl)
RelayLocationStatusGenerator.generateAsBandwidthTweet(List)
RelayLocationStatusGenerator.generateCountryBandwidthTweet(List)
BridgeStatusGenerator.generateAgeTweet(Bridge)
BridgeStatusGenerator.generateBandwidthTweet(Bridge)
OnionooMissingInformationException
- when information required to generate the tweet is missing from
the RelayDetails object (probably because Onionoo did not have
it)public MicroblogStatus getRelayTweet() throws OnionooMissingInformationException
The following functions may be called to generate the tweets:
RelayStatusGenerator#generateAgeTweet(RelayImpl)
RelayStatusGenerator#generateBandwidthTweet(RelayImpl)
RelayLocationStatusGenerator.generateAsBandwidthTweet(List)
RelayLocationStatusGenerator.generateCountryBandwidthTweet(List)
BridgeStatusGenerator.generateAgeTweet(Bridge)
BridgeStatusGenerator.generateBandwidthTweet(Bridge)
OnionooMissingInformationException
- when information required to generate the tweet is missing from
the RelayDetails object (probably because Onionoo did not have
it)public java.util.List<Relay> getRunningRelays()
public java.util.List<Bridge> getRunningBridges()