Examples of CloudFoundryApplicationModule


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

              setErrorInPage(status);
            }
            else {
              IModule currentModule = editorPage.getMasterDetailsBlock().getCurrentModule();
              if (currentModule != null) {
                CloudFoundryApplicationModule appModule = editorPage.getCloudServer()
                    .getExistingCloudModule(currentModule);
                if (appModule != null && appModule.getErrorMessage() != null) {
                  setErrorInPage(appModule.getErrorMessage());
                  return;
                }
              }
              setErrorInPage((String) null);
            }
View Full Code Here

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

  protected class ApplicationDetailsDebugListener implements ICloudFoundryDebuggerListener {

    public void handleDebuggerTermination() {

      try {
        final CloudFoundryApplicationModule appModule = getExistingApplication();

        UIJob job = new UIJob(Messages.ApplicationDetailsPart_JOB_DEBUG) {

          public IStatus runInUIThread(IProgressMonitor arg0) {
View Full Code Here

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

      // deleted. DO NOT recreate cloud application modules for these
      // CHANGE
      for (IModule module : server.getModules()) {
        // Find the corresponding Cloud Foundry application module for
        // the given WST server IModule
        CloudFoundryApplicationModule cloudModule = getCloudModule(module);

        if (cloudModule == null) {
          CloudFoundryPlugin.logError("Unable to find local Cloud Foundry application module for : " //$NON-NLS-1$
              + module.getName()
              + ". Try refreshing applications or disconnecting and reconnecting to the server."); //$NON-NLS-1$
          continue;
        }

        // Now process the deployed application, and re-categorise it if
        // necessary (i.e. whether it's external or not)
        CloudApplication actualApplication = deployedApplications.remove(cloudModule
            .getDeployedApplicationName());

        // Update the cloud module mapping to the cloud application,
        // such that the cloud module
        // has the latest cloud application reference.
        cloudModule.setCloudApplication(actualApplication);

        // the modules maps to an existing application
        if (actualApplication != null) {
          if (cloudModule.isExternal()) {
            externalModules.add(cloudModule);
          }
          allModules.add(cloudModule);
        }
        else if (getData() != null && getData().isUndeployed(module)) {
          // deployment is still in progress
          allModules.add(cloudModule);
        }
        else {
          // the module maps to an application that no longer exists
          deletedModules.add(module);
        }
      }

      // create modules for new applications
      if (getData() != null) {
        for (CloudApplication application : deployedApplications.values()) {
          CloudFoundryApplicationModule appModule = getData().createModule(application);
          externalModules.add(appModule);
          allModules.add(appModule);
        }
      }

      // update state for cloud applications
      server.setExternalModules(externalModules.toArray(new IModule[0]));

      for (IModule module : server.getModules()) {
        CloudFoundryApplicationModule appModule = getExistingCloudModule(module);
        if (appModule != null) {
          updateState(server, appModule);
        }
      }
View Full Code Here

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

   * @return Cloud application module, if it exists for the given app name.
   * Null otherwise.
   */
  public CloudFoundryApplicationModule getExistingCloudModule(String appName) throws CoreException {

    CloudFoundryApplicationModule appModule = null;
    Collection<CloudFoundryApplicationModule> modules = getExistingCloudModules();
    if (modules != null) {
      for (CloudFoundryApplicationModule module : modules) {
        if (appName.equals(module.getDeployedApplicationName())) {
          appModule = module;
View Full Code Here

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

    }
  }

  public URL getModuleRootURL(final IModule curModule) {
    // Only publish if the server publish state is not synchronized.
    CloudFoundryApplicationModule cloudModule = getCloudModule(curModule);
    if (cloudModule == null) {
      return null;
    }

    // verify that URIs are set, as it may be a standalone application with
    // no URI
    List<String> uris = cloudModule != null && cloudModule.getApplication() != null ? cloudModule.getApplication()
        .getUris() : null;
    if (uris != null && !uris.isEmpty()) {
      try {
        return new URL("http://" + uris.get(0)); //$NON-NLS-1$
      }
View Full Code Here

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

                  // which will deal with the binding and unbinding of the service. In addition
                  // these actions refresh the Application and Services editor after the update
                  boolean isBoundToServiceAfter = curr.getBoundToServiceAfter();
                  if (isBoundToServiceAfter != curr.getBoundToServiceBefore()){
                    CloudApplication cloudApp = applicationsToProcess.get(i).getCloudApplication();
                    CloudFoundryApplicationModule module = server.getExistingCloudModule(cloudApp.getName());
                    if(isBoundToServiceAfter){             
                      ModifyServicesForApplicationAction bindService =
                          new AddServicesToApplicationAction(structuredSelection,
                              module,
                              server.getBehaviour(),
View Full Code Here

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

 
  public Object execute(ExecutionEvent event) throws ExecutionException {
    initializeSelection(event);

    if (selectedServer != null) {
      CloudFoundryApplicationModule cloudModule = getSelectedCloudAppModule();
      if (cloudModule != null) {
        int state = cloudModule.getState();
        // Based on property testers, this should already be started
        if (state == IServer.STATE_STARTED) {
          IURLProvider cloudServer = (IURLProvider)selectedServer.loadAdapter(IURLProvider.class, null);

          CloudFoundryServer cfs = (CloudFoundryServer)selectedServer.loadAdapter(CloudFoundryServer.class, null);
View Full Code Here

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

      public Image getImage(Object element) {
        Image image = super.getImage(element);

        if (element instanceof IModule) {
          IModule module = (IModule) element;
          CloudFoundryApplicationModule appModule = editorPage.getCloudServer()
              .getExistingCloudModule(module);
          if (appModule != null && appModule.getErrorMessage() != null) {
            return CloudFoundryImages.getImage(new DecorationOverlayIcon(image,
                CloudFoundryImages.OVERLAY_ERROR, IDecoration.BOTTOM_LEFT));
          }
        }

        return image;
      }

      @Override
      public String getText(Object element) {
        // This is the WTP module name (usually, it's the workspace
        // project name)
        String moduleName = super.getText(element);

        // However, the user has the option to specify a different name
        // when pushing an app, which is used as the cf app name. If
        // they are different, and the
        // corresponding workspace project is accessible, show both.
        // Otherwise, show the cf app name.

        if (element instanceof IModule) {

          IModule module = (IModule) element;

          // Find the corresponding Cloud Foundry-aware application
          // Module.
          CloudFoundryApplicationModule appModule = cloudServer.getExistingCloudModule((IModule) element);

          if (appModule != null) {
            String cfAppName = appModule.getDeployedApplicationName();

            if (cfAppName != null) {

              // Be sure not to show a null WTP module name,
              // although
View Full Code Here

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

  public void selectionChanged(IAction action, ISelection selection) {
    selectedServer = getSelectedServer(selection);
    CloudFoundryServer cloudServer = selectedServer != null ? (CloudFoundryServer) selectedServer.loadAdapter(
        CloudFoundryServer.class, null) : null;
    CloudFoundryApplicationModule appModule = cloudServer != null && selectedModule != null ? cloudServer
        .getExistingCloudModule(selectedModule) : null;
    serverSelectionChanged(cloudServer, appModule, action);
  }
View Full Code Here

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

 
    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.