net.sf.dict4j
Class DictTransportDefault

java.lang.Object
  extended by net.sf.dict4j.DictTransportDefault
All Implemented Interfaces:
DictTransport

public class DictTransportDefault
extends java.lang.Object
implements DictTransport


Constructor Summary
DictTransportDefault(java.net.InetAddress address)
           
DictTransportDefault(java.net.InetAddress address, int port)
           
DictTransportDefault(java.lang.String address)
           
DictTransportDefault(java.lang.String address, int port)
           
 
Method Summary
static void closeQuietly(java.io.Closeable closeable)
          Unconditionally close an Closeable.
 java.lang.String connect()
           
 void disconnect()
           
 java.lang.String receiveLine()
           
 java.lang.String receiveResponse()
           
 void sendCommand(java.lang.String string)
           
static void setLogAppender(DictLogAppender appender)
           
 void setSocketConnectTimeout(int socketConnectTimeout)
           
 void setSocketSoTimeout(int socketSoTimeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictTransportDefault

public DictTransportDefault(java.net.InetAddress address,
                            int port)

DictTransportDefault

public DictTransportDefault(java.net.InetAddress address)

DictTransportDefault

public DictTransportDefault(java.lang.String address)
                     throws DictTransportException
Throws:
DictTransportException

DictTransportDefault

public DictTransportDefault(java.lang.String address,
                            int port)
                     throws DictTransportException
Throws:
DictTransportException
Method Detail

setSocketSoTimeout

public void setSocketSoTimeout(int socketSoTimeout)

setSocketConnectTimeout

public void setSocketConnectTimeout(int socketConnectTimeout)

setLogAppender

public static void setLogAppender(DictLogAppender appender)
Parameters:
appender - Log appender

connect

public java.lang.String connect()
                         throws DictTransportException
Specified by:
connect in interface DictTransport
Throws:
DictTransportException

disconnect

public void disconnect()
Specified by:
disconnect in interface DictTransport

sendCommand

public void sendCommand(java.lang.String string)
Specified by:
sendCommand in interface DictTransport

receiveLine

public java.lang.String receiveLine()
Specified by:
receiveLine in interface DictTransport

receiveResponse

public java.lang.String receiveResponse()
                                 throws DictTransportException
Specified by:
receiveResponse in interface DictTransport
Throws:
DictTransportException

closeQuietly

public static void closeQuietly(java.io.Closeable closeable)
Unconditionally close an Closeable.

Parameters:
closeable - the Closeable to close, may be null or already closed