org.indy
Class TCPClient

java.lang.Object
  |
  +--org.indy.BaseComponent
        |
        +--org.indy.IndyComponent
              |
              +--org.indy.TCPClient
Direct Known Subclasses:
MessageClient, TelnetClient

public class TCPClient
extends IndyComponent

Description of the Class

Author:
owen

Inner classes inherited from class org.indy.IndyComponent
IndyComponent.WorkMode
 
Field Summary
protected  java.lang.String boundIP
          Description of the Field
protected  int boundPort
          Description of the Field
protected  Connection connection
          DOCUMENT ME!
protected  java.lang.String host
          Description of the Field
protected  IOHandlerSocket ioHandler
          DOCUMENT ME!
protected  javax.swing.event.EventListenerList listenerList
          DOCUMENT ME!
protected  java.lang.String password
          Description of the Field
protected  int port
          Description of the Field
protected  java.lang.String username
          Description of the Field
 
Constructor Summary
TCPClient()
          Constructor for the IdTCPClient object
 
Method Summary
 void addTCPClientListener(TCPClientListener l)
          DOCUMENT ME!
 java.lang.String allData()
          DOCUMENT ME!
 void connect()
          Description of the Method
 void connect(int timeout)
          Description of the Method
 java.lang.String connectAndGetAll()
          Description of the Method
 byte[] currentReadBuffer()
          DOCUMENT ME!
 void disconnect()
          DOCUMENT ME!
 java.lang.String getBoundIP()
          Gets the boundIP attribute of the IdTCPClient object
 int getBoundPort()
          Gets the boundPort attribute of the IdTCPClient object
 java.lang.String getHost()
          Gets the host attribute of the IdTCPClient object
 IOHandlerSocket getIOHandler()
          DOCUMENT ME!
 int getMaximumLineLength()
          DOCUMENT ME!
 java.lang.String getPassword()
          Gets the password attribute of the IdTCPClient object
 int getPort()
          Gets the port attribute of the IdTCPClient object
 int getReadTimeOut()
          DOCUMENT ME!
 java.lang.String getUsername()
          Gets the username attribute of the IdTCPClient object
 boolean isConnected()
          DOCUMENT ME!
 void readBuffer(byte[] b, int len)
          DOCUMENT ME!
 char readChar()
          DOCUMENT ME!
 int readInt()
          DOCUMENT ME!
 java.lang.String readLine()
          DOCUMENT ME!
 java.lang.String readLine(int timeout, int maxLineLength)
          DOCUMENT ME!
 java.lang.String readLineWait()
          DOCUMENT ME!
 java.lang.String readLineWait(int failCount)
          DOCUMENT ME!
 long readLong()
          DOCUMENT ME!
 short readShort()
          DOCUMENT ME!
 java.io.InputStream readStream(int byteCount, boolean readUntilDisconnect)
          DOCUMENT ME!
 void removeTCPClientListener(TCPClientListener l)
          DOCUMENT ME!
 void setBoundIP(java.lang.String newBoundIP)
          Sets the boundIP attribute of the IdTCPClient object
 void setBoundPort(int port)
          Sets the boundPort attribute of the IdTCPClient object
 void setHost(java.lang.String newHost)
          Sets the host attribute of the IdTCPClient object
 void setIOHandler(IOHandlerSocket ioHandler)
          DOCUMENT ME!
 void setMaximumLineLength(int newLen)
          DOCUMENT ME!
 void setPassword(java.lang.String newPassword)
          Sets the password attribute of the IdTCPClient object
 void setPort(int newPort)
          Sets the port attribute of the IdTCPClient object
 void setReadTimeOut(int timeout)
          DOCUMENT ME!
 void setUsername(java.lang.String newUsername)
          Sets the username attribute of the IdTCPClient object
 void write(java.lang.String s)
          DOCUMENT ME!
 void writeBuffer(byte[] buf)
          DOCUMENT ME!
 void writeFile(java.io.File f)
          DOCUMENT ME!
 void writeHeader(StringList header)
          DOCUMENT ME!
 void writeInt(int value)
          DOCUMENT ME!
 void writeLine(java.lang.String line)
          DOCUMENT ME!
 void writeLong(long value)
          DOCUMENT ME!
 void writeRFCReply(RFCReply reply)
          DOCUMENT ME!
 void writeRFCStrings(StringList strings)
          DOCUMENT ME!
 void writeShort(short value)
          DOCUMENT ME!
 void writeStream(java.io.InputStream stream, int len, boolean writeByteCount)
          DOCUMENT ME!
 void writeStrings(StringList strings, boolean writeLineCount)
          DOCUMENT ME!
 
Methods inherited from class org.indy.IndyComponent
addComponentListener, doBeginWork, doBeginWork, doEndWork, doStatus, doStatus, doWork, getLocalName, removeComponentListener
 
Methods inherited from class org.indy.BaseComponent
getVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected javax.swing.event.EventListenerList listenerList
DOCUMENT ME!

host

protected java.lang.String host
Description of the Field

port

protected int port
Description of the Field

boundIP

protected java.lang.String boundIP
Description of the Field

