Examples of ServerDescriptor


Examples of org.cloudfoundry.ide.eclipse.server.ui.internal.ServerDescriptor

    // Only create a new space, if it doesnt match the existing space
    if (selectedSpace != null
        && !CloudServerSpacesDelegate.matchesExisting(selectedSpace, cloudServer.getCloudFoundrySpace())) {

      String serverName = cloudSpacePage.getServerName();
      final ServerDescriptor descriptor = ServerDescriptor.getServerDescriptor(cloudServer, serverName);

      if (descriptor == null) {
        CloudFoundryPlugin.logError(NLS.bind(Messages.ERROR_NO_CLOUD_SERVER_DESCRIPTOR,
            cloudServer.getServerId()));
        return false;
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.ui.internal.ServerDescriptor

    assertEquals("pass", cloudFoundryServer.getPassword());
  }

  @Override
  protected void setUp() throws Exception {
    ServerDescriptor descriptor = new ServerDescriptor("server") {
      {
        setRuntimeTypeId("org.cloudfoundry.cloudfoundryserver.test.runtime.10");
        setServerTypeId("org.cloudfoundry.cloudfoundryserver.test.10");
        setRuntimeName("Cloud Foundry Test Runtime");
        setServerName("Cloud Foundry Test Server");
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.ui.internal.ServerDescriptor

  public CloudFoundryTestFixture(String serverDomain) {

    this.url = "http://api." + serverDomain;

    ServerDescriptor descriptor = new ServerDescriptor("server") {
      {
        setRuntimeTypeId("org.cloudfoundry.cloudfoundryserver.test.runtime.10");
        setServerTypeId("org.cloudfoundry.cloudfoundryserver.test.10");
        setRuntimeName("Cloud Foundry Test Runtime");
        setServerName("Cloud Foundry Test Server");
View Full Code Here

Examples of org.nasutekds.admin.ads.ServerDescriptor

    Set<SuffixDescriptor> suffixes =
      getUserData().getSuffixesToReplicateOptions().getSuffixes();

    /* Initialize local ADS and schema contents using any replica. */
    {
      ServerDescriptor server
       = suffixes.iterator().next().getReplicas().iterator().next().getServer();
      InitialLdapContext rCtx = null;
      try
      {
        rCtx = getRemoteConnection(server, getTrustManager(),
            getPreferredConnections());
        TopologyCacheFilter filter = new TopologyCacheFilter();
        filter.setSearchMonitoringInformation(false);
        filter.addBaseDNToSearch(ADSContext.getAdministrationSuffixDN());
        filter.addBaseDNToSearch(Constants.SCHEMA_DN);
        ServerDescriptor s = ServerDescriptor.createStandalone(rCtx, filter);
        for (ReplicaDescriptor replica : s.getReplicas())
        {
          String dn = replica.getSuffix().getDN();
          if (areDnsEqual(dn, ADSContext.getAdministrationSuffixDN()))
          {
            suffixes.add(replica.getSuffix());
          }
          else if (areDnsEqual(dn, Constants.SCHEMA_DN))
          {
            suffixes.add(replica.getSuffix());
          }
        }
      }
      catch (NamingException ne)
      {
        Message msg;
        if (Utils.isCertificateException(ne))
        {
          msg = INFO_ERROR_READING_CONFIG_LDAP_CERTIFICATE_SERVER.get(
              getHostPort(server), ne.toString(true));
        }
        else
        {
           msg = INFO_CANNOT_CONNECT_TO_REMOTE_GENERIC.get(
               getHostPort(server), ne.toString(true));
        }
        throw new ApplicationException(ReturnCode.CONFIGURATION_ERROR, msg,
            ne);
      }
      finally
      {
        try{ rCtx.close(); }
        catch (Throwable t){}
      }
    }

    for (SuffixDescriptor suffix : suffixes)
    {
      String dn = suffix.getDN();

      ReplicaDescriptor replica = suffix.getReplicas().iterator().next();
      ServerDescriptor server = replica.getServer();
      String hostPort = getHostPort(server);

      boolean isADS = areDnsEqual(dn, ADSContext.getAdministrationSuffixDN());
      boolean isSchema = areDnsEqual(dn, Constants.SCHEMA_DN);
      if(isADS)
      {
        if (isVerbose())
        {
          notifyListeners(getFormattedWithPoints(
            INFO_PROGRESS_INITIALIZING_ADS.get()));
        }
      }
      else if (isSchema)
      {
        if (isVerbose())
        {
          notifyListeners(getFormattedWithPoints(
            INFO_PROGRESS_INITIALIZING_SCHEMA.get()));
        }
      }
      else
      {
        notifyListeners(getFormattedProgress(
            INFO_PROGRESS_INITIALIZING_SUFFIX.get(dn, hostPort)));
        notifyListeners(getLineBreak());
      }
      try
      {
        int replicationId = replica.getReplicationId();
        if (replicationId == -1)
        {
          /**
           * This occurs if the remote server had not replication configured.
           */
          InitialLdapContext rCtx = null;
          try
          {
            rCtx = getRemoteConnection(server, getTrustManager(),
                getPreferredConnections());
            TopologyCacheFilter filter = new TopologyCacheFilter();
            filter.setSearchMonitoringInformation(false);
            filter.addBaseDNToSearch(dn);
            ServerDescriptor s = ServerDescriptor.createStandalone(rCtx,
                filter);
            for (ReplicaDescriptor r : s.getReplicas())
            {
              if (areDnsEqual(r.getSuffix().getDN(), dn))
              {
                replicationId = r.getReplicationId();
              }
View Full Code Here

Examples of org.nasutekds.admin.ads.ServerDescriptor

          adsContext.createAdminData(null);
          TopologyCacheFilter filter = new TopologyCacheFilter();
          filter.setSearchMonitoringInformation(false);
          filter.setSearchBaseDNInformation(false);
          ServerDescriptor server
                  = ServerDescriptor.createStandalone(remoteCtx, filter);
          server.updateAdsPropertiesWithServerProperties();
          adsContext.registerServer(server.getAdsProperties());
          createdRemoteAds = true;
          if (isVerbose())
          {
            notifyListeners(getFormattedDoneWithLineBreak());
          }
          checkAbort();
        }
      }

      /* Act on local server depending on if using remote or local ADS */
      if (isVerbose())
      {
        notifyListeners(
            getFormattedWithPoints(INFO_PROGRESS_CREATING_ADS.get()));
      }
      localCtx = createLocalContext();
//      if (isRemoteServer)
//      {
//        /* Create an empty ADS suffix on the local server. */
//        ADSContext localAdsContext = new ADSContext(localCtx);
//        localAdsContext.createAdministrationSuffix(null);
//      }
      if (!isRemoteServer)
      {
        /* Configure local server to have an ADS */
        adsContext = new ADSContext(localCtx); // adsContext owns localCtx
        adsContext.createAdminData(null);
      }
      assert null != adsContext ; // Bound either to local or remote ADS.

      /* Register new server in ADS. */
      TopologyCacheFilter filter = new TopologyCacheFilter();
      filter.setSearchMonitoringInformation(false);
      filter.setSearchBaseDNInformation(false);
      ServerDescriptor server = ServerDescriptor.createStandalone(localCtx,
          filter);
      server.updateAdsPropertiesWithServerProperties();
      if (0 == adsContext.registerOrUpdateServer(server.getAdsProperties())) {
        if (isRemoteServer) registeredNewServerOnRemote = true;
      } else {
        LOG.log(Level.WARNING, "Server was already registered. Updating " +
                "server registration.");
      }
      if (isRemoteServer)
      {
        ServerDescriptor.seedAdsTrustStore(localCtx,
                                           adsContext.getTrustedCertificates());
      }
      if (isVerbose())
      {
        notifyListeners(getFormattedDoneWithLineBreak());
      }
      checkAbort();

      /* Add global administrator if the user specified one. */
      if (getUserData().mustCreateAdministrator())
      {
        try
        {
          if (isVerbose())
          {
            notifyListeners(getFormattedWithPoints(
                  INFO_PROGRESS_CREATING_ADMINISTRATOR.get()));
          }
          adsContext.createAdministrator(getAdministratorProperties(
                  getUserData()));
          if (isRemoteServer && !createdRemoteAds) createdAdministrator = true;
          if (isVerbose())
          {
            notifyListeners(getFormattedDoneWithLineBreak());
          }
          checkAbort();
        }
        catch (ADSContextException ade)
        {
          if (ade.getError() ==
                  ADSContextException.ErrorType.ALREADY_REGISTERED)
          {
            notifyListeners(getFormattedWarning(
                INFO_ADMINISTRATOR_ALREADY_REGISTERED.get()));
            adsContext.unregisterServer(server.getAdsProperties());
            adsContext.registerServer(server.getAdsProperties());
          }
          else
          {
            throw ade;
          }
View Full Code Here

Examples of org.nasutekds.admin.ads.ServerDescriptor

    else
    {
      type = suf.getType();
    }

    ServerDescriptor s = ServerDescriptor.createStandalone(ctx,
        new TopologyCacheFilter());
    Set<ReplicaDescriptor> replicas = s.getReplicas();
    for (ReplicaDescriptor replica : replicas)
    {
      suffixes.add(replica.getSuffix());
    }
    getUserData().setSuffixesToReplicateOptions(
View Full Code Here

Examples of org.nasutekds.admin.ads.ServerDescriptor

      userData.getSuffixesToReplicateOptions().getSuffixes();
    for (SuffixDescriptor suffix : suffixes)
    {
      for (ReplicaDescriptor replica : suffix.getReplicas())
      {
        ServerDescriptor server = replica.getServer();
        Object v = server.getServerProperties().get(
            ServerDescriptor.ServerProperty.IS_REPLICATION_SERVER);
        if (!Boolean.TRUE.equals(v))
        {

          AuthenticationData authData = new AuthenticationData();
View Full Code Here

Examples of org.nasutekds.admin.ads.ServerDescriptor

    try
    {
      TopologyCacheFilter filter = new TopologyCacheFilter();
      filter.setSearchMonitoringInformation(false);
      filter.addBaseDNToSearch(baseDN);
      ServerDescriptor source = ServerDescriptor.createStandalone(ctxSource,
          filter);
      for (ReplicaDescriptor replica : source.getReplicas())
      {
        if (Utils.areDnsEqual(replica.getSuffix().getDN(), baseDN))
        {
          replicationId = replica.getReplicationId();
          break;
View Full Code Here

Examples of org.nasutekds.guitools.controlpanel.datamodel.ServerDescriptor

  /**
   * {@inheritDoc}
   */
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    ServerDescriptor desc = ev.getNewDescriptor();
    final SortedSet<DN> newElements = new TreeSet<DN>();
    for (BackendDescriptor backend : desc.getBackends())
    {
      if (!backend.isConfigBackend())
      {
        for (BaseDNDescriptor baseDN : backend.getBaseDns())
        {
          newElements.add(baseDN.getDn());
        }
      }
    }
    updateList(newElements);
    updateErrorPaneAndOKButtonIfAuthRequired(desc,
        isLocal() ?
            INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_FOR_BASE_DN_DELETE.get() :
      INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(desc.getHostname()));
  }
View Full Code Here

Examples of org.nasutekds.guitools.controlpanel.datamodel.ServerDescriptor

  /**
   * {@inheritDoc}
   */
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    final ServerDescriptor desc = ev.getNewDescriptor();
    updateErrorPaneIfAuthRequired(desc,
        isLocal() ?
            INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_FOR_INDEX_EDITING.get() :
      INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(desc.getHostname()));
    SwingUtilities.invokeLater(new Runnable()
    {
      /**
       * {@inheritDoc}
       */
 
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.