jap
Class JAPController

java.lang.Object
  extended by java.util.Observable
      extended by jap.JAPController
All Implemented Interfaces:
AnonServiceEventListener, IProxyListener, TermsAndConditionConfirmation, java.util.Observer

public final class JAPController
extends java.util.Observable
implements IProxyListener, java.util.Observer, AnonServiceEventListener, TermsAndConditionConfirmation


Nested Class Summary
 class JAPController.AnonConnectionChecker
           
private  class JAPController.AutoSwitchedMixCascadeContainer
           
static interface JAPController.IRestarter
           
static interface JAPController.ProgramExitListener
           
private  class JAPController.SetAnonModeAsync
           
private static class JAPController.WarnNoJonDoFoxHttpListener
           
private  class JAPController.WarnSmallBalanceOnDownloadListener
           
 
Nested classes/interfaces inherited from interface anon.terms.TermsAndConditionConfirmation
TermsAndConditionConfirmation.AlwaysAccept
 
Field Summary
private  java.lang.String CLASS_PATH
           
private  boolean isRunningHTTPListener
           
private  java.lang.Object LOCK_VERSION_UPDATE
           
private  AccountUpdater m_AccountUpdater
           
private  JobQueue m_anonJobQueue
           
private  java.util.Vector m_anonServiceListener
           
private  boolean m_bAllowPaidServices
           
private  boolean m_bAskAutoConnect
           
private  boolean m_bAskSavePayment
           
private  boolean m_bAssistantClicked
           
private  boolean m_bConnecting
           
private  boolean m_bConnectionUnused
          Tells if the user has already transferred some bytes on the anonymous connection.
private  boolean m_bExpiredISCertificatesShown
           
private  boolean m_bForwarderNotExplain
           
private  boolean m_bMainView
           
private  boolean m_bPortable
           
private  boolean m_bPortableJava
           
private  boolean m_bPresentationMode
           
private  boolean m_bShowConfigAssistant
           
private  boolean m_bShowHelpAdvise
           
private  boolean m_bShowingVersionUpdate
           
private  boolean m_bShutdown
          Stores all MixCascades we know (information comes from infoservice or was entered by a user).
private  java.lang.String[] m_commandLineArgs
           
private static JAPController m_Controller
           
private  MixCascade m_currentMixCascade
          Stores the active MixCascade.
private static JAPFeedback m_feedback
           
private  ISplashResponse m_finishSplash
           
private  java.lang.Object m_finishSync
           
(package private)  boolean m_firstPortableFFStart
           
private  InfoServiceUpdater m_InfoServiceUpdater
           
private  int m_iStatusPanelMsgIdForwarderServerStatus
          Holds the MsgID of the status message after the forwarding server was started.
private  JavaVersionUpdater m_javaVersionUpdater
           
private  long m_lastBalanceUpdateBytes
           
private  long m_lastBalanceUpdateMS
           
private  MessageUpdater m_messageUpdater
           
private  MinVersionUpdater m_minVersionUpdater
           
private  MixCascadeUpdater m_MixCascadeUpdater
           
private static JAPModel m_Model
           
private  long m_nrOfBytesOther
           
private  long m_nrOfBytesWWW
           
private  Updater.ObservableInfo m_observableInfo
           
private  IPasswordReader m_passwordReader
           
private  PaymentInstanceUpdater m_paymentInstanceUpdater
           
private  PerformanceInfoUpdater m_perfInfoUpdater
           
private  java.util.Vector m_programExitListeners
           
private  AnonProxy m_proxyAnon
           
private  DirectProxy.AllowProxyConnectionCallback m_proxyCallback
           
private  DirectProxy m_proxyDirect
           
private  JAPController.IRestarter m_restarter
           
private  JAPController.WarnSmallBalanceOnDownloadListener m_smallBalanceWarningListener
           
private  java.net.ServerSocket m_socketHTTPListener
           
private  IJAPMainView m_View
           
private  JAPController.WarnNoJonDoFoxHttpListener m_warnNoJonDoFoxHttpListener
           
private  boolean mbActCntMessageNeverRemind
           
private  boolean mbActCntMessageNotRemind
           
private  boolean mbDoNotAbuseReminder
           
static java.lang.String MSG_ACCOUNT_NOT_SAVED
           
private static java.lang.String MSG_ACCOUNT_PASSWORD
           
private static java.lang.String MSG_ACCPASSWORD
           
private static java.lang.String MSG_ACCPASSWORDENTER
           
private static java.lang.String MSG_ACCPASSWORDENTERTITLE
           
private static java.lang.String MSG_ACCPASSWORDTITLE
           
private static java.lang.String MSG_ALLOWUNPROTECTED
           
private static java.lang.String MSG_ALLOWUNPROTECTED_ALL
           
static java.lang.String MSG_ASK_AUTO_CONNECT
           
static java.lang.String MSG_ASK_RECONNECT
           
static java.lang.String MSG_ASK_SWITCH
           
static java.lang.String MSG_ASK_WHICH_VERSION
           
private static java.lang.String MSG_CASCADE_NOT_PARSABLE
           
private static java.lang.String MSG_CASCADE_NOT_TRUSTED
           
static java.lang.String MSG_CLOSING_DIALOGS
           
private static java.lang.String MSG_DIALOG_ACCOUNT_PASSWORD
           
private static java.lang.String MSG_DISABLE_GOODBYE
           
private static java.lang.String MSG_ENCRYPTACCOUNT
           
private static java.lang.String MSG_ENCRYPTACCOUNTTITLE
           
static java.lang.String MSG_ERROR_SAVING_CONFIG
          Messages
private static java.lang.String MSG_EXPLAIN_ALLOWUNPROTECTED_ALL
           
static java.lang.String MSG_FINISH_FORWARDING_SERVER
           
static java.lang.String MSG_FINISHING
           
static java.lang.String MSG_FINISHING_ANON
           
static java.lang.String MSG_FINISHING_IS_UPDATES
           
static java.lang.String MSG_FORWARDER_REG_ERROR_SHORT
           