boundPort

protected int boundPort
Description of the Field

username

protected java.lang.String username
Description of the Field

password

protected java.lang.String password
Description of the Field

ioHandler

protected IOHandlerSocket ioHandler
DOCUMENT ME!

connection

protected Connection connection
DOCUMENT ME!
Constructor Detail

TCPClient

public TCPClient()
Constructor for the IdTCPClient object
Method Detail

connect

public void connect()
             throws IndyException
Description of the Method
Throws:
IdException - Description of the Exception

connect

public void connect(int timeout)
             throws IndyException
Description of the Method
Parameters:
timeout - Description of the Parameter
Throws:
IdException - Description of the Exception

connectAndGetAll

public java.lang.String connectAndGetAll()
Description of the Method
Returns:
Description of the Return Value

readLineWait

public java.lang.String readLineWait(int failCount)
                              throws IndyIOException,
                                     ReadTimedOutException,
                                     PeerDisconnectedException,
                                     MaxLineLengthExceededException,
                                     NotConnectedException
DOCUMENT ME!
Parameters:
failCount - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
IndyIOException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
PeerDisconnectedException - DOCUMENT ME!
MaxLineLengthExceededException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

readLineWait

public java.lang.String readLineWait()
                              throws IndyIOException,
                                     ReadTimedOutException,
                                     PeerDisconnectedException,
                                     MaxLineLengthExceededException,
                                     NotConnectedException
DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
IndyIOException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
PeerDisconnectedException - DOCUMENT ME!
MaxLineLengthExceededException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

readLine

public java.lang.String readLine()
                          throws PeerDisconnectedException,
                                 ReadTimedOutException,
                                 IndyIOException,
                                 MaxLineLengthExceededException,
                                 NotConnectedException
DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
MaxLineLengthExceededException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

readLine

public java.lang.String readLine(int timeout,
                                 int maxLineLength)
                          throws IndyIOException,
                                 ReadTimedOutException,
                                 PeerDisconnectedException,
                                 NotConnectedException,
                                 MaxLineLengthExceededException
DOCUMENT ME!
Parameters:
timeout - DOCUMENT ME!
maxLineLength - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
IndyIOException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
PeerDisconnectedException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!
MaxLineLengthExceededException - DOCUMENT ME!

readBuffer

public void readBuffer(byte[] b,
                       int len)
                throws PeerDisconnectedException,
                       ReadTimedOutException,
                       IndyIOException,
                       NotConnectedException
DOCUMENT ME!
Parameters:
b - DOCUMENT ME!
len - DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

readInt

public int readInt()
            throws PeerDisconnectedException,
                   ReadTimedOutException,
                   IndyIOException,
                   NotConnectedException
DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

readLong

public long readLong()
              throws PeerDisconnectedException,
                     ReadTimedOutException,
                     IndyIOException,
                     NotConnectedException
DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

readChar

public char readChar()
              throws PeerDisconnectedException,
                     ReadTimedOutException,
                     IndyIOException,
                     NotConnectedException
DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

readShort

public short readShort()
                throws PeerDisconnectedException,
                       ReadTimedOutException,
                       IndyIOException,
                       NotConnectedException
DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

readStream

public java.io.InputStream readStream(int byteCount,
                                      boolean readUntilDisconnect)
                               throws PeerDisconnectedException,
                                      ReadTimedOutException,
                                      NotConnectedException,
                                      IndyIOException
DOCUMENT ME!
Parameters:
byteCount - DOCUMENT ME!
readUntilDisconnect - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!

writeRFCStrings

public void writeRFCStrings(StringList strings)
                     throws IndyException
DOCUMENT ME!
Parameters:
strings - DOCUMENT ME!
Throws:
IndyException - DOCUMENT ME!

writeRFCReply

public void writeRFCReply(RFCReply reply)
                   throws IndyException
DOCUMENT ME!
Parameters:
reply - DOCUMENT ME!
Throws:
IndyException - DOCUMENT ME!

write

public void write(java.lang.String s)
           throws IndyIOException,
                  PeerDisconnectedException,
                  NotConnectedException
DOCUMENT ME!
Parameters:
s - DOCUMENT ME!
Throws:
IndyIOException - DOCUMENT ME!
PeerDisconnectedException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

writeBuffer

public void writeBuffer(byte[] buf)
                 throws IndyIOException,
                        PeerDisconnectedException,
                        NotConnectedException
DOCUMENT ME!
Parameters:
buf - DOCUMENT ME!
Throws:
IndyIOException - DOCUMENT ME!
PeerDisconnectedException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

writeLine

public void writeLine(java.lang.String line)
               throws IndyIOException,
                      PeerDisconnectedException,
                      NotConnectedException
DOCUMENT ME!
Parameters:
line - DOCUMENT ME!
Throws:
IndyIOException - DOCUMENT ME!
PeerDisconnectedException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

writeHeader

public void writeHeader(StringList header)
                 throws PeerDisconnectedException,
                        IndyIOException,
                        NotConnectedException
DOCUMENT ME!
Parameters:
header - DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

writeInt

