Class TelnetHandler
java.lang.Object
ecmwf.common.telnet.TelnetHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charThe Constant AO.static final charThe Constant AYT.static final charThe Constant BEL.static final charThe Constant BRK.static final charThe Constant BS.static final charThe Constant CR.static final charThe Constant DM.static final charThe Constant DO.static final charThe Constant DONT.static final charThe Constant EC.static final charThe Constant ECHO.static final StringThe Constant ECHO_ALL.static final StringThe Constant ECHO_DIGIT_ONLY.static final StringThe Constant ECHO_LETTER_AND_DIGIT_ONLY.static final StringThe Constant ECHO_LETTER_ONLY.static final charThe Constant EL.static final charThe Constant ENVIRONMENT.static final charThe Constant FF.static final charThe Constant GA.static final charThe Constant HT.static final charThe Constant IAC.static final charThe Constant IP.static final charThe Constant LF.static final charThe Constant LINEMODE.static final charThe Constant NEW_ENVIRON.static final charThe Constant NOP.static final charThe Constant NUL.static final charThe Constant REMOTE_FLOW_CONTROL.static final charThe Constant SB.static final charThe Constant SE.static final charThe Constant SEND.static final charThe Constant STATUS.static final charThe Constant SUPPRESS_GO_AHEAD.static final charThe Constant TERMINAL_SPEED.static final charThe Constant TERMINAL_TYPE.static final charThe Constant TIMING_MARK.static final charThe Constant WILL.static final charThe Constant WINDOW_SIZE.static final charThe 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 TypeMethodDescriptionvoidclose()Close.voidDisplay.voidflush()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.charnextChar()Next char.voidprint(char c) Prints the.voidPrints the.voidprintln()Println.voidPrintln.charRead 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.voidsend(char c) Sends the.voidsendOption(char option, boolean state) Sends the option.voidsendOptionRequest(char option, boolean state) Sends the option request.voidsetTerminal(String terminal) Sets the terminal.voidsetWindowSize(Dimension windowSize) Sets the window size.voidsubNegotiation(char option, char param) Sub negotiation.voidsubNegotiation(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
-