Class TelnetHandler
java.lang.Object
ecmwf.common.telnet.TelnetHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char
The Constant AO.static final char
The Constant AYT.static final char
The Constant BEL.static final char
The Constant BRK.static final char
The Constant BS.static final char
The Constant CR.static final char
The Constant DM.static final char
The Constant DO.static final char
The Constant DONT.static final char
The Constant EC.static final char
The Constant ECHO.static final String
The Constant ECHO_ALL.static final String
The Constant ECHO_DIGIT_ONLY.static final String
The Constant ECHO_LETTER_AND_DIGIT_ONLY.static final String
The Constant ECHO_LETTER_ONLY.static final char
The Constant EL.static final char
The Constant ENVIRONMENT.static final char
The Constant FF.static final char
The Constant GA.static final char
The Constant HT.static final char
The Constant IAC.static final char
The Constant IP.static final char
The Constant LF.static final char
The Constant LINEMODE.static final char
The Constant NEW_ENVIRON.static final char
The Constant NOP.static final char
The Constant NUL.static final char
The Constant REMOTE_FLOW_CONTROL.static final char
The Constant SB.static final char
The Constant SE.static final char
The Constant SEND.static final char
The Constant STATUS.static final char
The Constant SUPPRESS_GO_AHEAD.static final char
The Constant TERMINAL_SPEED.static final char
The Constant TERMINAL_TYPE.static final char
The Constant TIMING_MARK.static final char
The Constant WILL.static final char
The Constant WINDOW_SIZE.static final char
The Constant WONT. -
Constructor Summary
ConstructorsConstructorDescriptionTelnetHandler
(InputStream in, OutputStream out) Instantiates a new telnet handler.TelnetHandler
(Socket socket) Instantiates a new telnet handler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close.void
Display.void
flush()
Flush.Gets the input stream.Gets the output stream.getPassword
(int size, String set, String message, File help) Gets the password.getPassword
(int size, String set, String message, String verify, File help) Gets the password.Gets the socket.Gets the terminal.Gets the window size.char
nextChar()
Next char.void
print
(char c) Prints the.void
Prints the.void
println()
Println.void
Println.char
Read char.Read line.Read line.readString
(String message, int size, String set) Read string.readString
(String message, int size, String[] values, int defaultValue) Read string.readString
(String message, int size, String set, String[] values) Read string.readString
(String message, int size, String set, String[] values, int defaultPos) Read string.void
send
(char c) Sends the.void
sendOption
(char option, boolean state) Sends the option.void
sendOptionRequest
(char option, boolean state) Sends the option request.void
setTerminal
(String terminal) Sets the terminal.void
setWindowSize
(Dimension windowSize) Sets the window size.void
subNegotiation
(char option, char param) Sub negotiation.void
subNegotiation
(char option, char[] params) Sub negotiation.
-
Field Details
-
NUL
public static final char NULThe Constant NUL.- See Also:
-
LF
public static final char LFThe Constant LF.- See Also:
-
CR
public static final char CRThe Constant CR.- See Also:
-
BEL
public static final char BELThe Constant BEL.- See Also:
-
BS
public static final char BSThe Constant BS.- See Also:
-
HT
public static final char HTThe Constant HT.- See Also:
-
FF
public static final char FFThe Constant FF.- See Also:
-
BRK
public static final char BRKThe Constant BRK.- See Also:
-
IP
public static final char IPThe Constant IP.- See Also:
-
AO
public static final char AOThe Constant AO.- See Also:
-
AYT
public static final char AYTThe Constant AYT.- See Also:
-
EC
public static final char ECThe Constant EC.- See Also:
-
EL
public static final char ELThe Constant EL.- See Also:
-
NOP
public static final char NOPThe Constant NOP.- See Also:
-
GA
public static final char GAThe Constant GA.- See Also:
-
DM
public static final char DMThe Constant DM.- See Also:
-
IAC
public static final char IACThe Constant IAC.- See Also:
-
SE
public static final char SEThe Constant SE.- See Also:
-
SB
public static final char SBThe Constant SB.- See Also:
-
WILL
public static final char WILLThe Constant WILL.- See Also:
-
WONT
public static final char WONTThe Constant WONT.- See Also:
-
DO
public static final char DOThe Constant DO.- See Also:
-
DONT
public static final char DONTThe Constant DONT.- See Also:
-
SUPPRESS_GO_AHEAD
public static final char SUPPRESS_GO_AHEADThe Constant SUPPRESS_GO_AHEAD.- See Also:
-
STATUS
public static final char STATUSThe Constant STATUS.- See Also:
-
ECHO
public static final char ECHOThe Constant ECHO.- See Also:
-
TIMING_MARK
public static final char TIMING_MARKThe Constant TIMING_MARK.- See Also:
-
TERMINAL_TYPE
public static final char TERMINAL_TYPEThe Constant TERMINAL_TYPE.- See Also:
-
WINDOW_SIZE
public static final char WINDOW_SIZEThe Constant WINDOW_SIZE.- See Also:
-
TERMINAL_SPEED
public static final char TERMINAL_SPEEDThe Constant TERMINAL_SPEED.- See Also:
-
REMOTE_FLOW_CONTROL
public static final char REMOTE_FLOW_CONTROLThe Constant REMOTE_FLOW_CONTROL.- See Also:
-
LINEMODE
public static final char LINEMODEThe Constant LINEMODE.- See Also:
-
ENVIRONMENT
public static final char ENVIRONMENTThe Constant ENVIRONMENT.- See Also:
-
NEW_ENVIRON
public static final char NEW_ENVIRONThe Constant NEW_ENVIRON.- See Also:
-
ECHO_DIGIT_ONLY
-
ECHO_LETTER_ONLY
-
ECHO_LETTER_AND_DIGIT_ONLY
The Constant ECHO_LETTER_AND_DIGIT_ONLY. -
ECHO_ALL
The Constant ECHO_ALL. -
SEND
public static final char SENDThe Constant SEND.- See Also:
-
-
Constructor Details
-
TelnetHandler
Instantiates a new telnet handler.- Parameters:
socket
- the socket- Throws:
IOException
- Signals that an I/O exception has occurred.
-
TelnetHandler
Instantiates a new telnet handler.- Parameters:
in
- the inout
- the out- Throws:
IOException
- Signals that an I/O exception has occurred.
-
-
Method Details
-
close
public void close()Close. -
nextChar
Next char.- Returns:
- the char
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
flush
Flush.- Throws:
IOException
- Signals that an I/O exception has occurred.
-
send
Sends the.- Parameters:
c
- the c- Throws:
IOException
- Signals that an I/O exception has occurred.
-
print
Prints the.- Parameters:
c
- the c- Throws:
IOException
- Signals that an I/O exception has occurred.
-
println
Println.- Throws:
IOException
- Signals that an I/O exception has occurred.
-
print
Prints the.- Parameters:
s
- the s- Throws:
IOException
- Signals that an I/O exception has occurred.
-
println
Println.- Parameters:
s
- the s- Throws:
IOException
- Signals that an I/O exception has occurred.
-
sendOption
Sends the option.- Parameters:
option
- the optionstate
- the state- Throws:
IOException
- Signals that an I/O exception has occurred.
-
sendOptionRequest
Sends the option request.- Parameters:
option
- the optionstate
- the state- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getInputStream
Gets the input stream.- Returns:
- the input stream
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getOutputStream
Gets the output stream.- Returns:
- the output stream
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getSocket
-
getTerminal
-
setTerminal
-
getWindowSize
-
setWindowSize
Sets the window size.- Parameters:
windowSize
- the new window size
-
readLine
Read line.- Parameters:
size
- the sizeset
- the set- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
readLine
Read line.- Parameters:
echo
- the echosize
- the sizeset
- the set- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
readString
Read string.- Parameters:
message
- the messagesize
- the sizeset
- the set- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
readString
Read string.- Parameters:
message
- the messagesize
- the sizeset
- the setvalues
- the values- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
readString
public String readString(String message, int size, String set, String[] values, int defaultPos) throws IOException Read string.- Parameters:
message
- the messagesize
- the sizeset
- the setvalues
- the valuesdefaultPos
- the default pos- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getPassword
Gets the password.- Parameters:
size
- the sizeset
- the setmessage
- the messagehelp
- the help- Returns:
- the password
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getPassword
public String getPassword(int size, String set, String message, String verify, File help) throws IOException Gets the password.- Parameters:
size
- the sizeset
- the setmessage
- the messageverify
- the verifyhelp
- the help- Returns:
- the password
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
readChar
Read char.- Parameters:
message
- the messagevalues
- the values- Returns:
- the char
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
readString
public String readString(String message, int size, String[] values, int defaultValue) throws IOException Read string.- Parameters:
message
- the messagesize
- the sizevalues
- the valuesdefaultValue
- the default value- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
subNegotiation
Sub negotiation.- Parameters:
option
- the optionparam
- the param- Throws:
IOException
- Signals that an I/O exception has occurred.
-
subNegotiation
Sub negotiation.- Parameters:
option
- the optionparams
- the params- Throws:
IOException
- Signals that an I/O exception has occurred.
-
display
-