jondonym.console
Class MixCascadeInfo

java.lang.Object
  extended by jondonym.console.MixCascadeInfo

public class MixCascadeInfo
extends java.lang.Object


Field Summary
static int DELAY_HIGH
           
private  java.util.Vector m_cachedMixInfos
           
private  MixCascade m_cascade
           
private static boolean ms_bSupportForUsersAndSecurity
           
private static boolean ms_bToStringAsHTML
           
private static java.util.Hashtable ms_countryISO2CodePathTable
           
private static java.lang.String ms_pathToSecurityIcon
           
private static java.lang.String ms_pathToUsersIcon
           
private static java.lang.String MSG_CONTACT
           
private static java.lang.String MSG_CONTACT_MESSAGE
           
private static java.lang.String MSG_COUNTRY_MIX
           
private static java.lang.String MSG_COUNTRY_OPERATOR
           
private static java.lang.String MSG_NUMBER_OF_USERS
           
private static java.lang.String MSG_SECURITY
           
private static java.lang.String MSG_VISIT_MESSAGE
           
static int SECURITY_DISTRIBUTION_MAX
           
static int SECURITY_DISTRIBUTION_MIN
           
static int SECURITY_USERS_MAX
           
static int SECURITY_USERS_MIN
           
static int SPEED_LOW
           
 
Constructor Summary
MixCascadeInfo(MixCascade a_cascade)
           
 
Method Summary
 int countIndependentOperators()
          How many independent operators do we have in this cascade?
 int countMixes()
          The number of Mix server processes in this cascade.
 int countUsers()
          The number of users currently on this cascade.
private static java.lang.String getFormattedCountry(java.lang.String a_countryCode, java.lang.String a_titleMessage)
           
 int getMaximumDelay()
          Get the maximum delay to expect on this cascade in ms.
 int getMaximumSpeed()
          Get the maximum speed to expect on this cascade in kbit/s.
 int getMinimumDelay()
          Get the minimum delay to expect on this cascade in ms.
 int getMinimumSpeed()
          Get the minimum speed to expect on this cascade in kbit/s.
 MixInfo getMixInfo(int a_position)
          Returns information about all mixes in this cascade from 0 to countMixes() - 1.
 java.lang.String getName()
          This cascade's name.
 int getSecurityDistribution()
          The distribution points of a Cascade.
 int getSecurityUsers()
          The user level of a cascade.
 int getUserLimit()
          The maximum number of users allowed on this cascade.
static void initToStringAsHTML(java.util.Hashtable a_countryISO2CodePathTable)
          Should be called in a web environment for initializing the toString method.
 boolean isPremium()
           
 boolean isSOCKS5Supported()
           
 java.lang.String toString()
          This string returns some general info about the cascade, excluding its name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SECURITY_DISTRIBUTION_MAX

public static int SECURITY_DISTRIBUTION_MAX

SECURITY_DISTRIBUTION_MIN

public static int SECURITY_DISTRIBUTION_MIN

SECURITY_USERS_MAX

public static int SECURITY_USERS_MAX

SECURITY_USERS_MIN

public static int SECURITY_USERS_MIN

SPEED_LOW

public static final int SPEED_LOW

DELAY_HIGH

public static final int DELAY_HIGH

MSG_CONTACT_MESSAGE

private static final java.lang.String MSG_CONTACT_MESSAGE

MSG_CONTACT

private static final java.lang.String MSG_CONTACT

MSG_VISIT_MESSAGE

private static final java.lang.String MSG_VISIT_MESSAGE

MSG_SECURITY

private static final java.lang.String MSG_SECURITY

MSG_NUMBER_OF_USERS

private static final java.lang.String MSG_NUMBER_OF_USERS

MSG_COUNTRY_MIX

private static final java.lang.String MSG_COUNTRY_MIX

MSG_COUNTRY_OPERATOR

private static final java.lang.String MSG_COUNTRY_OPERATOR

ms_bToStringAsHTML

private static boolean ms_bToStringAsHTML

ms_countryISO2CodePathTable

private static java.util.Hashtable ms_countryISO2CodePathTable

ms_pathToUsersIcon

private static java.lang.String ms_pathToUsersIcon

ms_pathToSecurityIcon

private static java.lang.String ms_pathToSecurityIcon

