Example usage for org.apache.commons.net.telnet TelnetNotificationHandler RECEIVED_DO

List of usage examples for org.apache.commons.net.telnet TelnetNotificationHandler RECEIVED_DO

Introduction

In this page you can find the example usage for org.apache.commons.net.telnet TelnetNotificationHandler RECEIVED_DO.

Prototype

int RECEIVED_DO

To view the source code for org.apache.commons.net.telnet TelnetNotificationHandler RECEIVED_DO.

Click Source Link

Document

The remote party sent a DO command.

Usage

From source file:com.kz.pipeCutter.MyTelnetClient.java

/***
 * Callback method called when TelnetClient receives an option negotiation
 * command./*from  w  ww  .j av a2  s . com*/
 * <p>
 * 
 * @param negotiation_code
 *          - type of negotiation command received (RECEIVED_DO,
 *          RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
 *          <p>
 * @param option_code
 *          - code of the option negotiated
 *          <p>
 ***/
// @Override
public void receivedNegotiation(int negotiation_code, int option_code) {
    String command = null;
    if (negotiation_code == TelnetNotificationHandler.RECEIVED_DO) {
        command = "DO";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_DONT) {
        command = "DONT";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WILL) {
        command = "WILL";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WONT) {
        command = "WONT";
    }
    System.out.println("Received " + command + " for option code " + option_code);
}

From source file:collabedit.Telnet.java

/***
 * Callback method called when TelnetClient receives an option negotiation
 * command.//  w w w .j  av a  2  s .c om
 * <p>
 * 
 * @param negotiation_code
 *            - type of negotiation command received (RECEIVED_DO,
 *            RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
 *            <p>
 * @param option_code
 *            - code of the option negotiated
 *            <p>
 ***/
// @Override
public void receivedNegotiation(int negotiation_code, int option_code) {
    String command = null;
    if (negotiation_code == TelnetNotificationHandler.RECEIVED_DO) {
        command = "DO";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_DONT) {
        command = "DONT";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WILL) {
        command = "WILL";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WONT) {
        command = "WONT";
    }
    System.out.println("Message Received");
    // System.out.println("Received " + command + " for option code "
    // + option_code);
}

From source file:ch.unizh.ini.jaer.projects.gesture.vlccontrol.TelnetClientExample.java

/***
 * Callback method called when TelnetClient receives an option
 * negotiation command.//from  w  w w . j  a  va2 s  . c o m
 * <p>
 * @param negotiation_code - type of negotiation command received
 * (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
 * <p>
 * @param option_code - code of the option negotiated
 * <p>
 ***/
public void receivedNegotiation(int negotiation_code, int option_code) {
    String command = null;
    if (negotiation_code == TelnetNotificationHandler.RECEIVED_DO) {
        command = "DO";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_DONT) {
        command = "DONT";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WILL) {
        command = "WILL";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WONT) {
        command = "WONT";
    }
    System.out.println("Received " + command + " for option code " + option_code);
}

From source file:com.groupC1.control.network.TelnetClientExample.java

/***
 * Callback method called when TelnetClient receives an option
 * negotiation command.//from w ww  . j  av  a 2  s . c om
 * <p>
 * @param negotiation_code - type of negotiation command received
 * (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
 * <p>
 * @param option_code - code of the option negotiated
 * <p>
 ***/
//    @Override
public void receivedNegotiation(int negotiation_code, int option_code) {
    String command = null;
    if (negotiation_code == TelnetNotificationHandler.RECEIVED_DO) {
        command = "DO";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_DONT) {
        command = "DONT";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WILL) {
        command = "WILL";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WONT) {
        command = "WONT";
    }
    System.out.println("Received " + command + " for option code " + option_code);
}

From source file:ch.unizh.ini.jaer.projects.gesture.vlccontrol.VLCControl.java

/***
 * Callback method called when TelnetClient receives an option
 * negotiation command./*from  ww  w .  ja v a2s  .c  om*/
 * <p>
 * @param negotiation_code - type of negotiation command received
 * (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
 * <p>
 * @param option_code - code of the option negotiated
 * <p>
 ***/
@Override
public void receivedNegotiation(int negotiation_code, int option_code) {
    String command = null;
    if (negotiation_code == TelnetNotificationHandler.RECEIVED_DO) {
        command = "DO";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_DONT) {
        command = "DONT";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WILL) {
        command = "WILL";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WONT) {
        command = "WONT";
    }
    log.log(Level.INFO, "Received {0} for option code {1}", new Object[] { command, option_code });
}

From source file:correospingtelnet.Telnet.java

/***
 * Callback method called when TelnetClient receives an option
 * negotiation command./*ww  w  . j a  v a2s. c  o m*/
 *
 * @param negotiation_code - type of negotiation command received
 * (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT, RECEIVED_COMMAND)
 * @param option_code - code of the option negotiated
 ***/
@Override
public void receivedNegotiation(int negotiation_code, int option_code) {
    String command = null;
    switch (negotiation_code) {
    case TelnetNotificationHandler.RECEIVED_DO:
        command = "DO";
        break;
    case TelnetNotificationHandler.RECEIVED_DONT:
        command = "DONT";
        break;
    case TelnetNotificationHandler.RECEIVED_WILL:
        command = "WILL";
        break;
    case TelnetNotificationHandler.RECEIVED_WONT:
        command = "WONT";
        break;
    case TelnetNotificationHandler.RECEIVED_COMMAND:
        command = "COMMAND";
        break;
    default:
        command = Integer.toString(negotiation_code); // Should not happen
        break;
    }
    System.out.println("Received " + command + " for option code " + option_code);
}

From source file:com.symbian.driver.plugins.ftptelnet.TelnetProcess.java

public void receivedNegotiation(int aNegotiationCode, int aOptionCode) {
    String command = null;//w w  w. ja  va  2 s .com
    if (aNegotiationCode == TelnetNotificationHandler.RECEIVED_DO) {
        command = "DO";
    } else if (aNegotiationCode == TelnetNotificationHandler.RECEIVED_DONT) {
        command = "DONT";
    } else if (aNegotiationCode == TelnetNotificationHandler.RECEIVED_WILL) {
        command = "WILL";
    } else if (aNegotiationCode == TelnetNotificationHandler.RECEIVED_WONT) {
        command = "WONT";
    }
    LOGGER.info("Received " + command + " for option code " + aOptionCode);
}

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;// ww w .ja v  a 2 s.c  om
    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.smartfrog.services.net.TelnetImpl.java

/**
 * Callback method called when TelnetClient receives an option negotiation
 * command./* www.  j a va2  s.c om*/
 * <p/>
 *
 * @param negotiation_code - type of negotiation command received
 *                         (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL,
 *                         RECEIVED_WONT)
 *                         <p/>
 * @param option_code      - code of the option negotiated
 *                         <p/>
 *                         *
 */
@Override
public void receivedNegotiation(int negotiation_code, int option_code) {
    String command = null;
    if (negotiation_code == TelnetNotificationHandler.RECEIVED_DO) {
        command = "DO";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_DONT) {
        command = "DONT";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WILL) {
        command = "WILL";
    } else if (negotiation_code == TelnetNotificationHandler.RECEIVED_WONT) {
        command = "WONT";
    }
    sfLog().debug("Received negotiation code " + command);
}