Package com.sshtools.j2ssh.connection

Examples of com.sshtools.j2ssh.connection.GlobalRequestResponse


*
* @return
*/
    public GlobalRequestResponse processGlobalRequest(String requestName,
        byte[] requestData) {
        GlobalRequestResponse response = new GlobalRequestResponse(false);
        String addressToBind = null;
        int portToBind = -1;
        log.debug("Processing " + requestName + " global request");

        try {
            ByteArrayReader bar = new ByteArrayReader(requestData);
            addressToBind = bar.readString();
            portToBind = (int) bar.readInt();

            if (requestName.equals(ForwardingClient.REMOTE_FORWARD_REQUEST)) {
                addRemoteForwardingConfiguration(addressToBind, portToBind);
                response = new GlobalRequestResponse(true);
            }

            if (requestName.equals(
                        ForwardingClient.REMOTE_FORWARD_CANCEL_REQUEST)) {
                removeRemoteForwarding(addressToBind, portToBind);
                response = new GlobalRequestResponse(true);
            }
        } catch (IOException ioe) {
            log.warn("The client failed to request " + requestName + " for " +
                addressToBind + ":" + String.valueOf(portToBind), ioe);
        }
View Full Code Here


*
* @return
*/
    public GlobalRequestResponse processGlobalRequest(String requestName,
        byte[] requestData) {
        GlobalRequestResponse response = new GlobalRequestResponse(false);
        String addressToBind = null;
        int portToBind = -1;
        log.debug("Processing " + requestName + " global request");

        try {
            ByteArrayReader bar = new ByteArrayReader(requestData);
            addressToBind = bar.readString();
            portToBind = (int) bar.readInt();

            if (requestName.equals(ForwardingClient.REMOTE_FORWARD_REQUEST)) {
                addRemoteForwardingConfiguration(addressToBind, portToBind);
                response = new GlobalRequestResponse(true);
            }

            if (requestName.equals(
                        ForwardingClient.REMOTE_FORWARD_CANCEL_REQUEST)) {
                removeRemoteForwarding(addressToBind, portToBind);
                response = new GlobalRequestResponse(true);
            }
        } catch (IOException ioe) {
            log.warn("The client failed to request " + requestName + " for " +
                addressToBind + ":" + String.valueOf(portToBind), ioe);
        }
View Full Code Here

TOP

Related Classes of com.sshtools.j2ssh.connection.GlobalRequestResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.