Package org.cloudfoundry.caldecott

Examples of org.cloudfoundry.caldecott.TunnelException


        }
      } catch (Exception e) {
        logger.error("Caught exception: "  + e.getClass().getName() + ": " + e.getMessage());
        logger.error("Closing tunnel " + this);
        stop();
        throw new TunnelException("Fatal exception during tunnel write", e);
      }
      if (!shutdown) {
        stop();
      }
      if (logger.isDebugEnabled()) {
View Full Code Here


                logger.debug("Tunnel error - [" + hsce.getStatusCode().value() + "] " + hsce.getStatusText());
              }
            }
            else {
              logger.warn("Received HTTP Error: [" + hsce.getStatusCode().value() + "] " + hsce.getStatusText());
              throw new TunnelException("Error while reading from tunnel", hsce);
            }
          } catch (SocketTimeoutException e) {
            retry = true;
            if (logger.isTraceEnabled()) {
              logger.trace("Retrying tunnel read after receiving " + e.getClass().getName() + ": " + e.getMessage());
            }
          } catch (ResourceAccessException e) {
            Throwable t = e.getCause();
            if (t != null && t instanceof SocketTimeoutException) {
              retry = true;
              if (logger.isTraceEnabled()) {
                logger.trace("Retrying tunnel read after receiving " + e.getClass().getName() + ": " + e.getMessage());
              }
            } else {
              logger.error("Caught exception: "  + e.getClass().getName() + ": " + e.getMessage());
              logger.error("Closing tunnel " + this);
              stop();
              throw e;
            }
          } catch (RuntimeException e) {
            logger.error("Caught exception: "  + e.getClass().getName() + ": " + e.getMessage());
            logger.error("Closing tunnel " + this);
            stop();
            throw e;
          }
        }
      } catch (IOException ioe) {
        throw new TunnelException("Error while processing streams", ioe);
      }
      if (logger.isDebugEnabled()) {
        logger.debug("Completed reader thread for: " + this);
      }
    }
View Full Code Here

      client.updateApplicationEnv(TUNNEL_APP_NAME,
          Collections.singletonMap("CALDECOTT_AUTH", UUID.randomUUID().toString()));
      client.startApplication(TUNNEL_APP_NAME);
      temp.delete();
    } catch (IOException e) {
      throw new TunnelException("Unable to deploy the Caldecott server application", e);
    }
  }
View Full Code Here

      } catch (HttpClientErrorException e) {
        if (e.getStatusCode().equals(HttpStatus.NOT_FOUND)) {
          if (retries < 10) {
            retries++;
          } else {
            throw new TunnelException("Not able to locate tunnel server at: " + uriToUse, e);
          }
        } else {
          throw new TunnelException("Error accessing tunnel server at: " + uriToUse, e);
        }
      } catch (ResourceAccessException e) {
        if (e.getMessage().contains("refused") || e.getMessage().contains("unable")) {
          i++;
        }
View Full Code Here

  public SocketClient(Socket socket) {
    this.socket = socket;
    try {
      this.socket.setSoTimeout(SOCKET_TIMEOUT);
    } catch (SocketException e) {
      throw new TunnelException("Unable to set timeout on socket " + e.getMessage());
    }
  }
View Full Code Here

      catch (IOException e) {
        if (!keepGoing && serverSocket.isClosed()) {
          // time to quit so we can ignore this exception
        }
        else {
          throw new TunnelException("Error while accepting connections", e);
        }
      }
    }
    if (!handlers.isEmpty()) {
      while (!handlers.isEmpty()) {
View Full Code Here

    try {
      this.serverSocket = new ServerSocket();
      serverSocket.setReuseAddress(true);
      serverSocket.bind(local);
    } catch (IOException e) {
      throw new TunnelException("Error configuring server socket", e);
    }
  }
View Full Code Here

      if (acceptor == null) {
        this.acceptor = new TunnelAcceptor(serverSocket, tunnelFactory, taskExecutor);
        acceptor.start();
      }
      else {
        throw new TunnelException("Server already running.");
      }
    }
  }
View Full Code Here

          logger.warn("Error while closing server socket" + e.getMessage());
        }
        logger.info("Server on " + local + " is now stopped");
      }
      else {
        throw new TunnelException("Server is not running.");
      }
    }
  }
View Full Code Here

        TunnelHelper.deployTunnelApp(client);
        app = client.getApplication(TunnelHelper.getTunnelAppName());
      }
    } catch (Exception e) {
      logger.error("Error deploying Caldecott app", e);
      throw new TunnelException("Error deploying Caldecott app", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.cloudfoundry.caldecott.TunnelException

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.