Package com.openshift.client

Examples of com.openshift.client.OpenShiftSSHOperationException


  public boolean isPortFowardingStarted() throws OpenShiftSSHOperationException {
    try {
      return this.session != null && this.session.isConnected() && this.session.getPortForwardingL().length > 0;
    } catch (JSchException e) {
      throw new OpenShiftSSHOperationException(e,
          "Unable to verify if port-forwarding has been started for application \"{0}\"", this.getName());
    }
  }
View Full Code Here


   */
  protected List<String> sshExecCmd(final String command, final SshStreams sshStream)
      throws OpenShiftSSHOperationException {
    final Session session = getSSHSession();
    if (session == null) {
      throw new OpenShiftSSHOperationException("No SSH session available for application ''{0}''", this.getName());
    }
    Channel channel = null;
    BufferedReader reader = null;
    try {
      session.openChannel("exec");
      channel = session.openChannel("exec");
      ((ChannelExec) channel).setCommand(command);
      channel.connect();
      return sshStream.getLines(channel);
    } catch (JSchException e) {
      throw new OpenShiftSSHOperationException(e, "Failed to list forwardable ports for application \"{0}\"",
          this.getName());
    } catch (IOException e) {
      throw new OpenShiftSSHOperationException(e, "Failed to list forwardable ports for application \"{0}\"",
          this.getName());
    } finally {

      if (reader != null) {
        try {
View Full Code Here

      final String name = matcher.group(1);
      final String host = matcher.group(2);
      final int remotePort = Integer.parseInt(matcher.group(3));
      return new ApplicationPortForwarding(this, name, host, remotePort);
    } catch(NumberFormatException e) {
      throw new OpenShiftSSHOperationException(e,
          "Couild not determine forwarded port in application {0}", getName());
    }
  }
View Full Code Here

    }
  }

  public List<IApplicationPortForwarding> startPortForwarding() throws OpenShiftSSHOperationException {
    if (!hasSSHSession()) {
      throw new OpenShiftSSHOperationException(
          "SSH session for application \"{0}\" is closed or null. Cannot start port forwarding",
          getName());
    }
    for (IApplicationPortForwarding port : ports) {
      try {
View Full Code Here

  public boolean isPortFowardingStarted() throws OpenShiftSSHOperationException {
    try {
      return this.session != null && this.session.isConnected() && this.session.getPortForwardingL().length > 0;
    } catch (JSchException e) {
      throw new OpenShiftSSHOperationException(e,
          "Unable to verify if port-forwarding has been started for application \"{0}\"", this.getName());
    }
  }
View Full Code Here

   */
  protected List<String> sshExecCmd(final String command, final SshStreams sshStream)
      throws OpenShiftSSHOperationException {
    final Session session = getSSHSession();
    if (session == null) {
      throw new OpenShiftSSHOperationException("No SSH session available for application ''{0}''", this.getName());
    }
    Channel channel = null;
    BufferedReader reader = null;
    try {
      session.openChannel("exec");
      channel = session.openChannel("exec");
      ((ChannelExec) channel).setCommand(command);
      channel.connect();
      return sshStream.getLines(channel);
    } catch (JSchException e) {
      throw new OpenShiftSSHOperationException(e, "Failed to execute remote ssh command \"{0}\"",
          this.getName());
    } catch (IOException e) {
      throw new OpenShiftSSHOperationException(e, "Failed to execute remote ssh command \"{0}\"",
          this.getName());
    } finally {

      if (reader != null) {
        try {
View Full Code Here

      final String name = matcher.group(1);
      final String host = matcher.group(2);
      final int remotePort = Integer.parseInt(matcher.group(3));
      return new ApplicationPortForwarding(this, name, host, remotePort);
    } catch(NumberFormatException e) {
      throw new OpenShiftSSHOperationException(e,
          "Couild not determine forwarded port in application {0}", getName());
    }
  }
View Full Code Here

    }
  }

  public List<IApplicationPortForwarding> startPortForwarding() throws OpenShiftSSHOperationException {
    if (!hasSSHSession()) {
      throw new OpenShiftSSHOperationException(
          "SSH session for application \"{0}\" is closed or null. Cannot start port forwarding",
          getName());
    }
    for (IApplicationPortForwarding port : ports) {
      try {
View Full Code Here

  public boolean isPortFowardingStarted() throws OpenShiftSSHOperationException {
    try {
      return this.session != null && this.session.isConnected() && this.session.getPortForwardingL().length > 0;
    } catch (JSchException e) {
      throw new OpenShiftSSHOperationException(e,
          "Unable to verify if port-forwarding has been started for application \"{0}\"", this.getName());
    }
  }
View Full Code Here

   */
  protected List<String> sshExecCmd(final String command, final SshStreams sshStream)
      throws OpenShiftSSHOperationException {
    final Session session = getSSHSession();
    if (session == null) {
      throw new OpenShiftSSHOperationException("No SSH session available for application ''{0}''", this.getName());
    }
    Channel channel = null;
    BufferedReader reader = null;
    try {
      session.openChannel("exec");
      channel = session.openChannel("exec");
      ((ChannelExec) channel).setCommand(command);
      channel.connect();
      return sshStream.getLines(channel);
    } catch (JSchException e) {
      throw new OpenShiftSSHOperationException(e, "Failed to list forwardable ports for application \"{0}\"",
          this.getName());
    } catch (IOException e) {
      throw new OpenShiftSSHOperationException(e, "Failed to list forwardable ports for application \"{0}\"",
          this.getName());
    } finally {

      if (reader != null) {
        try {
View Full Code Here

TOP

Related Classes of com.openshift.client.OpenShiftSSHOperationException

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.