public class AnonClient extends java.lang.Object implements AnonService, java.util.Observer, DataChainErrorListener, IntegrityErrorListener
AnonService
using mix cascades to ensure
anonymous communication.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_BLOCK_TIMEOUT |
static int |
DEFAULT_LOGIN_TIMEOUT |
ANONLIB_VERSION
Constructor and Description |
---|
AnonClient() |
AnonClient(DirectProxy a_directProxy) |
AnonClient(DirectProxy a_directProxy,
anon.transport.connection.IStreamConnection a_theConnection,
MixCascade a_currentService) |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(AnonServiceEventListener a_eventListener)
Adds an AnonServiceEventListener.
|
AnonChannel |
createChannel(int a_type)
Creates a new AnonChannel, which could be used for transmitting data.
|
void |
dataChainErrorSignaled(AnonServiceException a_e) |
SocketHandler |
getConnectionToMixCascade()
Return the TCP connection used to connect to the cascade.
|
MixCascade |
getCurrentService() |
static int |
getLoginTimeout() |
void |
initialize(AnonServerDescription a_mixCascade,
IServiceContainer a_serviceContainer,
TermsAndConditionConfirmation termsConfirmation,
boolean a_bIsReconnect)
Initializes the underlying AnonService, using a subclass of
AnonServerDescription to give
specific details. |
void |
integrityErrorSignaled(int a_iErrorCode) |
static boolean |
isBlockedOnHttpConnectionError() |
boolean |
isConnected()
Returns true if this Anon Service is connected, e.g. initialized and usable
|
boolean |
isSendingControlMessage() |
static boolean |
isTestInstance() |
void |
removeEventListener(AnonServiceEventListener a_eventListener)
Removes an AnonServiceEventListener.
|
void |
removeEventListeners() |
static void |
setBlockOnHttpConnectionError(boolean a_bBlock) |
void |
setDebug(boolean bDebug)
if bDebug==true this client operates in debug modes.
|
void |
setDNSResolver(HTTPClient.IHTTPClientDNSResolver a_dnsResolver) |
void |
setDummyTraffic(int a_interval)
Set the interval after which a dummy is sent
|
void |
setInterfaceBlockTimout(long msTimeOut)
Sets the time [in ms] an interface of a Cascade is block, if a connection
error occurs)
|
static void |
setLoginTimeout(int a_loginTimeoutMS) |
int |
setProxy(IMutableProxyInterface a_proxyInterface)
Sets the settings for the proxy, which should be used to establish network connections
|
void |
setSocketFactory(HTTPClient.HTTPClientSocketFactory socketFactory)
Sets the socket factory to be used in creating sockets to connect to the AnonService.
|
static void |
setTestInstance(boolean a_bTestInstance) |
void |
shutdown(boolean a_bResetTransferredBytes)
Disconnects form the server.
|
static void |
tearDown()
Only for internal cleanup!
|
void |
update(java.util.Observable a_object,
java.lang.Object a_argument) |
public static final int DEFAULT_LOGIN_TIMEOUT
public static final long DEFAULT_BLOCK_TIMEOUT
public AnonClient()
public AnonClient(DirectProxy a_directProxy)
public AnonClient(DirectProxy a_directProxy, anon.transport.connection.IStreamConnection a_theConnection, MixCascade a_currentService)
public void setDebug(boolean bDebug)
public static void setTestInstance(boolean a_bTestInstance)
public static boolean isTestInstance()
public MixCascade getCurrentService()
public void initialize(AnonServerDescription a_mixCascade, IServiceContainer a_serviceContainer, TermsAndConditionConfirmation termsConfirmation, boolean a_bIsReconnect) throws AnonServiceException
AnonService
AnonServerDescription
to give
specific details.
This method must be called before any Channels can be created.initialize
in interface AnonService
a_mixCascade
- Parameters describing the service configuration.AnonServiceException
public static void setLoginTimeout(int a_loginTimeoutMS)
public static void setBlockOnHttpConnectionError(boolean a_bBlock)
public static boolean isBlockedOnHttpConnectionError()
public static int getLoginTimeout()
public int setProxy(IMutableProxyInterface a_proxyInterface)
AnonService
setProxy
in interface AnonService
public void shutdown(boolean a_bResetTransferredBytes)
AnonService
shutdown
in interface AnonService
public boolean isConnected()
AnonService
isConnected
in interface AnonService
public boolean isSendingControlMessage()
public AnonChannel createChannel(int a_type) throws java.net.ConnectException
AnonService
createChannel
in interface AnonService
a_type
- the type of the created channel; See AnonChannel
AnonChannel
, useful for data transmissionjava.net.ConnectException
public void addEventListener(AnonServiceEventListener a_eventListener)
AnonService
AnonServiceEventListener
.addEventListener
in interface AnonService
a_eventListener
- Listener to addpublic void removeEventListeners()
removeEventListeners
in interface AnonService
public void removeEventListener(AnonServiceEventListener a_eventListener)
AnonService
removeEventListener
in interface AnonService
a_eventListener
- Listener, which will be removedpublic void update(java.util.Observable a_object, java.lang.Object a_argument)
update
in interface java.util.Observer
public void dataChainErrorSignaled(AnonServiceException a_e)
dataChainErrorSignaled
in interface DataChainErrorListener
public void integrityErrorSignaled(int a_iErrorCode)
integrityErrorSignaled
in interface IntegrityErrorListener
public void setDummyTraffic(int a_interval)
a_interval
- The new dummy traffic interval in milliseconds or @see DummyTrafficControlChannel.DT_DISABLE,
if dummy traffic shall be disabled.public void setInterfaceBlockTimout(long msTimeOut)
ms
- block timeout in mspublic SocketHandler getConnectionToMixCascade()
public void setSocketFactory(HTTPClient.HTTPClientSocketFactory socketFactory)
AnonService
setSocketFactory
in interface AnonService
socketFactory
- socket factory used to create sockets, if NULL the default socket factory of the JRE is used.public void setDNSResolver(HTTPClient.IHTTPClientDNSResolver a_dnsResolver)
public static void tearDown()
Copyright © 2023. All rights reserved.