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

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


      @Override
      protected IStatus performJob() {
        try {
          ComputeTargetCommand computeTarget = new ComputeTargetCommand(this.userId, jsonData);
          IStatus result = computeTarget.doIt();
          Target target = computeTarget.getTarget();

          if (jsonData.has("Username") && jsonData.has("Password")) {
            result = new LoginCommand(target.getCloud(), jsonData.getString("Username"), jsonData.getString("Password")).doIt();
            if (!result.isOK())
              return result;
          }

          CFActivator.getDefault().getTargetRegistry().markDefault(this.userId, target);

          return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, target.toJSON());
        } 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


    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);
          }
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");
          }

          IPath path = new Path(pathString);
          final String spaceId = path.segment(0);

          /* get space */
          URI targetURI = URIUtil.toURI(target.getUrl());
          URI orgsURI = targetURI.resolve("/v2/spaces/" + spaceId);

          GetMethod getDomainsMethod = new GetMethod(orgsURI.toString());
          HttpUtil.configureHttpMethod(getDomainsMethod, target);
          getDomainsMethod.setQueryString("inline-relations-depth=1"); //$NON-NLS-1$
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.