public void writeInt(int value)
              throws PeerDisconnectedException,
                     IndyIOException,
                     NotConnectedException
DOCUMENT ME!
Parameters:
value - DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

writeLong

public void writeLong(long value)
               throws PeerDisconnectedException,
                      IndyIOException,
                      NotConnectedException
DOCUMENT ME!
Parameters:
value - DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

writeShort

public void writeShort(short value)
                throws PeerDisconnectedException,
                       IndyIOException,
                       NotConnectedException
DOCUMENT ME!
Parameters:
value - DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

writeStrings

public void writeStrings(StringList strings,
                         boolean writeLineCount)
                  throws PeerDisconnectedException,
                         IndyIOException,
                         NotConnectedException
DOCUMENT ME!
Parameters:
strings - DOCUMENT ME!
writeLineCount - DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

writeStream

public void writeStream(java.io.InputStream stream,
                        int len,
                        boolean writeByteCount)
                 throws PeerDisconnectedException,
                        IndyIOException,
                        NotConnectedException
DOCUMENT ME!
Parameters:
stream - DOCUMENT ME!
len - DOCUMENT ME!
writeByteCount - DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

writeFile

public void writeFile(java.io.File f)
               throws java.io.FileNotFoundException,
                      PeerDisconnectedException,
                      IndyIOException,
                      NotConnectedException
DOCUMENT ME!
Parameters:
f - DOCUMENT ME!
Throws:
java.io.FileNotFoundException - DOCUMENT ME!
PeerDisconnectedException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

currentReadBuffer

public byte[] currentReadBuffer()
                         throws PeerDisconnectedException,
                                IndyIOException
DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!

allData

public java.lang.String allData()
                         throws PeerDisconnectedException,
                                ReadTimedOutException,
                                IndyIOException,
                                NotConnectedException
DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
PeerDisconnectedException - DOCUMENT ME!
ReadTimedOutException - DOCUMENT ME!
IndyIOException - DOCUMENT ME!
NotConnectedException - DOCUMENT ME!

disconnect

public void disconnect()
                throws IndyIOException
DOCUMENT ME!
Throws:
IndyIOException - DOCUMENT ME!

addTCPClientListener

public void addTCPClientListener(TCPClientListener l)
DOCUMENT ME!
Parameters:
l - DOCUMENT ME!

removeTCPClientListener

public void removeTCPClientListener(TCPClientListener l)
DOCUMENT ME!
Parameters:
l - DOCUMENT ME!

setBoundIP

public void setBoundIP(java.lang.String newBoundIP)
Sets the boundIP attribute of the IdTCPClient object
Parameters:
newBoundIP - The new boundIP value

setBoundPort

public void setBoundPort(int port)
Sets the boundPort attribute of the IdTCPClient object
Parameters:
port - The new boundPort value

setHost

public void setHost(java.lang.String newHost)
Sets the host attribute of the IdTCPClient object
Parameters:
newHost - The new host value

setPort

public void setPort(int newPort)
Sets the port attribute of the IdTCPClient object
Parameters:
newPort - The new port value

setUsername

public void setUsername(java.lang.String newUsername)
Sets the username attribute of the IdTCPClient object
Parameters:
newUsername - The new username value

setPassword

public void setPassword(java.lang.String newPassword)
Sets the password attribute of the IdTCPClient object
Parameters:
newPassword - The new password value

setMaximumLineLength

public void setMaximumLineLength(int newLen)
DOCUMENT ME!
Parameters:
newLen - DOCUMENT ME!

setReadTimeOut

public void setReadTimeOut(int timeout)
                    throws IndyIOException
DOCUMENT ME!
Parameters:
timeout - DOCUMENT ME!
Throws:
IndyIOException - DOCUMENT ME!

setIOHandler

public void setIOHandler(IOHandlerSocket ioHandler)
DOCUMENT ME!
Parameters:
ioHandler - DOCUMENT ME!

getBoundIP

public java.lang.String getBoundIP()
Gets the boundIP attribute of the IdTCPClient object
Returns:
The boundIP value

getBoundPort

public int getBoundPort()
Gets the boundPort attribute of the IdTCPClient object
Returns:
The boundPort value

getHost

public java.lang.String getHost()
Gets the host attribute of the IdTCPClient object
Returns:
The host value

getPort

public int getPort()
Gets the port attribute of the IdTCPClient object
Returns:
The port value

getUsername

public java.lang.String getUsername()
Gets the username attribute of the IdTCPClient object
Returns:
The username value

getPassword

public java.lang.String getPassword()
Gets the password attribute of the IdTCPClient object
Returns:
The password value

getMaximumLineLength

public int getMaximumLineLength()
DOCUMENT ME!
Returns:
DOCUMENT ME!

getReadTimeOut

public int getReadTimeOut()
                   throws IndyIOException
DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
IndyIOException - DOCUMENT ME!

isConnected

public boolean isConnected()
DOCUMENT ME!
Returns:
DOCUMENT ME!

getIOHandler

public IOHandlerSocket getIOHandler()
DOCUMENT ME!
Returns:
DOCUMENT ME!


Copyright © 2002-2002 IndyJ. All Rights Reserved.