Package org.nasutekds.guitools.controlpanel.datamodel

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


  {
    ignoreSelectionEvents = true;

    ViewPositions pos = Utilities.getViewPositions(treeScroll);

    ServerDescriptor server = null;
    if (getInfo() != null)
    {
      server = getInfo().getServerDescriptor();
    }
    GeneralMonitoringTreeNode root;
View Full Code Here


    boolean canDisplayMonitorInformation = true;
    if (getInfo() == null)
    {
      return;
    }
    ServerDescriptor server = getInfo().getServerDescriptor();
    ServerDescriptor.ServerStatus status = server.getStatus();
    if (status == ServerDescriptor.ServerStatus.STARTED)
    {
      if (!server.isAuthenticated())
      {
        canDisplayMonitorInformation = false;
        entryPane.displayMessage(
            INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_SUMMARY.get());
      }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    final ServerDescriptor server = ev.getNewDescriptor();
    LinkedHashSet<Object> newElements = new LinkedHashSet<Object>();

    newElements.add(new CategorizedComboBoxElement(ALL_CONNECTION_HANDLERS,
        CategorizedComboBoxElement.Type.REGULAR));
    Set<ConnectionHandlerDescriptor> chs = server.getConnectionHandlers();

    SortedSet<ConnectionHandlerDescriptor> sortedChs =
      new TreeSet<ConnectionHandlerDescriptor>(
          new Comparator<ConnectionHandlerDescriptor>()
          {
            public int compare(ConnectionHandlerDescriptor desc1,
                ConnectionHandlerDescriptor desc2)
            {
              int compare = 0;
              if (desc1.getAddresses().equals(desc2.getAddresses()))
              {
                Integer port1 = new Integer(desc1.getPort());
                Integer port2 = new Integer(desc2.getPort());
                compare = port1.compareTo(port2);
              }
              else
              {
                compare = getConnectionHandlerLabel(desc1).compareTo(
                    getConnectionHandlerLabel(desc2));
              }
              return compare;
            }
          });
    for (ConnectionHandlerDescriptor ch : chs)
    {
      if (protocolHasMonitoring(ch))
      {
        sortedChs.add(ch);
      }
    }
    // Add the administration connector
    sortedChs.add(server.getAdminConnector());

    newElements.add(COMBO_SEPARATOR);

    for (ConnectionHandlerDescriptor ch : sortedChs)
    {
      String connectionHandlerLabel = getConnectionHandlerLabel(ch);
      newElements.add(new CategorizedComboBoxElement(
          connectionHandlerLabel, CategorizedComboBoxElement.Type.REGULAR));
    }
    updateComboBoxModel(newElements,
        (DefaultComboBoxModel)connectionHandlers.getModel());

    boolean displayErrorPane = false;
    Message errorTitle = Message.EMPTY;
    Message errorDetails = Message.EMPTY;
    ServerDescriptor.ServerStatus status = server.getStatus();
    if (status == ServerDescriptor.ServerStatus.STARTED)
    {
      if (!server.isAuthenticated())
      {
        MessageBuilder mb = new MessageBuilder();
        mb.append(
   INFO_CTRL_PANEL_AUTH_REQUIRED_TO_SEE_TRAFFIC_MONITORING_SUMMARY.
   get());
        mb.append("<br><br>"+getAuthenticateHTML());
        errorDetails = mb.toMessage();
        errorTitle = INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_SUMMARY.get();

        displayErrorPane = true;
      }
    }
    else if (status == ServerDescriptor.ServerStatus.NOT_CONNECTED_TO_REMOTE)
    {
      MessageBuilder mb = new MessageBuilder();
      mb.append(INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(
      server.getHostname()));
      mb.append("<br><br>"+getAuthenticateHTML());
      errorDetails = mb.toMessage();
      errorTitle = INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_SUMMARY.get();
      displayErrorPane = true;
    }
View Full Code Here

   * Updates the contents of the panel.
   *
   */
  public void updateContents()
  {
    ServerDescriptor server = null;
    if (getInfo() != null)
    {
      server = getInfo().getServerDescriptor();
    }
    CustomSearchResult csr = null;
    if (server != null)
    {
      csr = server.getWorkQueueMonitor();
    }
    if (csr != null)
    {
      updateMonitoringInfo(attributes, monitoringLabels, csr);
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    final ServerDescriptor desc = ev.getNewDescriptor();
    Schema s = desc.getSchema();
    final boolean schemaChanged;
    if (schema != null && s != null)
    {
      schemaChanged = !ServerDescriptor.areSchemasEqual(s, schema);
    }
    else if (schema == null && s != null)
    {
      schemaChanged = true;
    }
    else if (s == null && schema != null)
    {
      schemaChanged = false;
    }
    else
    {
      schemaChanged = false;
    }
    if (schemaChanged)
    {
      schema = s;

      updateErrorPaneIfAuthRequired(desc,
          isLocal() ?
        INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_FOR_OBJECTCLASS_EDIT.get() :
      INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(desc.getHostname()));
    }
    else if (schema == null)
    {
      updateErrorPane(errorPane,
          ERR_CTRL_PANEL_SCHEMA_NOT_FOUND_SUMMARY.get(),
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    final ServerDescriptor desc = ev.getNewDescriptor();
    updateSimpleBackendComboBoxModel(backends, lNoBackendsFound, desc);
    SwingUtilities.invokeLater(new Runnable()
    {
      /**
       * {@inheritDoc}
       */
      public void run()
      {
        allBackends.setVisible(backends.getModel().getSize() > 0);
        lParentID.setVisible(!desc.isLocal());
        parentBackupID.setVisible(!desc.isLocal());
        if (desc.isLocal())
        {
          lPath.setText(INFO_CTRL_PANEL_BACKUP_PATH_LABEL.get().toString());
        }
        else
        {
          lPath.setText(
              INFO_CTRL_PANEL_PARENT_BACKUP_PATH_LABEL.get().toString());
        }
      }
    });
    super.configurationChanged(ev);
    updateErrorPaneAndOKButtonIfAuthRequired(desc,
        isLocal() ? INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_FOR_BACKUP.get() :
      INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(desc.getHostname()));
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    final ServerDescriptor desc = ev.getNewDescriptor();

    updateCombos(desc);

    updateBrowserControllerAndErrorPane(desc);
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    ServerDescriptor desc = ev.getNewDescriptor();
    final SortedSet<String> sortedBackends = new TreeSet<String>();
    for (BackendDescriptor backend : desc.getBackends())
    {
      if (!backend.isConfigBackend())
      {
        sortedBackends.add(backend.getBackendID());
      }
    }
    ArrayList<Object> newElements = new ArrayList<Object>();
    newElements.addAll(sortedBackends);
    if (sortedBackends.size() > 0)
    {
      newElements.add(COMBO_SEPARATOR);
    }
    newElements.add(NEW_BACKEND);
    super.updateComboBoxModel(newElements,
        ((DefaultComboBoxModel)backends.getModel()));
    updateErrorPaneAndOKButtonIfAuthRequired(desc,
      isLocal() ?
          INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_FOR_CREATE_BASE_DN.get() :
      INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(desc.getHostname()));
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        lRemoteFileHelp.setVisible(!isLocal());
View Full Code Here

    setPrimaryValid(lDirectoryData);
    setSecondaryValid(lPath);
    setSecondaryValid(lNumberOfEntries);
    final LinkedHashSet<Message> errors = new LinkedHashSet<Message>();

    ServerDescriptor desc = getInfo().getServerDescriptor();

    Set<BackendDescriptor> backendObjects = desc.getBackends();

    Object o = backends.getSelectedItem();
    String backendName = String.valueOf(o);
    if (o == null)
    {
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    final ServerDescriptor desc = ev.getNewDescriptor();
    Schema s = desc.getSchema();

    final boolean[] repack = {schema == null};
    final boolean[] error = {false};

    final boolean schemaChanged;
    if (schema != null && s != null)
    {
      schemaChanged = !ServerDescriptor.areSchemasEqual(s, schema);
    }
    else if (schema == null && s != null)
    {
      schemaChanged = true;
    }
    else if (s == null && schema != null)
    {
      schemaChanged = false;
    }
    else
    {
      schemaChanged = false;
    }
    if (schemaChanged)
    {
      schema = s;
    }
    else if (schema == null)
    {
      updateErrorPane(errorPane,
          ERR_CTRL_PANEL_SCHEMA_NOT_FOUND_SUMMARY.get(),
          ColorAndFontConstants.errorTitleFont,
          ERR_CTRL_PANEL_SCHEMA_NOT_FOUND_DETAILS.get(),
          ColorAndFontConstants.defaultFont);
      repack[0] = true;
      error[0] = true;
    }
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        setEnabledOK(!error[0]);
        errorPane.setVisible(error[0]);
        if (schema != null)
        {
          if (schemaChanged)
          {
            superiors.setSchema(schema);
            updateAttributes();
          }
        }
        if (repack[0])
        {
          packParentDialog();
          if (relativeComponent != null)
          {
            Utilities.centerGoldenMean(
                Utilities.getParentDialog(NewObjectClassPanel.this),
                relativeComponent);
          }
        }
      }
    });
    if (!error[0])
    {
      updateErrorPaneAndOKButtonIfAuthRequired(desc,
          isLocal() ?
   INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_TO_CREATE_OBJECTCLASS_SUMMARY.get() :
     INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(desc.getHostname()));
    }
  }
View Full Code Here

TOP

Related Classes of org.nasutekds.guitools.controlpanel.datamodel.ServerDescriptor

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.