eneter.messaging.messagingsystems.tcpmessagingsystem
Interface IClientSecurityFactory

All Known Implementing Classes:
NoneSecurityClientFactory, SslClientFactory

public interface IClientSecurityFactory

Creates client socket. The factory is used by TcpMessagingSystem to create the client socket.


Method Summary
 java.net.Socket createClientSocket(java.net.InetSocketAddress socketAddress)
          Creates the client socket.
 int getConnectionTimeout()
          Returns open connection timeout.
 int getReceiveBufferSize()
          Returns the size of the receiving buffer in bytes.
 int getReceiveTimeout()
          Returns timeout setup for receiving a message.
 int getResponseReceiverPort()
          Gets the port which shall be used for receiving response messages in output channels.
 boolean getReuseAddress()
          Gets the flag indicating whether the socket can be bound to the address which is already in use.
 int getSendBufferSize()
          Returns the size of the sending buffer in bytes.
 int getSendTimeout()
          Returns timeout setup for sending a message.
 void setConnectionTimeout(int connectionTimeout)
          Sets open connection timeout in milliseconds.
 void setReceiveBufferSize(int bufferSize)
          Sets the size of receiving buffer in bytes.
 void setReceiveTimeout(int receiveTimeout)
          Sets timeout for receiving a message.
 void setResponseReceiverPort(int port)
          Sets or gets the port which shall be used for receiving response messages in output channels.
 void setReuseAddress(boolean allowReuseAddress)
          Sets the flag indicating whether the socket can be bound to the address which is already in use.
 void setSendBufferSize(int bufferSize)
          Sets the size of sending buffer in bytes.
 void setSendTimeout(int sendTimeout)
          Sets timeout for sending a message.
 

Method Detail

createClientSocket

java.net.Socket createClientSocket(java.net.InetSocketAddress socketAddress)
                                   throws java.lang.Exception
Creates the client socket.

Parameters:
socketAddress - address
Returns:
client socket
Throws:
java.lang.Exception

setConnectionTimeout

void setConnectionTimeout(int connectionTimeout)
Sets open connection timeout in milliseconds.

Parameters:
connectionTimeout - timeout in milliseconds. 0 means infinite time (use 30000 by default)

getConnectionTimeout

int getConnectionTimeout()
Returns open connection timeout.

Returns:
connection timeout in milliseconds.

setSendTimeout

void setSendTimeout(int sendTimeout)
Sets timeout for sending a message. 0 means infinite time (use 30000 by default)

Parameters:
sendTimeout -

getSendTimeout

int getSendTimeout()
Returns timeout setup for sending a message.

Returns:
sending timeout in milliseconds

setReceiveTimeout

void setReceiveTimeout(int receiveTimeout)
Sets timeout for receiving a message. 0 means infinite time (use 30000 by default)

Parameters:
receiveTimeout -

getReceiveTimeout

int getReceiveTimeout()
Returns timeout setup for receiving a message.

Returns:
receiving timeout in milliseconds

setSendBufferSize

void setSendBufferSize(int bufferSize)
Sets the size of sending buffer in bytes.

Parameters:
bufferSize - size of the buffer in bytes. (use 8192 by default)

getSendBufferSize

int getSendBufferSize()
Returns the size of the sending buffer in bytes.

Returns:
size of the sending buffer

setReceiveBufferSize

void setReceiveBufferSize(int bufferSize)
Sets the size of receiving buffer in bytes.

Parameters:
bufferSize - size of the buffer in bytes. (use 8192 by default)

getReceiveBufferSize

int getReceiveBufferSize()
Returns the size of the receiving buffer in bytes.

Returns:
size of the receiving buffer

setReuseAddress

void setReuseAddress(boolean allowReuseAddress)
Sets the flag indicating whether the socket can be bound to the address which is already in use.

Parameters:
allowReuseAddress - true if the socket can be bound to the address which is already in use.

getReuseAddress

boolean getReuseAddress()
Gets the flag indicating whether the socket can be bound to the address which is already in use.

Returns:
true if the socket can be bound to the address which is already in use.

setResponseReceiverPort

void setResponseReceiverPort(int port)
Sets or gets the port which shall be used for receiving response messages in output channels. When a client connects an IP address and port a random free port is assigned for receiving messages. This property allows to use a specific port instead of random one.

Default value is -1 which means a random free port is chosen for receiving response messages.

Parameters:
port - port which shall be used for receiving response messages in the output channel.

getResponseReceiverPort

int getResponseReceiverPort()
Gets the port which shall be used for receiving response messages in output channels. If the value is -1 it means a random free port is chosen for receiving response messages.

Returns:
port which shall be used for receiving response messages in the output channel.