Examples of CloudFoundryApplicationModule


Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

    super(server, modules, ApplicationAction.CONNECT_TO_DEBUGGER, listener);
    this.connection = connection;
  }

  protected String getLaunchLabel(int instanceIndex) {
    CloudFoundryApplicationModule appModule = getApplicationModule();
    if (appModule != null) {

      StringBuilder launchLabel = new StringBuilder();
      launchLabel.append(getCloudFoundryServer().getServer().getName());
      launchLabel.append(" - "); //$NON-NLS-1$
      launchLabel.append(appModule.getDeployedApplicationName());

      ApplicationStats stats = appModule.getApplicationStats();
      if (stats != null) {
        List<InstanceStats> instanceStats = stats.getRecords();
        if (instanceStats != null && instanceIndex < instanceStats.size()) {
          InstanceStats stat = instanceStats.get(instanceIndex);
          launchLabel.append(" - "); //$NON-NLS-1$
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

  }

  public List<DebugConnectionDescriptor> getDebugConnectionDescriptors(IProgressMonitor monitor) {
    final List<List<DebugConnectionDescriptor>> resolvedDescriptors = new ArrayList<List<DebugConnectionDescriptor>>();

    final CloudFoundryApplicationModule appModule = modules != null && modules.length > 0 ? cloudFoundryServer
        .getExistingCloudModule(modules[0]) : null;

    if (appModule != null) {
      try {
        new WaitWithProgressJob(5, 3000) {

          protected boolean internalRunInWait(IProgressMonitor monitor) {
            List<DebugConnectionDescriptor> descriptors = null;
            try {

              InstancesInfo instancesInfo = cloudFoundryServer.getBehaviour().getInstancesInfo(
                  appModule.getDeployedApplicationName(), monitor);

              if (instancesInfo != null) {
                List<InstanceInfo> infos = instancesInfo.getInstances();
                if (infos != null) {
                  // make sure list of descriptors is same
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

    idBuffer.append(server.getUrl());
    idBuffer.append(server.getUsername());

   
    CloudFoundryApplicationModule appModule = server.getExistingCloudModule(modules[0]);
    if (appModule != null) {
      idBuffer.append(appModule.getDeployedApplicationName());
    }
    return idBuffer.toString();
  }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

    return modules;
  }

  public String getApplicationID() {

    CloudFoundryApplicationModule appModule = getApplicationModule();
    if (appModule != null) {
      return appModule.getDeployedApplicationName();
    }
    return null;
  }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

          CloudFoundryServer server = getCloudFoundryServer(moduleServer.getServer());
          if (server == null || !server.isConnected()) {
            return;

          }
          CloudFoundryApplicationModule module = server.getExistingCloudModule(modules[0]);

          // module may no longer exist
          if (module == null) {
            return;
          }

          if (module.getLocalModule() != null) {
            // show local information?
          }

          CloudApplication application = module.getApplication();
          // if (application != null) {
          // decoration.addSuffix(NLS.bind("  [{0}, {1}, {2}]",
          // new Object[]{application.getName(),
          // getAppStateString(application.getState()),
          // application.getUris()}));
          // } else if (module.getName() != null) {
          // decoration.addSuffix(NLS.bind("  [{0}]",
          // module.getName()));
          // }
          if (application != null) {
            decoration.addSuffix(NLS.bind(Messages.CloudFoundryDecorator_SUFFIX_DEPLOYED_AS, application.getName()));
          }
          else {
            decoration.addSuffix(Messages.CloudFoundryDecorator_SUFFIX_NOT_DEPLOYED);
          }

          if (module.getErrorMessage() != null) {
            decoration.addOverlay(CloudFoundryImages.OVERLAY_ERROR, IDecoration.BOTTOM_LEFT);
          }
        }
      }
    }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

    serverBehavior.deleteAllApplications(new NullProgressMonitor());
    harness.dispose();
  }

  protected void assertApplicationIsRunning(IModule module, String prefix) throws Exception {
    CloudFoundryApplicationModule appModule = cloudServer.getExistingCloudModule(module);

    assertApplicationIsRunning(appModule);
    // Verify that the Application URL is set
    List<String> uris = appModule.getApplication().getUris();
    assertEquals(Collections.singletonList(harness.getExpectedDefaultURL(prefix)), uris);
  }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

    public synchronized void clear() {
      cloudModules.clear();
    }

    public synchronized CloudFoundryApplicationModule createModule(CloudApplication application) {
      CloudFoundryApplicationModule appModule = new CloudFoundryApplicationModule(application.getName(), server);
      appModule.setCloudApplication(application);
      add(appModule);
      return appModule;
    }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

      if (module == null) {
        return null;
      }
      // See if the cloud module for the given local IModule has been
      // created.
      CloudFoundryApplicationModule appModule = getCloudModuleToLocalModuleName(module.getName());
      if (appModule != null) {
        return appModule;
      }

      // Otherwise check if there is a mapping between the IModule ID and
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

    synchronized CloudFoundryApplicationModule getOrCreateCloudModule(IModule module) {

      // See if the cloud module for the given local IModule has been
      // created.
      CloudFoundryApplicationModule appModule = getExistingCloudModule(module);
      if (appModule != null) {
        return appModule;
      }

      // Otherwise check if there is a mapping between the IModule ID and
      // the deployed application name, and
      // search for a cloud module that matches the deployed application
      // name
      String deployedAppName = getLocalModuleToCloudModuleMapping().get(module.getId());
      if (deployedAppName == null) {
        deployedAppName = module.getName();
      }

      // no mapping found, create new Cloud Foundry-aware module. Note
      // that the
      // deployedAppName and the module name need not be the same.
      appModule = new CloudFoundryApplicationModule(module, deployedAppName, server);

      add(appModule);
      return appModule;
    }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.client.CloudFoundryApplicationModule

  public Object execute(ExecutionEvent event) throws ExecutionException {
    initializeSelection(event);
    String error = null;
    CloudFoundryServer cloudServer = selectedServer != null ? (CloudFoundryServer) selectedServer.loadAdapter(
        CloudFoundryServer.class, null) : null;
    CloudFoundryApplicationModule appModule = cloudServer != null && selectedModule != null ? cloudServer
        .getExistingCloudModule(selectedModule) : null;
    if (selectedServer == null) {
      error = "No Cloud Foundry server instance available to run the selected action."; //$NON-NLS-1$
    }
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.