static java.lang.String MSG_FORWARDER_REGISTRATION_ERROR_FOOTER
           
static java.lang.String MSG_FORWARDER_REGISTRATION_ERROR_HEADER
           
static java.lang.String MSG_IS_NOT_ALLOWED
           
static java.lang.String MSG_IS_NOT_ALLOWED_FOR_ANONYMOUS
           
private static java.lang.String MSG_LOSEACCOUNTDATA
           
private static java.lang.String MSG_NEW_OPTIONAL_VERSION
           
static java.lang.String MSG_NO_WRITING
           
static java.lang.String MSG_NO_WRITING_PORTABLE
           
static java.lang.String MSG_PAYMENT_DAMAGED
           
static java.lang.String MSG_READ_NEW_HELP
           
private static java.lang.String MSG_REPEAT_ENTER_ACCOUNT_PASSWORD
           
static java.lang.String MSG_RESTARTING
           
static java.lang.String MSG_SAVING_CONFIG
           
static java.lang.String MSG_STOPPING_LISTENER
           
static java.lang.String MSG_STOPPING_PROXY
           
static java.lang.String MSG_UPDATING_HELP
           
static java.lang.String MSG_VERSION_DEVELOPER
           
static java.lang.String MSG_VERSION_RELEASE
           
static java.lang.String MSG_WAITING_ANON
           
static java.lang.String MSG_WAITING_IS
           
static java.lang.String MSG_WARNING_BROWSER_NOT_OPTIMIZED
           
static java.lang.String MSG_WARNING_INSUFFICIENT_BALANCE
           
static java.lang.String MSG_WARNING_IS_CERTS_EXPIRED
           
static java.lang.String MSG_WARNING_IS_CERTS_INVALID
           
static java.lang.String MSG_WARNING_SHORT_BALANCE
           
static java.lang.String MSG_WARNING_SHORT_BALANCE_CONTINUE
           
private  java.util.Vector observerVector
           
private  java.lang.Object PROXY_SYNC
           
private  JobQueue queueFetchAccountInfo
           
private  java.lang.Object SYNC_EXPIRED_IS_CERTS
           
private  java.lang.Object SYNC_VIEW
           
private static java.lang.String XML_ALLOW_NON_ANONYMOUS_CONNECTION
           
private static java.lang.String XML_ALLOW_NON_ANONYMOUS_UPDATE
           
private static java.lang.String XML_ATTR_ASK_SAVE_PAYMENT
           
private static java.lang.String XML_ATTR_AUTO_CHOOSE_CASCADES
           
private static java.lang.String XML_ATTR_AUTO_CHOOSE_CASCADES_ON_STARTUP
           
private static java.lang.String XML_ATTR_HELP_PATH
           
private static java.lang.String XML_ATTR_INFOSERVICE_CONNECT_TIMEOUT
           
private static java.lang.String XML_ATTR_LOGIN_TIMEOUT
           
private static java.lang.String XML_ATTR_LOOK_AND_FEEL
           
private static java.lang.String XML_ATTR_PORTABLE_BROWSER_PATH
           
private static java.lang.String XML_ATTR_SHOW_CONFIG_ASSISTANT
           
private static java.lang.String XML_ATTR_SHOW_SPLASH_SCREEN
           
private static java.lang.String XML_ATTR_WARN_ON_INSECURE_BRWOSER
           
private static java.lang.String XML_ELEM_LOOK_AND_FEEL
           
private static java.lang.String XML_ELEM_LOOK_AND_FEELS
           
 
Fields inherited from interface anon.proxy.IProxyListener
PROTOCOL_OTHER, PROTOCOL_WWW
 
Constructor Summary
private JAPController()
           
 
Method Summary
static void aboutJAP()
          Shows the About dialog
static void addDefaultCertificates()
          load the default certificates
private static void addDefaultCertificates(java.lang.String a_certspath, java.lang.String[] a_singleCerts, int a_type)
           
 void addEventListener(AnonServiceEventListener a_listener)
           
 void addJAPObserver(JAPObserver o)
           
 void addProgramExitListener(JAPController.ProgramExitListener a_listener)
           
private  void addWindowLocationToConf(org.w3c.dom.Element a_parentElement, java.awt.Point a_location)
           
private  void addWindowSizeToConf(org.w3c.dom.Element a_parentElement, java.awt.Dimension a_size, boolean a_bSaveSize)
           
private  void applyProxySettingsToAnonService(java.awt.Component a_parent)
           
 void applyProxySettingsToInfoService(boolean a_bUseAuth)
           
 void changeProxyInterface(ProxyInterface a_proxyInterface, boolean a_bUseAuth, java.awt.Component a_parent)
          Changes the common proxy.
 void channelsChanged(int channels)
           
 boolean confirmTermsAndConditions(java.util.Vector operators, java.util.Vector terms)
          performs an action to confirm the terms and conditions
 void connecting(AnonServerDescription a_serverDescription)
           
 void connectionError()
           
 void connectionEstablished(AnonServerDescription a_serverDescription)
           
static InfoServiceDBEntry[] createDefaultInfoServices()
           
 void dataChainErrorSignaled()
           
 void disconnected()
           
 boolean enableForwardingServer(boolean a_activate)
          Enables or disables the forwarding server.
 boolean fetchMixCascades(boolean bShowError, boolean a_bDoOnlyIfNotYetUpdated)
          Get all available mixcascades from the infoservice and store it in the database.
 boolean getAnonMode()
           
 java.lang.String[] getCommandlineArgs()
           
private  org.w3c.dom.Document getConfigurationAsXmlString()
           
 MixCascade getConnectedCascade()
           
 MixCascade getCurrentMixCascade()
          Returns the active MixCascade.
 java.awt.Component getCurrentView()
           
static java.lang.String getFirewallAuthPasswd_()
           