ms_bSupportForUsersAndSecurity

private static boolean ms_bSupportForUsersAndSecurity

m_cascade

private MixCascade m_cascade

m_cachedMixInfos

private java.util.Vector m_cachedMixInfos
Constructor Detail

MixCascadeInfo

public MixCascadeInfo(MixCascade a_cascade)
Method Detail

initToStringAsHTML

public static void initToStringAsHTML(java.util.Hashtable a_countryISO2CodePathTable)
Should be called in a web environment for initializing the toString method. PLEASE NOTE: the interface of this method may change frequently, depending on what is currently needed for displaying the toString method in HTML.

Parameters:
a_countryISO2CodePathTable - absolute or relative URL image paths to country flags, the the format: code[ISO2, lower case], [path to flag]
a_pathToUsersIcon - absolute or relative URL image path to an icon representing the number of users on a cascade, e.g. an iconified person
a_pathToSecurityIcon - an absolute or relative path to an icon representing the security of the cascade

getMinimumSpeed

public int getMinimumSpeed()
Get the minimum speed to expect on this cascade in kbit/s.

Returns:
the minimum speed to expect on this cascade in kbit/s; if < 0, then no information is available; if >= SPEED_LOW, then this speed is below measurement (very bad)

getMaximumSpeed

public int getMaximumSpeed()
Get the maximum speed to expect on this cascade in kbit/s.

Returns:
the maximum speed to expect on this cascade in kbit/s; if < 0, then no information is available; if >= SPEED_LOW, then this speed is below measurement (very bad)

getMaximumDelay

public int getMaximumDelay()
Get the maximum delay to expect on this cascade in ms.

Returns:
the maximum delay to expect on this cascade in ms; if < 0, then no information is available; if >= DELAY_HIGH, then this delay is above measurement (very bad)

getMinimumDelay

public int getMinimumDelay()
Get the minimum delay to expect on this cascade in ms.

Returns:
the minimum delay to expect on this cascade in ms; if < 0, then no information is available; if >= DELAY_HIGH, then this delay is above measurement (very bad)

countMixes

public int countMixes()
The number of Mix server processes in this cascade. This does not mean that these processes are independent, distributed or otherwise secure. Use countIndependentOperators(), getSecurityDistribution() and getSecurityUsers() to get its security attributes.

Returns:
the number of Mix server processes in this cascade

countUsers

public int countUsers()
The number of users currently on this cascade.

Returns:
the number of users currently on this cascade; if < 0, no information is available

getSecurityDistribution

public int getSecurityDistribution()
The distribution points of a Cascade. This is a security attribute. The higher the distribution, the more secure this cascade is.

Returns:
the distribution of a cascade; ranges from SECURITY_DISTRIBUTION_MIN (worst value) to SECURITY_DISTRIBUTION_MAX (best value)

getSecurityUsers

public int getSecurityUsers()
The user level of a cascade. This is a security attribute. The higher the user level, the more secure this cascade is.

Returns:
the distribution of a cascade; ranges from SECURITY_USERS_MIN (worst value) to SECURITY_USERS_MAX (best value); if it is < SECURITY_USERS_MIN, than no information is available

getMixInfo

public MixInfo getMixInfo(int a_position)
Returns information about all mixes in this cascade from 0 to countMixes() - 1. If this should be presented to the user, however, you should count from 0 to countIndependentOperators(), just in order not to count more Mixes than there are independent operators.

Parameters:
a_position - from 0 to countMixes() - 1; if presented to users: from 0 to countIndependentOperators()
Returns:

isPremium

public boolean isPremium()

isSOCKS5Supported

public boolean isSOCKS5Supported()

countIndependentOperators

public int countIndependentOperators()
How many independent operators do we have in this cascade?

Returns:

getUserLimit

public int getUserLimit()
The maximum number of users allowed on this cascade.

Returns:

getName

public java.lang.String getName()
This cascade's name. Please note that the names of the Mixes may differ!

Returns:

toString

public java.lang.String toString()
This string returns some general info about the cascade, excluding its name.

Overrides:
toString in class java.lang.Object

getFormattedCountry

private static java.lang.String getFormattedCountry(java.lang.String a_countryCode,
                                                    java.lang.String a_titleMessage)