Class 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
    Description
    protected static final int
     
    protected static final int
     
    protected static final int
     

    Fields inherited from class org.apache.commons.net.telnet.TelnetClient

    readerThread

    Fields inherited from class org.apache.commons.net.SocketClient

    _defaultPort_, _hostname_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    sendString(String s, boolean echoString)
    Write this string to the telnet session.
    void
    Read from the telnet session until the string we are waiting for is found
    void
    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, registerInputListener, registerNotifHandler, registerSpyStream, sendAYT, sendCommand, sendSubnegotiation, setReaderThread, stopSpyStream, unregisterInputListener, unregisterNotifHandler

    Methods inherited from class org.apache.commons.net.SocketClient

    addProtocolCommandListener, applySocketAttributes, connect, connect, connect, connect, connect, connect, createCommandSupport, fireCommandSent, fireReplyReceived, getCharset, getCharsetName, getCommandSupport, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getProxy, getReceiveBufferSize, getRemoteAddress, getRemotePort, getSendBufferSize, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isAvailable, isConnected, removeProtocolCommandListener, setCharset, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setProxy, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AntTelnetClient

      public AntTelnetClient()
  • Method Details

    • waitForString

      public void waitForString(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(String s, 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 on
      timeout - The maximum number of seconds to wait
    • sendString

      public void sendString(String s, boolean echoString)
      Write this string to the telnet session.
      Parameters:
      s - the string to write
      echoString - if true log the string sent