Class TelnetWrapper
java.lang.Object
ecmwf.common.telnet.TelnetClientHandler
ecmwf.common.telnet.TelnetWrapper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
The host.protected InputStream
The in.protected OutputStream
The out.protected int
The port.protected Socket
The socket.protected String
The terminal.protected TelnetDimension
The window size.Fields inherited from class ecmwf.common.telnet.TelnetClientHandler
TELOPT_BINARY, TELOPT_ECHO, TELOPT_EOR, TELOPT_NAWS, TELOPT_SGA, TELOPT_TTYPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(InputStream in, OutputStream out) Connect.void
Connect.void
Connect.void
Disconnect.Gets the ios log.Gets the socket.Gets the terminal type.Gets the window size.boolean
Checks if is connected.void
Login.void
Notify end of record.int
read
(byte[] b) Read.void
recordIos
(boolean recordIos) Record ios.Sends the.void
setLocalEcho
(boolean echo) Sets the local echo.void
Sets the prompt.void
setTerminalType
(String terminal) Sets the terminal type.void
setWindowSize
(int X, int Y) Sets the window size.Waitfor.void
write
(byte[] b) Write.Methods inherited from class ecmwf.common.telnet.TelnetClientHandler
inputfeed, negotiate, reset, sendDisplayLocation, sendEnv, sendOption, sendOptionRequest, sendTelnetControl, setCR, setCRLF, startup, subNegotiation, transpose
-
Field Details
-
in
The in. -
out
The out. -
socket
The socket. -
host
The host. -
port
protected int portThe port. -
terminal
The terminal. -
windowSize
The window size.
-
-
Constructor Details
-
TelnetWrapper
public TelnetWrapper()Instantiates a new telnet wrapper.
-
-
Method Details
-
recordIos
public void recordIos(boolean recordIos) Record ios.- Parameters:
recordIos
- the record ios
-
getIosLog
-
connect
Connect.- Parameters:
host
- the hostport
- the port- Throws:
IOException
- Signals that an I/O exception has occurred.
-
connect
Connect.- Parameters:
socket
- the socket- Throws:
IOException
- Signals that an I/O exception has occurred.
-
isConnected
public boolean isConnected()Checks if is connected.- Returns:
- true, if is connected
-
connect
Connect.- Parameters:
in
- the inout
- the out- Throws:
IOException
- Signals that an I/O exception has occurred.
-
disconnect
public void disconnect()Disconnect. -
notifyEndOfRecord
public void notifyEndOfRecord()Notify end of record. Notify end of record.- Specified by:
notifyEndOfRecord
in classTelnetClientHandler
-
login
Login.- Parameters:
user
- the userpwd
- the pwd- Throws:
IOException
- Signals that an I/O exception has occurred.
-
setPrompt
-
send
Sends the.- Parameters:
cmd
- the cmd- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
waitfor
Waitfor.- Parameters:
searchElements
- the search elements- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
read
Read.- Parameters:
b
- the b- Returns:
- the int
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
write
Write. Write.- Specified by:
write
in classTelnetClientHandler
- Parameters:
b
- the b- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getTerminalType
Gets the terminal type. Gets the terminal type.- Specified by:
getTerminalType
in classTelnetClientHandler
- Returns:
- the terminal type
-
getWindowSize
Gets the window size. Gets the window size.- Specified by:
getWindowSize
in classTelnetClientHandler
- Returns:
- the window size
-
getSocket
-
setLocalEcho
public void setLocalEcho(boolean echo) Sets the local echo. Sets the local echo.- Specified by:
setLocalEcho
in classTelnetClientHandler
- Parameters:
echo
- the new local echo
-
setTerminalType
Sets the terminal type.- Parameters:
terminal
- the new terminal type
-
setWindowSize
public void setWindowSize(int X, int Y) Sets the window size.- Parameters:
X
- the xY
- the y
-