com.pushtotest.tool.protocolhandler.Telnet
Class TelnetProtocol

java.lang.Object
  extended by com.pushtotest.tool.protocolhandler.Telnet.TelnetProtocol

public class TelnetProtocol
extends java.lang.Object


Field Summary
static char ESCAPE_CHAR
           
static java.lang.String F1
           
static java.lang.String F10
           
static java.lang.String F2
           
static java.lang.String F3
           
static java.lang.String F4
           
static java.lang.String F5
           
static java.lang.String F6
           
static java.lang.String F7
           
static java.lang.String F8
           
static java.lang.String F9
           
protected  ScreenBuffer screen
           
 
Constructor Summary
TelnetProtocol()
          Standard constructor
 
Method Summary
 void connect(java.lang.String server)
          Connects to a server giving the server and using the default (23) port
 void connect(java.lang.String server, int port)
          Connects to a server giving the server and the port
 void disconnect()
          Disconnects to the server.
 ScreenBuffer getScreenBuffer()
          Return the screen buffer
 long getTimeout()
          gets the timeout in seconds
 java.lang.String read()
          read up to 1000 char
 java.lang.String readUntil(java.lang.String pattern)
          Reads until a given pattern in the first 1000 bytes
 void setTimeout(long seconds)
          sets the timeout in miliseconds
 void write(java.lang.String value)
          Write a value and flush the stream
 void writeln(java.lang.String value)
          Write a value a new line and flush the stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ESCAPE_CHAR

public static char ESCAPE_CHAR

F1

public static java.lang.String F1

F2

public static java.lang.String F2

F3

public static java.lang.String F3

F4

public static java.lang.String F4

F5

public static java.lang.String F5

F6

public static java.lang.String F6

F7

public static java.lang.String F7

F8

public static java.lang.String F8

F9

public static java.lang.String F9

F10

public static java.lang.String F10

screen

protected ScreenBuffer screen
Constructor Detail

TelnetProtocol

public TelnetProtocol()
Standard constructor

Method Detail

getScreenBuffer

public ScreenBuffer getScreenBuffer()
Return the screen buffer


connect

public void connect(java.lang.String server,
                    int port)
             throws java.net.SocketException,
                    java.io.IOException
Connects to a server giving the server and the port

Throws:
java.net.SocketException
java.io.IOException

connect

public void connect(java.lang.String server)
             throws java.net.SocketException,
                    java.io.IOException
Connects to a server giving the server and using the default (23) port

Throws:
java.net.SocketException
java.io.IOException

disconnect

public void disconnect()
                throws java.io.IOException
Disconnects to the server.

Throws:
java.io.IOException

setTimeout

public void setTimeout(long seconds)
sets the timeout in miliseconds


getTimeout

public long getTimeout()
gets the timeout in seconds


readUntil

public java.lang.String readUntil(java.lang.String pattern)
                           throws java.lang.Exception
Reads until a given pattern in the first 1000 bytes

Throws:
java.lang.Exception

read

public java.lang.String read()
                      throws java.lang.Exception
read up to 1000 char

Throws:
java.lang.Exception

writeln

public void writeln(java.lang.String value)
             throws java.io.IOException
Write a value a new line and flush the stream

Throws:
java.io.IOException

write

public void write(java.lang.String value)
           throws java.io.IOException
Write a value and flush the stream

Throws:
java.io.IOException