toolbox.allegato
Class SocketConfig

Package class diagram package SocketConfig
java.lang.Object
  extended by toolbox.allegato.SocketConfig

public class SocketConfig
extends java.lang.Object

Encapsulates the configuration of a client socket connection. The class provides access to all socket parameters specified in a XML element or set using the set methods.

The class also provides a method to establish the client socket connection.


Constructor Summary
SocketConfig()
          Default constructor
SocketConfig(java.lang.String name, XMLProperties xmlProps)
          Initialises this socket configuration object with the given XML configuration data.
 
Method Summary
 java.net.Socket createSocket()
          Create and return a Socket instance using the configuration properties of this configuration object.
 java.lang.Integer getConnectTimeout()
          Return the ConnectTimeout property.
 java.lang.String getHost()
          Return the host name property.
 java.lang.Integer getPort()
          Return the port property.
 java.lang.Boolean getSOKeepAlive()
          Return the SOKeepAlive property.
 java.lang.Integer getSOLinger()
          Return the SOLinger property.
 java.lang.Integer getSOReceiveBufSize()
          Return the SOReceiveBufSize property.
 java.lang.Integer getSOSendBufSize()
          Return the SOSendBufSize property.
 java.lang.Integer getSOTimeout()
          Return the SOTimeout property.
 java.lang.Boolean getTCPNoDelay()
          Return the TCPNoDelay property.
 void setConnectTimeout(java.lang.Integer connectTimeout)
          Set the ConnectTimeout property.
 void setHost(java.lang.String host)
          Set the host name property.
 void setPort(java.lang.Integer port)
          Set the port property.
 void setSOKeepAlive(java.lang.Boolean soKeepAlive)
          Set the SOKeepAlive property.
 void setSOLinger(java.lang.Integer soLinger)
          Set the SOLinger property.
 void setSOReceiveBufSize(java.lang.Integer soReceiveBufSize)
          Set the SOReceiveBufSize property.
 void setSOSendBufSize(java.lang.Integer soSendBufSize)
          Set the SOSendBufSize property.
 void setSOTimeout(java.lang.Integer soTimeout)
          Set the SOTimeout property.
 void setTCPNoDelay(java.lang.Boolean tcpNoDelay)
          Set the TCPNoDelay property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketConfig

public SocketConfig()
Default constructor


SocketConfig

public SocketConfig(java.lang.String name,
                    XMLProperties xmlProps)
             throws ConfException
Initialises this socket configuration object with the given XML configuration data.

Parameters:
name - String containing the name of the SocketConfig configuration element.
xmlProps - XML coinfiguration properties containing a valid SocketConfig element.
Throws:
ConfException - if this config object cannot be initialised.
Method Detail

setHost

public void setHost(java.lang.String host)
Set the host name property.

Parameters:
host - String containing the host name property.

getHost

public java.lang.String getHost()
Return the host name property.

Returns:
String containing the host name property.

setPort

public void setPort(java.lang.Integer port)
Set the port property.

Parameters:
port - Integer containing the port property.

getPort

public java.lang.Integer getPort()
Return the port property.

Returns:
Integer containing the port property.

setSOLinger

public void setSOLinger(java.lang.Integer soLinger)
Set the SOLinger property.

Parameters:
soLinger - Integer containing the SOLinger property.

getSOLinger

public java.lang.Integer getSOLinger()
Return the SOLinger property.

Returns:
Integer containing the SOLinger property.

setSOReceiveBufSize

public void setSOReceiveBufSize(java.lang.Integer soReceiveBufSize)
Set the SOReceiveBufSize property.

Parameters:
soReceiveBufSize - Integer containing the SOReceiveBufSize property.

getSOReceiveBufSize

public java.lang.Integer getSOReceiveBufSize()
Return the SOReceiveBufSize property.

Returns:
Integer containing the SOReceiveBufSize property.

setSOSendBufSize

public void setSOSendBufSize(java.lang.Integer soSendBufSize)
Set the SOSendBufSize property.

Parameters:
soSendBufSize - Integer containing the SOSendBufSize property.

getSOSendBufSize

public java.lang.Integer getSOSendBufSize()
Return the SOSendBufSize property.

Returns:
Integer containing the SOSendBufSize property.

setSOTimeout

public void setSOTimeout(java.lang.Integer soTimeout)
Set the SOTimeout property.

Parameters:
soTimeout - Integer containing the SOTimeout property.

getSOTimeout

public java.lang.Integer getSOTimeout()
Return the SOTimeout property.

Returns:
Integer containing the SOTimeout property.

setSOKeepAlive

public void setSOKeepAlive(java.lang.Boolean soKeepAlive)
Set the SOKeepAlive property.

Parameters:
soKeepAlive - Boolean containing the SOKeepAlive property.

getSOKeepAlive

public java.lang.Boolean getSOKeepAlive()
Return the SOKeepAlive property.

Returns:
Boolean containing the SOKeepAlive property.

setConnectTimeout

public void setConnectTimeout(java.lang.Integer connectTimeout)
Set the ConnectTimeout property.

Parameters:
connectTimeout - Integer containing the ConnectTimeout property.

getConnectTimeout

public java.lang.Integer getConnectTimeout()
Return the ConnectTimeout property.

Returns:
Integer containing the ConnectTimeout property.

setTCPNoDelay

public void setTCPNoDelay(java.lang.Boolean tcpNoDelay)
Set the TCPNoDelay property.

Parameters:
tcpNoDelay - Boolean containing the TCPNoDelay property.

getTCPNoDelay

public java.lang.Boolean getTCPNoDelay()
Return the TCPNoDelay property.

Returns:
Boolean containing the TCPNoDelay property.

createSocket

public java.net.Socket createSocket()
                             throws java.io.IOException
Create and return a Socket instance using the configuration properties of this configuration object.

Returns:
Socket instance.
Throws:
IOExcption - if the socket connection cannot be established.
java.io.IOException