Examples of CloudFoundryServer


Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

  public boolean canControlModule(IModule[] module) {
    return module.length == 1;
  }

  public void connect(IProgressMonitor monitor) throws CoreException {
    final CloudFoundryServer cloudServer = getCloudFoundryServer();

    new BehaviourRequest<Void>("Loggging in to " + cloudServer.getUrl()) { //$NON-NLS-1$
      @Override
      protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException {
        client.login();
        return null;
      }
    }.run(monitor);

    Server server = (Server) cloudServer.getServerOriginal();
    server.setServerState(IServer.STATE_STARTED);
    server.setServerPublishState(IServer.PUBLISH_STATE_NONE);

    getApplicationUrlLookup().refreshDomains(monitor);
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

    Server server = (Server) getServer();
    server.setServerState(IServer.STATE_STOPPING);

    getRefreshHandler().stop();
    CloudFoundryServer cloudServer = getCloudFoundryServer();

    Collection<CloudFoundryApplicationModule> cloudModules = cloudServer.getExistingCloudModules();

    for (CloudFoundryApplicationModule appModule : cloudModules) {
      CloudFoundryPlugin.getCallback().stopApplicationConsole(appModule, cloudServer);
    }

    Set<CloudFoundryApplicationModule> deletedModules = new HashSet<CloudFoundryApplicationModule>(cloudModules);

    cloudServer.clearApplications();

    // update state for cloud applications
    server.setExternalModules(new IModule[0]);
    for (CloudFoundryApplicationModule module : deletedModules) {
      server.setModuleState(new IModule[] { module.getLocalModule() }, IServer.STATE_UNKNOWN);
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

   * This method is API used by CloudFoundry Code.
   */
  public CloudFoundryServer getCloudFoundryServer() throws CoreException {
    Server server = (Server) getServer();

    CloudFoundryServer cloudFoundryServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
    if (cloudFoundryServer == null) {
      throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, "Fail to load server")); //$NON-NLS-1$
    }
    return cloudFoundryServer;
  }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

   * long running operation.
   * @param monitor
   */
  public void refreshModules(IProgressMonitor monitor) {
    try {
      final CloudFoundryServer cloudServer = getCloudFoundryServer();

      // Get updated list of cloud applications from the server
      List<CloudApplication> applications = getApplications(monitor);

      // update applications and deployments from server
      Map<String, CloudApplication> deployedApplicationsByName = new LinkedHashMap<String, CloudApplication>();

      for (CloudApplication application : applications) {
        deployedApplicationsByName.put(application.getName(), application);
      }

      cloudServer.updateModules(deployedApplicationsByName);
    }
    catch (Throwable t) {
      // refresh operations MUST not block any other operation.
      // therefore catch all errors and log them
      CloudFoundryPlugin.logError(NLS.bind(Messages.ERROR_FAILED_MODULE_REFRESH, t.getMessage()));
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

      throw CloudErrorUtil.toCoreException(INTERNAL_ERROR_NO_WST_MODULE);
    }
    else {
      IModule module = modules[0];

      CloudFoundryServer cloudServer = getCloudFoundryServer();

      appModule = cloudServer.getCloudModule(module);

      if (appModule == null) {
        throw CloudErrorUtil
            .toCoreException(NLS.bind(INTERNAL_ERROR_NO_MAPPED_CLOUD_MODULE, modules[0].getId()));
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

   * for the latter like {@link #updatePassword(String, IProgressMonitor)}
   */
  protected synchronized CloudFoundryOperations getClient(CloudCredentials credentials, IProgressMonitor monitor)
      throws CoreException {
    if (client == null) {
      CloudFoundryServer cloudServer = getCloudFoundryServer();

      String url = cloudServer.getUrl();
      if (!cloudServer.hasCloudSpace()) {
        throw CloudErrorUtil.toCoreException(NLS.bind(Messages.ERROR_FAILED_CLIENT_CREATION_NO_SPACE,
            cloudServer.getServerId()));
      }

      CloudFoundrySpace cloudFoundrySpace = cloudServer.getCloudFoundrySpace();

      if (credentials != null) {
        client = createClient(url, credentials, cloudFoundrySpace, cloudServer.getSelfSignedCertificate());
      }
      else {
        String userName = getCloudFoundryServer().getUsername();
        String password = getCloudFoundryServer().getPassword();
        client = createClient(url, userName, password, cloudFoundrySpace,
            cloudServer.getSelfSignedCertificate());
      }
    }
    return client;
  }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

      // Note that although the "module" parameter is of IModule[] type,
      // documentation
      // (and the name of the parameter) indicates that it is always one
      // module
      if (deltaKind == REMOVED) {
        final CloudFoundryServer cloudServer = getCloudFoundryServer();
        final CloudFoundryApplicationModule cloudModule = cloudServer.getCloudModule(module[0]);
        if (cloudModule.getApplication() != null) {
          new BehaviourRequest<Void>(NLS.bind(Messages.DELETING_MODULE,
              cloudModule.getDeployedApplicationName())) {
            @Override
            protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException {
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

   * @param monitor
   * @return
   */
  public DebugModeType getDebugModeType(IModule module, IProgressMonitor monitor) {
    try {
      CloudFoundryServer cloudServer = getCloudFoundryServer();
      CloudFoundryApplicationModule cloudModule = cloudServer.getExistingCloudModule(module);

      if (cloudModule == null) {
        CloudFoundryPlugin.logError("No cloud application module found for: " + module.getId() //$NON-NLS-1$
            + ". Unable to determine debug mode."); //$NON-NLS-1$
        return null;
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

      }

      CloudFoundryApplicationModule appModule = getOrCreateCloudApplicationModule(modules);

      try {
        CloudFoundryServer cloudServer = getCloudFoundryServer();

        // Stop any consoles
        CloudFoundryPlugin.getCallback().stopApplicationConsole(appModule, cloudServer);

        configuration = prepareForDeployment(appModule, monitor);
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryServer

        @Override
        public IStatus runInUIThread(IProgressMonitor monitor) {
          try {
            if (server != null) {
              CloudFoundryServer cloudServer = (CloudFoundryServer) server.loadAdapter(
                  CloudFoundryServer.class, monitor);
              if (cloudServer != null) {
                setServices(cloudServer.getBehaviour().getServices(monitor));
              }
            }

            if (mform != null && mform.getForm() != null && !mform.getForm().isDisposed()) {
              masterDetailsBlock.refreshUI(RefreshArea.ALL);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.