List of usage examples for org.apache.commons.net.telnet TelnetOption getOption
public static final String getOption(int code)
From source file:org.eclipse.osee.ote.core.test.shells.TelnetShell.java
@Override public void receivedNegotiation(int negotiationCode, int option) { final String negotiationCodeStr; switch (negotiationCode) { case TelnetNotificationHandler.RECEIVED_DO: negotiationCodeStr = "DO"; break;//from w ww .j a v a2 s . c o m case TelnetNotificationHandler.RECEIVED_DONT: negotiationCodeStr = "DONT"; break; case TelnetNotificationHandler.RECEIVED_WILL: negotiationCodeStr = "WILL"; break; case TelnetNotificationHandler.RECEIVED_WONT: negotiationCodeStr = "WONT"; break; default: throw new Error("unhandled negotiation code of " + negotiationCode); } System.out.printf("Negotiation recieved: %s for option %s\n", negotiationCodeStr, TelnetOption.getOption(option)); }
From source file:org.eclipse.osee.ote.core.test.shells.TelnetShell.java
public void printOptionStates() { for (int i = 0; i < TelnetOption.MAX_OPTION_VALUE; i++) { String str = TelnetOption.getOption(i); if (!str.equals("UNASSIGNED")) { boolean local = telnet.getLocalOptionState(i); boolean remote = telnet.getRemoteOptionState(i); if (local || remote) { System.out.printf("%s (%02d): local %b, remote %b\n", TelnetOption.getOption(i), i, local, remote);/* ww w .ja va 2s . c om*/ } } } }