Class TelnetWrapper
java.lang.Object
ecmwf.common.telnet.TelnetClientHandler
ecmwf.common.telnet.TelnetWrapper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe host.protected InputStreamThe in.protected OutputStreamThe out.protected intThe port.protected SocketThe socket.protected StringThe terminal.protected TelnetDimensionThe 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 TypeMethodDescriptionvoidconnect(InputStream in, OutputStream out) Connect.voidConnect.voidConnect.voidDisconnect.Gets the ios log.Gets the socket.Gets the terminal type.Gets the window size.booleanChecks if is connected.voidLogin.voidNotify end of record.intread(byte[] b) Read.voidrecordIos(boolean recordIos) Record ios.Sends the.voidsetLocalEcho(boolean echo) Sets the local echo.voidSets the prompt.voidsetTerminalType(String terminal) Sets the terminal type.voidsetWindowSize(int X, int Y) Sets the window size.Waitfor.voidwrite(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:
notifyEndOfRecordin 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:
writein 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:
getTerminalTypein classTelnetClientHandler- Returns:
- the terminal type
-
getWindowSize
Gets the window size. Gets the window size.- Specified by:
getWindowSizein classTelnetClientHandler- Returns:
- the window size
-
getSocket
-
setLocalEcho
public void setLocalEcho(boolean echo) Sets the local echo. Sets the local echo.- Specified by:
setLocalEchoin 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
-