Package org.eclipse.orion.server.cf.objects

Examples of org.eclipse.orion.server.cf.objects.Route


      JSONObject result = new JSONObject();
      routes = new ArrayList<Route>();
      JSONArray resources = routesJSON.getJSONArray(CFProtocolConstants.V2_KEY_RESOURCES);
      for (int k = 0; k < resources.length(); ++k) {
        JSONObject routeJSON = resources.getJSONObject(k);
        Route route = new Route();
        route.setCFJSON(routeJSON);

        if (domainName == null || (domainName.equals(route.getDomainName()) && (hostName == null || hostName.equals(route.getHost())))) {
          if (!orphaned || route.getCFJSON().getJSONObject(CFProtocolConstants.V2_KEY_ENTITY).getJSONArray(CFProtocolConstants.V2_KEY_APPS).length() == 0) {
            routes.add(route);
            result.append("Routes", route.toJSON());
          }
        }
      }

      return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, result);
View Full Code Here


          if (routes == null || routes.size() == 0)
            return new ServerStatus(IStatus.OK, HttpServletResponse.SC_NOT_FOUND, "Host not found", null);

          JSONArray deletedRoutesJSON = new JSONArray();
          for (Iterator<Route> iterator2 = routes.iterator(); iterator2.hasNext();) {
            Route route = iterator2.next();

            DeleteRouteCommand deleteRouteCommand = new DeleteRouteCommand(target, route);
            IStatus deleteRouteStatus = deleteRouteCommand.doIt();
            if (!deleteRouteStatus.isOK())
              return deleteRouteStatus;

            deletedRoutesJSON.put(route.toJSON());
          }

          JSONObject result = new JSONObject();
          result.put("Routes", deletedRoutesJSON);
          return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, result);
View Full Code Here

      ServerStatus getStatus = HttpUtil.executeMethod(getRoutesMethod);
      if (!getStatus.isOK())
        return getStatus;

      JSONObject routeJSON = getStatus.getJsonData();
      this.route = new Route().setCFJSON(routeJSON);

      return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, this.route.toJSON());
    } catch (Exception e) {
      String msg = NLS.bind("An error occured when performing operation {0}", commandName); //$NON-NLS-1$
      logger.error(msg, e);
View Full Code Here

TOP

Related Classes of org.eclipse.orion.server.cf.objects.Route

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.