static JAPController getInstance()
          Creates the Controller - as Singleton.
 java.net.InetAddress getListenerInetAddress()
           
 int getListenerPort()
           
 Updater.ObservableInfo getObservableInfo()
           
 IPasswordReader getPasswordReader()
          Returns the password reader.
 java.lang.String getPaymentPassword()
          Gets the password for payment data encryption
 JAPController.IRestarter getRestarter()
           
 java.awt.Window getViewWindow()
           
static void goodBye(boolean bDoNotRestart)
          This (and only this) is the final exit procedure of JAP! It shows a reminder to reset the proxy configurations and saves the current configuration.
 boolean hasPortableJava()
           
 void initCommandLineArgs(java.lang.String[] a_cmdArgs)
           
 void initialRun(java.lang.String a_listenerHost, int a_listenerPort)
           
private  java.net.ServerSocket intern_startListener(int port, java.lang.String host)
           
 boolean isAnonConnected()
           
 boolean isAskSavePayment()
           
 boolean isConfigAssistantShown()
          Indicactes if the config assistant should be shown on JAP start.
 boolean isConnecting()
           
 boolean isOperatorOfConnectedMix(ServiceOperator operator)
           
 boolean isPortableMode()
           
 boolean isShuttingDown()
           
 void loadConfigFile(java.lang.String a_strJapConfFile, ISplashResponse a_splash)
          Loads the Configuration.
private  boolean loadConfigFileCommandLine(java.lang.String a_configFile)
          Tries to load the config file provided in the command line
private  boolean loadConfigFileCurrentDir()
          Tries to load a config file in the current directory
private  boolean loadConfigFileHome()
          Tries to load a config file from the user's home directory
private  boolean loadConfigFileOSdependent()
          Tries to load a config file in OS-depended locations
private  boolean lookForConfigFile(java.lang.String a_strJapConfFile)
           
 void notifyJAPObservers()
           
 void packetMixed(long a_totalBytes)
           
private  java.awt.Point parseWindowLocation(org.w3c.dom.Node a_node, java.awt.Point a_default, boolean a_bSaveDefault)
           
private  java.awt.Dimension parseWindowSize(org.w3c.dom.Node a_node, java.awt.Dimension a_default, boolean a_bDefaultSave, boolean bForceLoadingofSize)
           
 void preLoadConfigFile(java.lang.String a_strJapConfFile)
           
 void removeEventListener(AnonServiceEventListener a_listener)
           
static void resetMixminionPassword()
           
private  void restartJAP()
          Tries to restart the JAP
1.) Try to find "java.home" and start JAP with the java.exe in this path 2.) Try to find out if 'java' or 'jview' was used
 boolean saveConfigFile()
           
 void setAllowPaidServices(boolean a_bAllow)
           
 void setAnonMode(boolean a_anonModeSelected)
           
 void setAskSavePayment(boolean a_bAsk)
           
 void setConfigAssistantShown()
           
 void setCurrentMixCascade(MixCascade newMixCascade)
          Changes the active MixCascade.
 void setDefaultView(int defaultView)
           
 void setDummyTraffic(int msIntervall)
           
 void setInfoServiceDisabled(boolean b)
           
 void setMinimizeOnStartup(boolean b)
           
static void setMixminionFragments(java.util.Vector f)
           
static void setMixminionKeyring(java.lang.String kr)
           
static void setMixminionMessages(java.util.Vector m)
           
static void setMixminionMMRList(MMRList m)
           
static void setMixminionPassword(java.lang.String p)
           
static void setMixminionPasswordHash(byte[] h)
           
 void setMoveToSystrayOnStartup(boolean b)
           
 void setPaymentPassword(java.lang.String a_password)
          Sets the password for payment data encryption
 void setPortableJava(boolean a_bPortable)
           
 void setPortableMode(boolean a_bPortable)
           
static void setPreCreateAnonRoutes(boolean b)
           
 void setPresentationMode(boolean a_bPresentationMode)
           
 void setRestarter(JAPController.IRestarter a_restarter)
           
static void setTorMaxConnectionsPerRoute(int i)
           
static void setTorRouteLen(int min, int max)
           
static void setTorUseNoneDefaultDirServer(boolean b)
           
 void setView(IJAPMainView v, ISplashResponse a_splash)
           
 void showConfigDialog()
           
 void showConfigDialog(java.lang.String card, java.lang.Object a_value)
           
 void showInstallationAssistant()
           
 void start()
           
 void startAnonymousMode(java.awt.Component a_parentComponent)
          This will do all necessary things in order to enable the anonymous mode.
 boolean startHTTPListener(java.lang.String a_listenerHost, int a_listenerPort)
           
 void stopAnonModeWait()
           
 MixCascade switchToNextMixCascade()
           
 MixCascade switchToNextMixCascade(boolean a_bForceNextRandom)
           
 MixCascade switchTrustFilter(TrustModel a_trustModel)
           
 void switchViewWindow(boolean a_bMainView)
           
 void transferedBytes(long bytes, int protocolType)
          Called if some bytes are transferred.
 void uninstall(java.lang.String a_strConfigFileName)
           
 void update(java.util.Observable a_notifier, java.lang.Object a_message)
          This is the observer implementation.
 boolean updateInfoServices(boolean a_bDoOnlyIfNotYetUpdated)
          Updates the list of known InfoServices.
 boolean updatePaymentInstances(boolean a_bDoOnlyIfNotYetUpdated)
           
 boolean updatePerformanceInfo(boolean a_bDoOnlyIfNotYetUpdated)
           
private  int versionCheck(java.lang.String a_minVersion, boolean a_bForced)
          Performs the Versioncheck.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_ERROR_SAVING_CONFIG

public static final java.lang.String MSG_ERROR_SAVING_CONFIG
Messages


MSG_NO_WRITING

public static final java.lang.String MSG_NO_WRITING

MSG_NO_WRITING_PORTABLE

public static final java.lang.String MSG_NO_WRITING_PORTABLE

MSG_DIALOG_ACCOUNT_PASSWORD

private static final java.lang.String MSG_DIALOG_ACCOUNT_PASSWORD

MSG_ACCOUNT_PASSWORD

