anon.xmlrpc.client
Class AnonServiceImplProxy

java.lang.Object
  extended by anon.xmlrpc.client.AnonServiceImplProxy
All Implemented Interfaces:
AnonService

public class AnonServiceImplProxy
extends java.lang.Object
implements AnonService


Field Summary
(package private)  int m_ClientID
           
(package private)  java.lang.String m_RpcServerHost
           
(package private)  int m_RpcServerPort
           
 
Fields inherited from interface anon.AnonService
ANONLIB_VERSION
 
Constructor Summary
AnonServiceImplProxy(java.lang.String addr, int port)
           
 
Method Summary
 void addEventListener(AnonServiceEventListener l)
          Adds an AnonServiceEventListener.
 AnonChannel createChannel(int type)
          Creates a new AnonChannel, which could be used for transmitting data.
 AnonChannel createChannel(java.lang.String host, int port)
           
private  java.lang.Object doRemote(java.lang.String method, java.util.Vector params)
           
 int initialize(AnonServerDescription mixCascade, IServiceContainer a_serviceContainer, TermsAndConditionConfirmation termsConfirmation)
          Initializes this AnonService.
 boolean isConnected()
          Returns true if this Anon Service is connected, e.g.
protected  int recv(int channelid, byte[] buff, int off, int len)
           
 void removeEventListener(AnonServiceEventListener l)
          Removes an AnonServiceEventListener.
 void removeEventListeners()
           
protected  void send(int channelid, byte[] buff, int off, int len)
           
 int setProxy(IMutableProxyInterface a_Proxy)
          Sets the settings ofr the proxy, which should be used to establish network connections
 void shutdown(boolean a_bResetTransferredBytes)
          Disconnects form the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_RpcServerHost

java.lang.String m_RpcServerHost

m_RpcServerPort

int m_RpcServerPort

m_ClientID

int m_ClientID
Constructor Detail

AnonServiceImplProxy

public AnonServiceImplProxy(java.lang.String addr,
                            int port)
                     throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

initialize

public int initialize(AnonServerDescription 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:
mixCascade - AnonServer to use
Returns:
E_SUCCESS, if the connection could be established

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

setProxy

public int setProxy(IMutableProxyInterface a_Proxy)
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

shutdown

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

Specified by:
shutdown in interface AnonService

createChannel

public AnonChannel createChannel(int 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:
type - the type of the created channel
Returns:
AnonChannel, usefull for data transmisson
Throws:
java.net.ConnectException

createChannel

public AnonChannel createChannel(java.lang.String host,
                                 int port)
                          throws java.net.ConnectException
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

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

removeEventListeners

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

doRemote

private java.lang.Object doRemote(java.lang.String method,
                                  java.util.Vector params)
                           throws java.io.IOException
Throws:
java.io.IOException

send

protected void send(int channelid,
                    byte[] buff,
                    int off,
                    int len)
             throws java.io.IOException
Throws:
java.io.IOException

recv

protected int recv(int channelid,
                   byte[] buff,
                   int off,
                   int len)
            throws java.io.IOException
Throws:
java.io.IOException