org.apache.tools.ant.taskdefs.optional.netClass TelnetTask.AntTelnetClient
- java.lang.Object
- org.apache.commons.net.SocketClient
- org.apache.commons.net.telnet.TelnetClient
- org.apache.tools.ant.taskdefs.optional.net.TelnetTask.AntTelnetClient
- Enclosing class:
- TelnetTask
public class TelnetTask.AntTelnetClient extends org.apache.commons.net.telnet.TelnetClient
This class handles the abstraction of the telnet protocol. Currently it is a wrapper around Jakarta Commons Net.
Field Summary
Fields Modifier and Type Field and Description protected static int
TERMINAL_TYPE
protected static int
TERMINAL_TYPE_IS
protected static int
TERMINAL_TYPE_SEND
Constructor Summary
Constructors Constructor and Description AntTelnetClient()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
sendString(java.lang.String s, boolean echoString)
Write this string to the telnet session.void
waitForString(java.lang.String s)
Read from the telnet session until the string we are waiting for is foundvoid
waitForString(java.lang.String s, java.lang.Integer timeout)
Read from the telnet session until the string we are waiting for is found or the timeout has been reached
Methods inherited from class org.apache.commons.net.telnet.TelnetClient
_connectAction_, addOptionHandler, deleteOptionHandler, disconnect, getInputStream, getLocalOptionState, getOutputStream, getReaderThread, getRemoteOptionState, registerNotifHandler, registerSpyStream, sendAYT, setReaderThread, stopSpyStream, unregisterNotifHandler
Methods inherited from class org.apache.commons.net.SocketClient
connect, connect, connect, connect, connect, connect, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isConnected, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
Field Detail
TERMINAL_TYPE
protected static final int TERMINAL_TYPE
- See Also:
- Constant Field Values
TERMINAL_TYPE_SEND
protected static final int TERMINAL_TYPE_SEND
- See Also:
- Constant Field Values
TERMINAL_TYPE_IS
protected static final int TERMINAL_TYPE_IS
- See Also:
- Constant Field Values
Method Detail
waitForString
public void waitForString(java.lang.String s)Read from the telnet session until the string we are waiting for is found
- Parameters:
s
- The string to wait on
waitForString
public void waitForString(java.lang.String s, java.lang.Integer timeout)Read from the telnet session until the string we are waiting for is found or the timeout has been reached
- Parameters:
s
- The string to wait ontimeout
- The maximum number of seconds to wait
sendString
public void sendString(java.lang.String s, boolean echoString)Write this string to the telnet session.
- Parameters:
s
- the string to writeechoString
- if true log the string sent