private static final java.lang.String MSG_ACCOUNT_PASSWORD

MSG_ENCRYPTACCOUNT

private static final java.lang.String MSG_ENCRYPTACCOUNT

MSG_ENCRYPTACCOUNTTITLE

private static final java.lang.String MSG_ENCRYPTACCOUNTTITLE

MSG_ACCPASSWORDTITLE

private static final java.lang.String MSG_ACCPASSWORDTITLE

MSG_ACCPASSWORD

private static final java.lang.String MSG_ACCPASSWORD

MSG_ACCPASSWORDENTERTITLE

private static final java.lang.String MSG_ACCPASSWORDENTERTITLE

MSG_ACCPASSWORDENTER

private static final java.lang.String MSG_ACCPASSWORDENTER

MSG_LOSEACCOUNTDATA

private static final java.lang.String MSG_LOSEACCOUNTDATA

MSG_REPEAT_ENTER_ACCOUNT_PASSWORD

private static final java.lang.String MSG_REPEAT_ENTER_ACCOUNT_PASSWORD

MSG_DISABLE_GOODBYE

private static final java.lang.String MSG_DISABLE_GOODBYE

MSG_NEW_OPTIONAL_VERSION

private static final java.lang.String MSG_NEW_OPTIONAL_VERSION

MSG_CASCADE_NOT_TRUSTED

private static final java.lang.String MSG_CASCADE_NOT_TRUSTED

MSG_ALLOWUNPROTECTED

private static final java.lang.String MSG_ALLOWUNPROTECTED

MSG_ALLOWUNPROTECTED_ALL

private static final java.lang.String MSG_ALLOWUNPROTECTED_ALL

MSG_EXPLAIN_ALLOWUNPROTECTED_ALL

private static final java.lang.String MSG_EXPLAIN_ALLOWUNPROTECTED_ALL

MSG_IS_NOT_ALLOWED

public static final java.lang.String MSG_IS_NOT_ALLOWED

MSG_IS_NOT_ALLOWED_FOR_ANONYMOUS

public static final java.lang.String MSG_IS_NOT_ALLOWED_FOR_ANONYMOUS

MSG_ASK_SWITCH

public static final java.lang.String MSG_ASK_SWITCH

MSG_ASK_RECONNECT

public static final java.lang.String MSG_ASK_RECONNECT

MSG_ASK_AUTO_CONNECT

public static final java.lang.String MSG_ASK_AUTO_CONNECT

MSG_FINISHING

public static final java.lang.String MSG_FINISHING

MSG_SAVING_CONFIG

public static final java.lang.String MSG_SAVING_CONFIG

MSG_CLOSING_DIALOGS

public static final java.lang.String MSG_CLOSING_DIALOGS

MSG_FINISHING_IS_UPDATES

public static final java.lang.String MSG_FINISHING_IS_UPDATES

MSG_FINISHING_ANON

public static final java.lang.String MSG_FINISHING_ANON

MSG_WAITING_IS

public static final java.lang.String MSG_WAITING_IS

MSG_WAITING_ANON

public static final java.lang.String MSG_WAITING_ANON

MSG_STOPPING_PROXY

public static final java.lang.String MSG_STOPPING_PROXY

MSG_STOPPING_LISTENER

public static final java.lang.String MSG_STOPPING_LISTENER

MSG_RESTARTING

public static final java.lang.String MSG_RESTARTING

MSG_FINISH_FORWARDING_SERVER

public static final java.lang.String MSG_FINISH_FORWARDING_SERVER

MSG_VERSION_RELEASE

public static final java.lang.String MSG_VERSION_RELEASE

MSG_VERSION_DEVELOPER

public static final java.lang.String MSG_VERSION_DEVELOPER

MSG_ASK_WHICH_VERSION

public static final java.lang.String MSG_ASK_WHICH_VERSION

MSG_CASCADE_NOT_PARSABLE

private static final java.lang.String MSG_CASCADE_NOT_PARSABLE

MSG_PAYMENT_DAMAGED

public static final java.lang.String MSG_PAYMENT_DAMAGED

MSG_ACCOUNT_NOT_SAVED

public static final java.lang.String MSG_ACCOUNT_NOT_SAVED

MSG_UPDATING_HELP

public static final java.lang.String MSG_UPDATING_HELP

MSG_FORWARDER_REGISTRATION_ERROR_HEADER

public static final java.lang.String MSG_FORWARDER_REGISTRATION_ERROR_HEADER

MSG_FORWARDER_REGISTRATION_ERROR_FOOTER

public static final java.lang.String MSG_FORWARDER_REGISTRATION_ERROR_FOOTER

MSG_FORWARDER_REG_ERROR_SHORT

public static final java.lang.String MSG_FORWARDER_REG_ERROR_SHORT

MSG_READ_NEW_HELP

public static final java.lang.String MSG_READ_NEW_HELP

MSG_WARNING_IS_CERTS_EXPIRED

public static final java.lang.String MSG_WARNING_IS_CERTS_EXPIRED

MSG_WARNING_IS_CERTS_INVALID

public static final java.lang.String MSG_WARNING_IS_CERTS_INVALID

MSG_WARNING_INSUFFICIENT_BALANCE

public static final java.lang.String MSG_WARNING_INSUFFICIENT_BALANCE

MSG_WARNING_SHORT_BALANCE

public static final java.lang.String MSG_WARNING_SHORT_BALANCE

MSG_WARNING_SHORT_BALANCE_CONTINUE

public static final java.lang.String MSG_WARNING_SHORT_BALANCE_CONTINUE

MSG_WARNING_BROWSER_NOT_OPTIMIZED

public static final java.lang.String MSG_WARNING_BROWSER_NOT_OPTIMIZED

XML_ELEM_LOOK_AND_FEEL

private static final java.lang.String XML_ELEM_LOOK_AND_FEEL
See Also:
Constant Field Values

XML_ELEM_LOOK_AND_FEELS

private static final java.lang.String XML_ELEM_LOOK_AND_FEELS
See Also:
Constant Field Values

