Package org.cloudfoundry.ide.eclipse.server.core.internal.client

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


    tunnelDescriptor = descriptor.getTunnelDescriptor();

    // if there is no tunnel descriptor, create the tunnel first
    if (tunnelDescriptor == null && descriptor.getCloudService() != null) {
      try {
        TunnelBehaviour handler = new TunnelBehaviour(cloudServer);
        tunnelDescriptor = handler.startCaldecottTunnel(descriptor.getCloudService().getName(), monitor, false);
      }
      catch (CoreException e) {
        return CloudFoundryPlugin.getErrorStatus(e);
      }
View Full Code Here


          Set<CaldecottTunnelDescriptor> descriptorsToRemove = wizard.getDescriptorsToRemove();
          if (descriptorsToRemove != null) {
            for (CaldecottTunnelDescriptor descriptor : descriptorsToRemove) {
              try {
                new TunnelBehaviour(cloudServer).stopAndDeleteCaldecottTunnel(
                    descriptor.getServiceName(), monitor);
              }
              catch (CoreException e) {
                CloudFoundryPlugin.log(e);
              }
View Full Code Here

    servicesViewer.setContentProvider(new TreeContentProvider());
    servicesViewer.setLabelProvider(new ServicesTreeLabelProvider(servicesViewer) {

      protected Image getColumnImage(CloudService service, ServiceViewColumn column) {
        if (column == ServiceViewColumn.Tunnel) {
          TunnelBehaviour handler = new TunnelBehaviour(cloudServer);
          if (handler.hasCaldecottTunnel(service.getName())) {
            return CloudFoundryImages.getImage(CloudFoundryImages.CONNECT);
          }
        }
        return null;
      }

    });
    servicesViewer.setSorter(new ServiceViewerSorter(servicesViewer) {

      @Override
      protected int compare(CloudService service1, CloudService service2, ServiceViewColumn sortColumn) {
        if (sortColumn == ServiceViewColumn.Tunnel) {
          TunnelBehaviour handler = new TunnelBehaviour(cloudServer);
          if (handler.hasCaldecottTunnel(service1.getName())) {
            return -1;
          }
          else if (handler.hasCaldecottTunnel(service2.getName())) {
            return 1;
          }
          else {
            return 0;
          }
View Full Code Here

    if (cloudFoundryServer == null || server.getServerState() != IServer.STATE_STARTED) {
      return Collections.emptyList();
    }
    List<IAction> actions = new ArrayList<IAction>();

    if (new TunnelBehaviour(cloudFoundryServer).hasCaldecottTunnels()) {
      actions.add(new CaldecottTunnelAction(cloudFoundryServer));
      actions.add(new CaldecottDisconnectAllAction(cloudFoundryServer));
    }

    return actions;
View Full Code Here

    Collection<CaldecottTunnelDescriptor> cache = null;

    if (servicesWithTunnels != null && !servicesWithTunnels.isEmpty()) {
      cache = new ArrayList<CaldecottTunnelDescriptor>();
      TunnelBehaviour handler = new TunnelBehaviour(cloudServer);
      for (String serviceName : servicesWithTunnels) {
        CaldecottTunnelDescriptor descriptor = handler.getCaldecottTunnel(serviceName);
        if (descriptor != null) {
          cache.add(descriptor);
        }
      }
    }
View Full Code Here

  protected IStatus launch(IProgressMonitor monitor) {
    // if there is no tunnel descriptor, create the tunnel first
    if (descriptor == null && cloudService != null) {
      try {
        TunnelBehaviour handler = new TunnelBehaviour(cloudServer);
        descriptor = handler.startCaldecottTunnel(cloudService.getName(), monitor, false);
      }
      catch (CoreException e) {
        return CloudFoundryPlugin.getErrorStatus(e);
      }
View Full Code Here

    if (services != null && !services.isEmpty()) {
      return new ModifyEditorOperation() {

        @Override
        protected void performOperation(IProgressMonitor monitor) throws CoreException {
            TunnelBehaviour handler = new TunnelBehaviour(getBehavior().getCloudFoundryServer());
          handler.startCaldecottTunnel(services.get(0), monitor, true);
        }
       
      };
    }
    return null;
View Full Code Here

    Job job = new Job(NLS.bind(Messages.CaldecottDisconnectAllAction_JOB_STOP, cloudServer.getDeploymentName())) {

      @Override
      protected IStatus run(IProgressMonitor monitor) {
        try {
          new TunnelBehaviour(cloudServer).stopAndDeleteAllTunnels(monitor);
        }
        catch (CoreException e) {
          return CloudFoundryPlugin.getErrorStatus(e);
        }
        return Status.OK_STATUS;
View Full Code Here

    servicesViewer.setContentProvider(new TreeContentProvider());
    servicesViewer.setLabelProvider(new ServicesTreeLabelProvider(servicesViewer) {

      protected Image getColumnImage(CloudService service, ServiceViewColumn column) {
        if (column == ServiceViewColumn.Tunnel) {
          TunnelBehaviour handler = new TunnelBehaviour(cloudServer);
          if (handler.hasCaldecottTunnel(service.getName())) {
            return CloudFoundryImages.getImage(CloudFoundryImages.CONNECT);
          }
        }
        return null;
      }

    });
    servicesViewer.setSorter(new ServiceViewerSorter(servicesViewer) {

      @Override
      protected int compare(CloudService service1, CloudService service2, ServiceViewColumn sortColumn) {
        if (sortColumn == ServiceViewColumn.Tunnel) {
          TunnelBehaviour handler = new TunnelBehaviour(cloudServer);
          if (handler.hasCaldecottTunnel(service1.getName())) {
            return -1;
          }
          else if (handler.hasCaldecottTunnel(service2.getName())) {
            return 1;
          }
          else {
            return 0;
          }
View Full Code Here

  protected CloudApplication getCaldecottApplication() throws CoreException {
    return getUpdatedApplication(TunnelHelper.getTunnelAppName());
  }

  protected void stopTunnel(String serviceName) throws CoreException {
    TunnelBehaviour handler = new TunnelBehaviour(cloudServer);
    handler.stopAndDeleteCaldecottTunnel(serviceName, new NullProgressMonitor());

  }
View Full Code Here

TOP

Related Classes of org.cloudfoundry.ide.eclipse.server.core.internal.client.TunnelBehaviour

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.