com.aelitis.azureus.core.clientmessageservice.secure.impl
Class SecureMessageServiceClientHelper

java.lang.Object
  extended by com.aelitis.azureus.core.clientmessageservice.secure.impl.SecureMessageServiceClientHelper
All Implemented Interfaces:
ClientMessageService

public class SecureMessageServiceClientHelper
extends java.lang.Object
implements ClientMessageService


Constructor Summary
protected SecureMessageServiceClientHelper(java.lang.String server_address, int server_port, int timeout_secs, java.lang.String msg_type_id, java.security.interfaces.RSAPublicKey public_key)
           
 
Method Summary
 void close()
          Drop and closedown the connection with the server.
static ClientMessageService getServerService(java.lang.String server_address, int server_port, int timeout_secs, java.lang.String msg_type_id, java.security.interfaces.RSAPublicKey public_key)
           
 java.util.Map receiveMessage()
          Receive the next message from the server.
 void sendMessage(java.util.Map plain_payload)
          Send the given message to the server service.
 void setMaximumMessageSize(int max_bytes)
          Override the default max message size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureMessageServiceClientHelper

protected SecureMessageServiceClientHelper(java.lang.String server_address,
                                           int server_port,
                                           int timeout_secs,
                                           java.lang.String msg_type_id,
                                           java.security.interfaces.RSAPublicKey public_key)
                                    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getServerService

public static ClientMessageService getServerService(java.lang.String server_address,
                                                    int server_port,
                                                    int timeout_secs,
                                                    java.lang.String msg_type_id,
                                                    java.security.interfaces.RSAPublicKey public_key)
                                             throws java.io.IOException
Throws:
java.io.IOException

sendMessage

public void sendMessage(java.util.Map plain_payload)
                 throws java.io.IOException
Description copied from interface: ClientMessageService
Send the given message to the server service. NOTE: blocking op

Specified by:
sendMessage in interface ClientMessageService
Parameters:
plain_payload - (bencode-able) to send
Throws:
java.io.IOException - on error

receiveMessage

public java.util.Map receiveMessage()
                             throws java.io.IOException
Description copied from interface: ClientMessageService
Receive the next message from the server. NOTE: blocking op

Specified by:
receiveMessage in interface ClientMessageService
Returns:
message received
Throws:
java.io.IOException - on error

close

public void close()
Description copied from interface: ClientMessageService
Drop and closedown the connection with the server.

Specified by:
close in interface ClientMessageService

setMaximumMessageSize

public void setMaximumMessageSize(int max_bytes)
Description copied from interface: ClientMessageService
Override the default max message size

Specified by:
setMaximumMessageSize in interface ClientMessageService