XML_ATTR_LOOK_AND_FEEL

private static final java.lang.String XML_ATTR_LOOK_AND_FEEL
See Also:
Constant Field Values

XML_ALLOW_NON_ANONYMOUS_CONNECTION

private static final java.lang.String XML_ALLOW_NON_ANONYMOUS_CONNECTION
See Also:
Constant Field Values

XML_ALLOW_NON_ANONYMOUS_UPDATE

private static final java.lang.String XML_ALLOW_NON_ANONYMOUS_UPDATE
See Also:
Constant Field Values

XML_ATTR_AUTO_CHOOSE_CASCADES

private static final java.lang.String XML_ATTR_AUTO_CHOOSE_CASCADES
See Also:
Constant Field Values

XML_ATTR_AUTO_CHOOSE_CASCADES_ON_STARTUP

private static final java.lang.String XML_ATTR_AUTO_CHOOSE_CASCADES_ON_STARTUP
See Also:
Constant Field Values

XML_ATTR_SHOW_CONFIG_ASSISTANT

private static final java.lang.String XML_ATTR_SHOW_CONFIG_ASSISTANT
See Also:
Constant Field Values

XML_ATTR_LOGIN_TIMEOUT

private static final java.lang.String XML_ATTR_LOGIN_TIMEOUT
See Also:
Constant Field Values

XML_ATTR_INFOSERVICE_CONNECT_TIMEOUT

private static final java.lang.String XML_ATTR_INFOSERVICE_CONNECT_TIMEOUT
See Also:
Constant Field Values

XML_ATTR_ASK_SAVE_PAYMENT

private static final java.lang.String XML_ATTR_ASK_SAVE_PAYMENT
See Also:
Constant Field Values

XML_ATTR_SHOW_SPLASH_SCREEN

private static final java.lang.String XML_ATTR_SHOW_SPLASH_SCREEN
See Also:
Constant Field Values

XML_ATTR_PORTABLE_BROWSER_PATH

private static final java.lang.String XML_ATTR_PORTABLE_BROWSER_PATH
See Also:
Constant Field Values

XML_ATTR_WARN_ON_INSECURE_BRWOSER

private static final java.lang.String XML_ATTR_WARN_ON_INSECURE_BRWOSER
See Also:
Constant Field Values

XML_ATTR_HELP_PATH

private static final java.lang.String XML_ATTR_HELP_PATH
See Also:
Constant Field Values

CLASS_PATH

private final java.lang.String CLASS_PATH

PROXY_SYNC

private final java.lang.Object PROXY_SYNC

m_commandLineArgs

private java.lang.String[] m_commandLineArgs

m_firstPortableFFStart

boolean m_firstPortableFFStart

m_bShutdown

private boolean m_bShutdown
Stores all MixCascades we know (information comes from infoservice or was entered by a user). This list may or may not include the current active MixCascade.


m_programExitListeners

private java.util.Vector m_programExitListeners

m_bShowConfigAssistant

private boolean m_bShowConfigAssistant

m_bAssistantClicked

private boolean m_bAssistantClicked

m_bAllowPaidServices

private boolean m_bAllowPaidServices

m_bShowHelpAdvise

private boolean m_bShowHelpAdvise

m_anonJobQueue

private JobQueue m_anonJobQueue

m_bConnecting

private boolean m_bConnecting

queueFetchAccountInfo

private JobQueue queueFetchAccountInfo

m_lastBalanceUpdateMS

private long m_lastBalanceUpdateMS

m_lastBalanceUpdateBytes

private long m_lastBalanceUpdateBytes

m_bConnectionUnused

private boolean m_bConnectionUnused
Tells if the user has already transferred some bytes on the anonymous connection. If not, we may switch to another connection if the current connection is bad.


m_currentMixCascade

private MixCascade m_currentMixCascade
Stores the active MixCascade.


m_socketHTTPListener

private java.net.ServerSocket m_socketHTTPListener

m_proxyDirect

private DirectProxy m_proxyDirect

m_proxyAnon

private AnonProxy m_proxyAnon

m_observableInfo

private Updater.ObservableInfo m_observableInfo

m_AccountUpdater

private AccountUpdater m_AccountUpdater

m_InfoServiceUpdater

private InfoServiceUpdater m_InfoServiceUpdater

m_paymentInstanceUpdater

private PaymentInstanceUpdater m_paymentInstanceUpdater

m_MixCascadeUpdater

private MixCascadeUpdater m_MixCascadeUpdater

m_minVersionUpdater

private MinVersionUpdater m_minVersionUpdater

m_javaVersionUpdater

private JavaVersionUpdater m_javaVersionUpdater

m_messageUpdater

private MessageUpdater m_messageUpdater

m_perfInfoUpdater

private PerformanceInfoUpdater m_perfInfoUpdater

LOCK_VERSION_UPDATE

private java.lang.Object LOCK_VERSION_UPDATE

m_bShowingVersionUpdate

private boolean m_bShowingVersionUpdate

m_bAskAutoConnect

private boolean m_bAskAutoConnect

isRunningHTTPListener

private boolean isRunningHTTPListener

mbActCntMessageNotRemind

private boolean mbActCntMessageNotRemind

mbActCntMessageNeverRemind

private boolean mbActCntMessageNeverRemind

mbDoNotAbuseReminder

private boolean mbDoNotAbuseReminder

m_bForwarderNotExplain

private boolean m_bForwarderNotExplain

m_bExpiredISCertificatesShown

private boolean m_bExpiredISCertificatesShown

SYNC_EXPIRED_IS_CERTS

private final java.lang.Object SYNC_EXPIRED_IS_CERTS

m_bAskSavePayment

private boolean m_bAskSavePayment

m_bPresentationMode

private boolean m_bPresentationMode

m_bPortableJava

private boolean m_bPortableJava

m_bPortable

private boolean m_bPortable

m_nrOfBytesWWW

private long m_nrOfBytesWWW

m_nrOfBytesOther

private long m_nrOfBytesOther

