Class TelnetConnection
java.lang.Object
org.aesh.terminal.telnet.TelnetConnection
- Direct Known Subclasses:
NettyTelnetConnection
- Author:
- Julien Viet
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()protected abstract voidprotected voidonClose()voidonInit()protected voidonOptionDo(byte optionCode) Handle optionDOcall back.protected voidonOptionDont(byte optionCode) Handle optionDON'Tcall back.protected voidonOptionParameters(byte optionCode, byte[] parameters) Handle option parameters call back.protected voidonOptionWill(byte optionCode) Handle optionWILLcall back.protected voidonOptionWont(byte optionCode) Handle optionWON'Tcall back.voidreceive(byte[] data) protected abstract voidprotected abstract voidsend(byte[] data) final voidwrite(byte[] data) Write data to the client, escaping data if necessary or truncating it.final voidwriteDoOption(Option option) Write a do option request to the client.final voidwriteWillOption(Option option) Write a do will request to the client.
-
Field Details
-
BYTE_IAC
public static final byte BYTE_IAC- See Also:
-
BYTE_DONT
public static final byte BYTE_DONT- See Also:
-
BYTE_DO
public static final byte BYTE_DO- See Also:
-
BYTE_WONT
public static final byte BYTE_WONT- See Also:
-
BYTE_WILL
public static final byte BYTE_WILL- See Also:
-
BYTE_SB
public static final byte BYTE_SB- See Also:
-
BYTE_SE
public static final byte BYTE_SE- See Also:
-
-
Constructor Details
-
TelnetConnection
-
-
Method Details
-
onInit
public void onInit() -
close
public abstract void close() -
writeDoOption
Write a do option request to the client.- Parameters:
option- the option to send
-
writeWillOption
Write a do will request to the client.- Parameters:
option- the option to send
-
execute
-
schedule
-
send
protected abstract void send(byte[] data) -
receive
public void receive(byte[] data) -
write
public final void write(byte[] data) Write data to the client, escaping data if necessary or truncating it. The original buffer can be mutated if incorrect data is provided.- Parameters:
data- the data to write
-
onClose
protected void onClose() -
onOptionWill
protected void onOptionWill(byte optionCode) Handle optionWILLcall back. The implementation will try to find a matching option via theOption#values()and invoke it'sOption.handleWill(TelnetConnection)method otherwise aDON'Twill be sent to the client.This method can be subclassed to handle an option.
- Parameters:
optionCode- the option code
-
onOptionWont
protected void onOptionWont(byte optionCode) Handle optionWON'Tcall back. The implementation will try to find a matching option via theOption#values()and invoke it'sOption.handleWont(TelnetConnection)method.This method can be subclassed to handle an option.
- Parameters:
optionCode- the option code
-
onOptionDo
protected void onOptionDo(byte optionCode) Handle optionDOcall back. The implementation will try to find a matching option via theOption#values()and invoke it'sOption.handleDo(TelnetConnection)method otherwise aWON'Twill be sent to the client.This method can be subclassed to handle an option.
- Parameters:
optionCode- the option code
-
onOptionDont
protected void onOptionDont(byte optionCode) Handle optionDON'Tcall back. The implementation will try to find a matching option via theOption#values()and invoke it'sOption.handleDont(TelnetConnection)method.This method can be subclassed to handle an option.
- Parameters:
optionCode- the option code
-
onOptionParameters
protected void onOptionParameters(byte optionCode, byte[] parameters) Handle option parameters call back. The implementation will try to find a matching option via theOption#values()and invoke it'sOption.handleParameters(TelnetConnection, byte[])method. This method can be subclassed to handle an option.- Parameters:
optionCode- the option code
-