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

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


            } catch (Exception e) {
              // do nothing
            }
          }

          Target target = CFActivator.getDefault().getTargetRegistry().getTarget(userId, targetUrl);
          if (target == null) {
            return HttpUtil.createErrorStatus(IStatus.WARNING, "CF-TargetNotSet", "Target not set");
          }

          return new GetInfoCommand(this.userId, target.getCloud()).doIt();
        } catch (Exception e) {
          String msg = NLS.bind("Failed to handle request for {0}", path); //$NON-NLS-1$
          ServerStatus status = new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg, e);
          logger.error(msg, e);
          return status;
View Full Code Here


        try {
          ComputeTargetCommand computeTargetCommand = new ComputeTargetCommand(this.userId, targetJSON);
          IStatus result = computeTargetCommand.doIt();
          if (!result.isOK())
            return result;
          Target target = computeTargetCommand.getTarget();

          if (appName != null && instanceNo != null && logName != null) {
            return new GetLogCommand(target, appName, instanceNo, logName, this.requestLocation).doIt();
          } else if (appName != null) {
            return new GetLogsCommand(target, appName, this.requestLocation).doIt();
View Full Code Here

            } catch (Exception e) {
              // do nothing
            }
          }

          Target target = CFActivator.getDefault().getTargetRegistry().getTarget(userId, targetUrl);
          if (target == null) {
            return HttpUtil.createErrorStatus(IStatus.WARNING, "CF-TargetNotSet", "Target not set");
          }

          return new GetOrgsCommand(this.userId, target).doIt();
View Full Code Here

      @Override
      protected IStatus performJob() {
        try {
          ComputeTargetCommand computeTargetCommand = new ComputeTargetCommand(this.userId, targetJSON);
          computeTargetCommand.doIt();
          Target target = computeTargetCommand.getTarget();
          if (target == null) {
            return HttpUtil.createErrorStatus(IStatus.WARNING, "CF-TargetNotSet", "Target not set");
          }

          GetDomainsCommand getDomainsCommand = new GetDomainsCommand(target, domainName);
View Full Code Here

      @Override
      protected IStatus performJob() {
        try {
          ComputeTargetCommand computeTargetCommand = new ComputeTargetCommand(this.userId, targetJSON);
          computeTargetCommand.doIt();
          Target target = computeTargetCommand.getTarget();
          if (target == null) {
            return HttpUtil.createErrorStatus(IStatus.WARNING, "CF-TargetNotSet", "Target not set");
          }

          return new GetRoutesCommand(target, false).doIt();
View Full Code Here

      @Override
      protected IStatus performJob() {
        try {
          ComputeTargetCommand computeTargetCommand = new ComputeTargetCommand(this.userId, targetJSON);
          computeTargetCommand.doIt();
          Target target = computeTargetCommand.getTarget();
          if (target == null) {
            return HttpUtil.createErrorStatus(IStatus.WARNING, "CF-TargetNotSet", "Target not set");
          }

          List<Route> routes = null;
          if (routeId != null) {
            GetRouteByGuidCommand getRouteByGuid = new GetRouteByGuidCommand(target.getCloud(), routeId);
            IStatus getRouteByGuidStatus = getRouteByGuid.doIt();
            if (!getRouteByGuidStatus.isOK())
              return getRouteByGuidStatus;
            if (getRouteByGuid.getRoute() != null) {
              routes = new ArrayList<Route>();
View Full Code Here

      @Override
      protected IStatus performJob() {
        try {
          ComputeTargetCommand computeTargetCommand = new ComputeTargetCommand(userId, targetJSON);
          computeTargetCommand.doIt();
          Target target = computeTargetCommand.getTarget();
          if (target == null)
            return HttpUtil.createErrorStatus(IStatus.WARNING, "CF-TargetNotSet", "Target not set"); //$NON-NLS-1$

          return new GetServiceInstancesCommand(target).doIt();
View Full Code Here

      url = URLUtil.normalizeURL(url);
      if (url == null || (defaultTarget != null && url.equals(defaultTarget.getCloud().getUrl()))) {
        return defaultTarget;
      }
      Cloud cloud = getCloud(url);
      return new Target(cloud);
    }
View Full Code Here

      return new Target(cloud);
    }

    private void setDefaulTarget(Target target) {
      Cloud cloud = getCloud(target.getCloud().getUrl());
      Target newTarget = new Target(cloud);
      newTarget.setOrg(target.getOrg());
      newTarget.setSpace(target.getSpace());
      defaultTarget = newTarget;
    }
View Full Code Here

  protected CFJob handleGet(Target target, HttpServletRequest request, HttpServletResponse response, final String path) {
    return new CFJob(request, false) {
      @Override
      protected IStatus performJob() {
        try {
          Target target = CFActivator.getDefault().getTargetRegistry().getTarget(this.userId);
          if (target == null) {
            String msg = "Target not set"; //$NON-NLS-1$
            return new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND, msg, null);
          }

          return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, target.toJSON());
        } catch (JSONException e) {
          String msg = NLS.bind("Failed to handle request for {0}", path); //$NON-NLS-1$
          ServerStatus status = new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg, e);
          logger.error(msg, e);
          return status;
View Full Code Here

TOP

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

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.