m_View

private IJAPMainView m_View

m_bMainView

private boolean m_bMainView

SYNC_VIEW

private java.lang.Object SYNC_VIEW

m_Controller

private static JAPController m_Controller

m_Model

private static JAPModel m_Model

m_feedback

private static JAPFeedback m_feedback

observerVector

private java.util.Vector observerVector

m_anonServiceListener

private java.util.Vector m_anonServiceListener

m_passwordReader

private IPasswordReader m_passwordReader

m_finishSync

private java.lang.Object m_finishSync

m_finishSplash

private ISplashResponse m_finishSplash

m_restarter

private JAPController.IRestarter m_restarter

m_proxyCallback

private DirectProxy.AllowProxyConnectionCallback m_proxyCallback

m_smallBalanceWarningListener

private JAPController.WarnSmallBalanceOnDownloadListener m_smallBalanceWarningListener

m_warnNoJonDoFoxHttpListener

private JAPController.WarnNoJonDoFoxHttpListener m_warnNoJonDoFoxHttpListener

m_iStatusPanelMsgIdForwarderServerStatus

private int m_iStatusPanelMsgIdForwarderServerStatus
Holds the MsgID of the status message after the forwarding server was started.

Constructor Detail

JAPController

private JAPController()
Method Detail

start

public void start()

getInstance

public static JAPController getInstance()
Creates the Controller - as Singleton.

Returns:
The one and only JAPController

getRestarter

public JAPController.IRestarter getRestarter()

setRestarter

public void setRestarter(JAPController.IRestarter a_restarter)

addProgramExitListener

public void addProgramExitListener(JAPController.ProgramExitListener a_listener)

setPresentationMode

public void setPresentationMode(boolean a_bPresentationMode)

setPortableJava

public void setPortableJava(boolean a_bPortable)

hasPortableJava

public boolean hasPortableJava()

setPortableMode

public void setPortableMode(boolean a_bPortable)

isPortableMode

public boolean isPortableMode()

initCommandLineArgs

public void initCommandLineArgs(java.lang.String[] a_cmdArgs)

getCommandlineArgs

public java.lang.String[] getCommandlineArgs()

getPasswordReader

public IPasswordReader getPasswordReader()
Returns the password reader.

Returns:
the password reader

initialRun

public void initialRun(java.lang.String a_listenerHost,
                       int a_listenerPort)

isAskSavePayment

public boolean isAskSavePayment()

setAskSavePayment

public void setAskSavePayment(boolean a_bAsk)

isShuttingDown

public boolean isShuttingDown()

loadConfigFile

public void loadConfigFile(java.lang.String a_strJapConfFile,
                           ISplashResponse a_splash)
Loads the Configuration. First tries to read a config file provided on the command line. If none is provided, it will look in the operating system specific locations for configuration files (e.g. Library/Preferences on Mac OS X or hidden in the user's home on Linux). If there are no config files in these locations, the method will look in the user's home directory and in the installation path of JAP (the last two locations are checked for compatibility reasons and are deprecated). The configuration is a XML-File with the following structure: //info about known MixCascades (since version 0.16) ... //at the moment only user defined cascades are stored //info about the used AnonServer (since version 0.1) [equal to the general MixCascade struct] //Attr "userDefined" since Version 0.12 //if true this cascade information was handcrafted by the user //otherwise it comes from the InfoService .. ... //since version 0.2 --> store the position and size of JAP on the Desktop //for the Main Window "true/false" //remember Position ? //Location of the upper left corner //Size of the Main window Normal|Simplified //Which view of JAP to show? (since version 0.11); default: Normal "true"/"false" //After start move JAP into the systray? (since version 0.11); default: false //info about debug output .. // the amount of output (0 means less.. 7 means max) .. // the detail level of the log output, sinver version 0.21 ... //the kind of Output, at the moment only: if NodeValue==Console --> Console ... //if given, log to the given File (since version 0.14) // since version 0.18 true // whether signature verification of received XML data is enabled or disabled // list of all certificates to uses for signature verification 1 // the type of the stored certificate (until it's stored within the certificate itself), see JAPCertificate.java true // whether the certificate has to be verified against an active root certificate from the certificat store in order to get activated itself true // whether the certificate is enabled (available for signature verification) or not ... // the certificate data, see JAPCertificate.java ... // since config version 0.19 // info about all known infoservices ... // the same format as from infoservice, without signature, if expired, it is removed from infoservice list ... // info about the preferred infoservice, only one infoservice is supported here ... // the same format as from infoservice, without signature, expire time does not matter true // whether it is tried to change the infoservice automatically after failure // Tor related seetings (since Version 0.6) ...(since Vresion 0.8) //How many connections are allowed before a new circuit is created (since Vresion 0.9) //How long should a route be True/False //Should the routes be created in advance? //since 0.25 Use none default Tor directory server // Mixminion related seetings (since Version 0.22) ... //How long should a route be xxx@yyy.xyz //destination of the replyblock route as String Base64 //Hash of the user pw String ASCII-Armor and Base64 //Keyring with usersecrets // Account data encrypted with password ..... ..... // since version 0.10, if WITH_BLOCKINGRESISTANCE is enabled 12345 // the port number, where the forwarding server is listening false // whether the forwarding server shall be started, when JAP is starting // list of all connection classes including settings // a single connection class entry 0 // the identifier of the connection class 10000 // the maximum bandwidth (bytes/sec) the class provides 50 // since version 0.17, the percentage of the bandwidth useable for forwarding ... 0 // the currently selected connection class (identifier) false // whether to registrate the local forwarding server at all infoservices with a forwarder list // a list of InfoServices, where the local forwarding server shall be registrated on startup ... ... true // whether the clients of the local forwarding server are allowed to use all running mixcascades // a list of MixCascades, where the the clients are allowed to connect to ... ... // since version 0.15 false // whether a forwarder is needed to contact the mixcascades when enabling the anonymous mode false // whether an InfoService can be reached or also the InfoService needs forwarding version // Dialog version shown

Parameters:
a_strJapConfFile - - file containing the Configuration. If null $(user.home)/jap.conf or ./jap.conf is used.
loadPay - does this JAP support Payment ?

uninstall

public void uninstall(java.lang.String a_strConfigFileName)
               throws java.io.IOException
Throws:
java.io.IOException

preLoadConfigFile

public void preLoadConfigFile(java.lang.String a_strJapConfFile)
                       throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

lookForConfigFile

private boolean lookForConfigFile(java.lang.String a_strJapConfFile)
                           throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

loadConfigFileCommandLine

private boolean loadConfigFileCommandLine(java.lang.String a_configFile)
Tries to load the config file provided in the command line

Returns:
FileInputStream

parseWindowSize

private java.awt.Dimension parseWindowSize(org.w3c.dom.Node a_node,
                                           java.awt.Dimension a_default,
                                           boolean a_bDefaultSave,
                                           boolean bForceLoadingofSize)

parseWindowLocation

private java.awt.Point parseWindowLocation(org.w3c.dom.Node a_node,
                                           java.awt.Point a_default,
                                           boolean a_bSaveDefault)

loadConfigFileOSdependent

private boolean loadConfigFileOSdependent()
Tries to load a config file in OS-depended locations

Returns:
boolean

loadConfigFileHome

private boolean loadConfigFileHome()
Tries to load a config file from the user's home directory

Returns:
boolean

loadConfigFileCurrentDir

private boolean loadConfigFileCurrentDir()
Tries to load a config file in the current directory

Returns:
boolean

restartJAP

private void restartJAP()
Tries to restart the JAP
1.) Try to find "java.home" and start JAP with the java.exe in this path 2.) Try to find out if 'java' or 'jview' was used


