/** * Handle option <code>DON'T</code> call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleDont(TelnetConnection)} method.<p> * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionDont(byte optionCode) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleDont(this); return; } } }
/** * Handle option parameters call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleParameters(TelnetConnection, byte[])} method. * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionParameters(byte optionCode, byte[] parameters) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleParameters(this, parameters); return; } } }
/** * Handle option <code>WON'T</code> call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleWont(TelnetConnection)} method.<p> * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionWont(byte optionCode) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleWont(this); return; } } }
/** * Handle option <code>DO</code> call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleDo(TelnetConnection)} method * otherwise a <code>WON'T</code> will be sent to the client.<p> * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionDo(byte optionCode) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleDo(this); return; } } send(new byte[]{BYTE_IAC, BYTE_WONT, optionCode}); }
/** * Handle option <code>WILL</code> call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleWill(TelnetConnection)} method * otherwise a <code>DON'T</code> will be sent to the client.<p> * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionWill(byte optionCode) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleWill(this); return; } } send(new byte[]{BYTE_IAC, BYTE_DONT, optionCode}); }
/** * Handle option <code>DO</code> call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleDo(TelnetConnection)} method * otherwise a <code>WON'T</code> will be sent to the client.<p> * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionDo(byte optionCode) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleDo(this); return; } } send(new byte[]{BYTE_IAC, BYTE_WONT, optionCode}); }
/** * Handle option <code>WILL</code> call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleWill(TelnetConnection)} method * otherwise a <code>DON'T</code> will be sent to the client.<p> * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionWill(byte optionCode) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleWill(this); return; } } send(new byte[]{BYTE_IAC, BYTE_DONT, optionCode}); }
/** * Handle option <code>DON'T</code> call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleDont(TelnetConnection)} method.<p> * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionDont(byte optionCode) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleDont(this); return; } } }
/** * Handle option parameters call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleParameters(TelnetConnection, byte[])} method. * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionParameters(byte optionCode, byte[] parameters) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleParameters(this, parameters); return; } } }
/** * Handle option <code>WON'T</code> call back. The implementation will try to find a matching option * via the {@code Option#values()} and invoke it's {@link Option#handleWont(TelnetConnection)} method.<p> * * This method can be subclassed to handle an option. * * @param optionCode the option code */ protected void onOptionWont(byte optionCode) { for (Option option : Option.values()) { if (option.code == optionCode) { option.handleWont(this); return; } } }