proxy
Class DirectProxy

java.lang.Object
  extended by proxy.DirectProxy
All Implemented Interfaces:
AnonService, java.lang.Runnable

public final class DirectProxy
extends java.lang.Object
implements java.lang.Runnable, AnonService


Nested Class Summary
static class DirectProxy.AllowProxyConnectionCallback
           
private  class DirectProxy.DirectConViaHTTPProxy
          This class is used to transfer requests via the selected proxy
private  class DirectProxy.RememberedRequestRight
           
static class DirectProxy.RequestInfo
           
private static class DirectProxy.SendAnonWarning
          This class is used to inform the user that he tries to send requests although anonymity mode is off.
 
Field Summary
private static java.lang.String GENERAL_RULE
           
private  java.net.ServerSocket m_socketListener
           
private  AnonService m_tor
           
private static DirectProxy.AllowProxyConnectionCallback ms_callback
           
private  java.lang.Object THREAD_SYNC
           
private  java.lang.Thread threadRunLoop
           
 
Fields inherited from interface anon.AnonService
ANONLIB_VERSION
 
Constructor Summary
DirectProxy(java.net.ServerSocket s)
           
 
Method Summary
 void addEventListener(AnonServiceEventListener l)
          Adds an AnonServiceEventListener.
 AnonChannel createChannel(int a_type)
          Creates a new AnonChannel, which could be used for transmitting data.
protected  ImmutableProxyInterface getProxyInterface()
           
 int initialize(AnonServerDescription a_mixCascade, IServiceContainer a_serviceContainer, TermsAndConditionConfirmation termsConfirmation)
          Initializes this AnonService.
 boolean isConnected()
          Returns true if this Anon Service is connected, e.g.
 void removeEventListener(AnonServiceEventListener l)
          Removes an AnonServiceEventListener.
 void removeEventListeners()
           
 void run()
           
static void setAllowUnprotectedConnectionCallback(DirectProxy.AllowProxyConnectionCallback a_callback)
           
 int setProxy(IMutableProxyInterface a_proxyInterface)
          Sets the settings ofr the proxy, which should be used to establish network connections
 void shutdown(boolean a_bResetTransferredBytes)
          Disconnects form the server.
 boolean startService()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERAL_RULE

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

ms_callback

private static DirectProxy.AllowProxyConnectionCallback ms_callback

m_tor

private AnonService m_tor

m_socketListener

private java.net.ServerSocket m_socketListener

THREAD_SYNC

private final java.lang.Object THREAD_SYNC

threadRunLoop

private volatile java.lang.Thread threadRunLoop
Constructor Detail

DirectProxy

public DirectProxy(java.net.ServerSocket s)
Method Detail

setAllowUnprotectedConnectionCallback

public static void setAllowUnprotectedConnectionCallback(DirectProxy.AllowProxyConnectionCallback a_callback)

createChannel

public AnonChannel createChannel(int a_type)
                          throws java.net.ConnectException
Description copied from interface: AnonService
Creates a new AnonChannel, which could be used for transmitting data. There is a limit of 50 channels per AnonService-connection, in order to prevent Denial of Service-attacks See AnonChannel for more information.

Specified by:
createChannel in interface AnonService
Parameters:
a_type - the type of the created channel
Returns:
AnonChannel, usefull for data transmisson
Throws:
java.net.ConnectException

addEventListener

public void addEventListener(AnonServiceEventListener l)
Description copied from interface: AnonService
Adds an AnonServiceEventListener. This listener will receive events like: ... For more information see AnonServiceEventListener.

Specified by:
addEventListener in interface AnonService
Parameters:
l - Listener to add

removeEventListeners

public void removeEventListeners()
Specified by:
removeEventListeners in interface AnonService

removeEventListener

public void removeEventListener(AnonServiceEventListener l)
Description copied from interface: AnonService
Removes an AnonServiceEventListener. This Listener will not receive any Events anymore.

Specified by:
removeEventListener in interface AnonService
Parameters:
l - Listener, which will be removed

setProxy

public int setProxy(IMutableProxyInterface a_proxyInterface)
Description copied from interface: AnonService
Sets the settings ofr the proxy, which should be used to establish network connections

Specified by:
setProxy in interface AnonService
Returns:
E_SUCCESS, if ok

isConnected

public boolean isConnected()
Description copied from interface: AnonService
Returns true if this Anon Service is connected, e.g. initialized and useable

Specified by:
isConnected in interface AnonService

initialize

public int initialize(AnonServerDescription a_mixCascade,
                      IServiceContainer a_serviceContainer,
                      TermsAndConditionConfirmation termsConfirmation)
Description copied from interface: AnonService
Initializes this AnonService. Depending on the AnonService, this may establish a connection to an AnonServer, which is described through the anonService parameter. This method must be called before any Channels could be created.

Specified by:
initialize in interface AnonService
Parameters:
a_mixCascade - AnonServer to use
Returns:
E_SUCCESS, if the connection could be established

startService

public boolean startService()

run

public void run()
Specified by:
run in interface java.lang.Runnable

shutdown

public void shutdown(boolean a_bResetTransferredBytes)
Description copied from interface: AnonService
Disconnects form the server.

Specified by:
shutdown in interface AnonService

getProxyInterface

protected ImmutableProxyInterface getProxyInterface()