changeProxyInterface

public void changeProxyInterface(ProxyInterface a_proxyInterface,
                                 boolean a_bUseAuth,
                                 java.awt.Component a_parent)
Changes the common proxy.

Parameters:
a_proxyInterface - a proxy interface
a_bUseAuth - indicates whether porxy authentication should be used

saveConfigFile

public boolean saveConfigFile()

addWindowLocationToConf

private void addWindowLocationToConf(org.w3c.dom.Element a_parentElement,
                                     java.awt.Point a_location)

addWindowSizeToConf

private void addWindowSizeToConf(org.w3c.dom.Element a_parentElement,
                                 java.awt.Dimension a_size,
                                 boolean a_bSaveSize)

getConfigurationAsXmlString

private org.w3c.dom.Document getConfigurationAsXmlString()

setMinimizeOnStartup

public void setMinimizeOnStartup(boolean b)

setMoveToSystrayOnStartup

public void setMoveToSystrayOnStartup(boolean b)

setDefaultView

public void setDefaultView(int defaultView)

switchTrustFilter

public MixCascade switchTrustFilter(TrustModel a_trustModel)

switchToNextMixCascade

public MixCascade switchToNextMixCascade()

switchToNextMixCascade

public MixCascade switchToNextMixCascade(boolean a_bForceNextRandom)

setCurrentMixCascade

public void setCurrentMixCascade(MixCascade newMixCascade)
Changes the active MixCascade.

Parameters:
newMixCascade - The MixCascade which is activated.

getListenerInetAddress

public java.net.InetAddress getListenerInetAddress()

getListenerPort

public int getListenerPort()

getCurrentMixCascade

public MixCascade getCurrentMixCascade()
Returns the active MixCascade.

Returns:
The active MixCascade.

applyProxySettingsToInfoService

public void applyProxySettingsToInfoService(boolean a_bUseAuth)

applyProxySettingsToAnonService

private void applyProxySettingsToAnonService(java.awt.Component a_parent)

getFirewallAuthPasswd_

public static java.lang.String getFirewallAuthPasswd_()

setInfoServiceDisabled

public void setInfoServiceDisabled(boolean b)

setPreCreateAnonRoutes

public static void setPreCreateAnonRoutes(boolean b)

setTorUseNoneDefaultDirServer

public static void setTorUseNoneDefaultDirServer(boolean b)

isConnecting

public boolean isConnecting()

getAnonMode

public boolean getAnonMode()

isConfigAssistantShown

public boolean isConfigAssistantShown()
Indicactes if the config assistant should be shown on JAP start.

Returns:
if the config assistant should be shown on JAP start

setAllowPaidServices

public void setAllowPaidServices(boolean a_bAllow)

setConfigAssistantShown

public void setConfigAssistantShown()

getConnectedCascade

public MixCascade getConnectedCascade()

isOperatorOfConnectedMix

public boolean isOperatorOfConnectedMix(ServiceOperator operator)

isAnonConnected

public boolean isAnonConnected()

stopAnonModeWait

public void stopAnonModeWait()

setAnonMode

public void setAnonMode(boolean a_anonModeSelected)

getObservableInfo

public Updater.ObservableInfo getObservableInfo()

startAnonymousMode

public void startAnonymousMode(java.awt.Component a_parentComponent)
This will do all necessary things in order to enable the anonymous mode. The method decides whether to establish the connection via a forwarder or direct to the selected anonymity service. Attention: Maybe it is necessary to show a dialog in order to get the information about a forwarder. Thus only the Java-AWT event dispatch thread should call this method. Any other caller will produce a freeze, if the connect-to-forwarder dialog appears.

Parameters:
a_parentComponent - The parent component over which the connect to forwarder dialog (if necessary) is centered.

setDummyTraffic

public void setDummyTraffic(int msIntervall)

setTorMaxConnectionsPerRoute

public static void setTorMaxConnectionsPerRoute(int i)

setTorRouteLen

public static void setTorRouteLen(int min,
                                  int max)

setMixminionPassword

public static void setMixminionPassword(java.lang.String p)

setMixminionPasswordHash

public static void setMixminionPasswordHash(byte[] h)

resetMixminionPassword

public static void resetMixminionPassword()

setMixminionKeyring

public static void setMixminionKeyring(java.lang.String kr)

