rero.net
Class SocketConnection

java.lang.Object
  extended byrero.net.SocketConnection
All Implemented Interfaces:
ClientStateListener, Runnable

public class SocketConnection
extends Object
implements Runnable, ClientStateListener


Field Summary
protected  Socket aSocket
           
protected  BufferedReader aSocketInput
           
protected  PrintStream aSocketOutput
           
protected  SocketInformation connectionInformation
           
protected  long delay
           
protected  Thread readThread
           
 
Constructor Summary
SocketConnection()
           
 
Method Summary
 void addSocketDataListener(SocketDataListener l)
           
 void addSocketStatusListener(SocketStatusListener l)
           
 void connect(String host, int port)
           
 void connect(String host, int port, long _delay, String password, boolean secure)
           
 void disconnect()
           
 void fireReadEvent(String message)
           
 void fireStatusEvent(String message, boolean isConnected)
           
 SocketInformation getSocketInformation()
           
 void println(String message)
           
 void propertyChanged(String property, String value)
          when the property gets changed you will be notified!
 void removeSocketDataListener(SocketDataListener l)
           
 void removeSocketStatusListener(SocketStatusListener l)
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aSocket

protected Socket aSocket

readThread

protected Thread readThread

aSocketOutput

protected PrintStream aSocketOutput

aSocketInput

protected BufferedReader aSocketInput

delay

protected long delay

connectionInformation

protected SocketInformation connectionInformation
Constructor Detail

SocketConnection

public SocketConnection()
Method Detail

propertyChanged

public void propertyChanged(String property,
                            String value)
Description copied from interface: ClientStateListener
when the property gets changed you will be notified!

Specified by:
propertyChanged in interface ClientStateListener

println

public void println(String message)

disconnect

public void disconnect()

connect

public void connect(String host,
                    int port)

connect

public void connect(String host,
                    int port,
                    long _delay,
                    String password,
                    boolean secure)

run

public void run()
Specified by:
run in interface Runnable

getSocketInformation

public SocketInformation getSocketInformation()

removeSocketStatusListener

public void removeSocketStatusListener(SocketStatusListener l)

removeSocketDataListener

public void removeSocketDataListener(SocketDataListener l)

addSocketStatusListener

public void addSocketStatusListener(SocketStatusListener l)

addSocketDataListener

public void addSocketDataListener(SocketDataListener l)

fireStatusEvent

public void fireStatusEvent(String message,
                            boolean isConnected)

fireReadEvent

public void fireReadEvent(String message)