setMixminionMessages

public static void setMixminionMessages(java.util.Vector m)

setMixminionMMRList

public static void setMixminionMMRList(MMRList m)

setMixminionFragments

public static void setMixminionFragments(java.util.Vector f)

intern_startListener

private java.net.ServerSocket intern_startListener(int port,
                                                   java.lang.String host)

startHTTPListener

public boolean startHTTPListener(java.lang.String a_listenerHost,
                                 int a_listenerPort)

showInstallationAssistant

public void showInstallationAssistant()

goodBye

public static void goodBye(boolean bDoNotRestart)
This (and only this) is the final exit procedure of JAP! It shows a reminder to reset the proxy configurations and saves the current configuration.

Parameters:
bDoNotRestart - false if JAP should be restarted; true otherwise

aboutJAP

public static void aboutJAP()
Shows the About dialog


updatePaymentInstances

public boolean updatePaymentInstances(boolean a_bDoOnlyIfNotYetUpdated)

updateInfoServices

public boolean updateInfoServices(boolean a_bDoOnlyIfNotYetUpdated)
Updates the list of known InfoServices.

Parameters:
a_bDoOnlyIfNotYetUpdated - only updates the infoservices if not at least one successful update has been done yet
Returns:
true if the update was successful; false otherwise

updatePerformanceInfo

public boolean updatePerformanceInfo(boolean a_bDoOnlyIfNotYetUpdated)

fetchMixCascades

public boolean fetchMixCascades(boolean bShowError,
                                boolean a_bDoOnlyIfNotYetUpdated)
Get all available mixcascades from the infoservice and store it in the database.

Parameters:
bShowError - should an Error Message be displayed if something goes wrong ?
a_bDoOnlyIfNotYetUpdated - only updates the cascades if not at least one successful update has been done yet

versionCheck

private int versionCheck(java.lang.String a_minVersion,
                         boolean a_bForced)
Performs the Versioncheck.

Returns:
0, if the local JAP version is up to date. -1, if version check says that anonymity mode should not be enabled. Reasons can be: new version found, version check failed. 1, if no version check could be done

setView

public void setView(IJAPMainView v,
                    ISplashResponse a_splash)

switchViewWindow

public void switchViewWindow(boolean a_bMainView)

getCurrentView

public java.awt.Component getCurrentView()

getViewWindow

public java.awt.Window getViewWindow()

showConfigDialog

public void showConfigDialog(java.lang.String card,
                             java.lang.Object a_value)

showConfigDialog

public final void showConfigDialog()

removeEventListener

public void removeEventListener(AnonServiceEventListener a_listener)

addEventListener

public void addEventListener(AnonServiceEventListener a_listener)

addJAPObserver

public void addJAPObserver(JAPObserver o)

notifyJAPObservers

public void notifyJAPObservers()

channelsChanged

public void channelsChanged(int channels)
Specified by:
channelsChanged in interface IProxyListener

transferedBytes

public void transferedBytes(long bytes,
                            int protocolType)
Description copied from interface: IProxyListener
Called if some bytes are transferred.

Specified by:
transferedBytes in interface IProxyListener
Parameters:
bytes - either total amount or delta of transferred bytes
protocolType - the protocol to which the bytes are belonging

update

public void update(java.util.Observable a_notifier,
                   java.lang.Object a_message)
This is the observer implementation. At the moment only the routing system is observed. It's just for comfort reasons, so there is no need to registrate the JAPView at all observable objects. We collect all messages here and send them to the view. But it's also possible to registrate directly at the observed objects. So every developer can decide, whether to use the common JAP notification system or the specific ones. Also keep in mind, that maybe not all messages are forwarded to the common notification system (like statistic messages).

Specified by:
update in interface java.util.Observer
Parameters:
a_notifier - The observed Object (various forwarding related objects).
a_message - The reason of the notification, e.g. a JAPRoutingMessage.

enableForwardingServer

public boolean enableForwardingServer(boolean a_activate)
Enables or disables the forwarding server. Attention: If there is an active forwarding client running, nothing is done and this method returns always false. Run a forwarding server and a client at the same time is not supported. This method returns always immedailly and the real job is done in a background thread.

Parameters:
a_activate - True, if there server shall be activated or false, if it shall be disabled.

createDefaultInfoServices

public static InfoServiceDBEntry[] createDefaultInfoServices()
                                                      throws java.lang.Exception
Throws:
java.lang.Exception

addDefaultCertificates

private static void addDefaultCertificates(java.lang.String a_certspath,
                                           java.lang.String[] a_singleCerts,
                                           int a_type)

addDefaultCertificates

public static void addDefaultCertificates()
load the default certificates


connecting

public void connecting(AnonServerDescription a_serverDescription)
Specified by:
connecting in interface AnonServiceEventListener

connectionEstablished

public void connectionEstablished(AnonServerDescription a_serverDescription)
Specified by:
connectionEstablished in interface AnonServiceEventListener

dataChainErrorSignaled

public void dataChainErrorSignaled()
Specified by:
dataChainErrorSignaled in interface AnonServiceEventListener

disconnected

public void disconnected()
Specified by:
disconnected in interface AnonServiceEventListener

connectionError

public void connectionError()
Specified by:
connectionError in interface AnonServiceEventListener

getPaymentPassword

public java.lang.String getPaymentPassword()
Gets the password for payment data encryption

Returns:
String

setPaymentPassword

public void setPaymentPassword(java.lang.String a_password)
Sets the password for payment data encryption

Parameters:
a_password - Strign

packetMixed

public void packetMixed(long a_totalBytes)
Specified by:
packetMixed in interface AnonServiceEventListener

confirmTermsAndConditions

public boolean confirmTermsAndConditions(java.util.Vector operators,
                                         java.util.Vector terms)
Description copied from interface: TermsAndConditionConfirmation
performs an action to confirm the terms and conditions

Specified by:
confirmTermsAndConditions in interface TermsAndConditionConfirmation
Returns:
if the terms and conditions were confirmed by this action, false otherwise