mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
20.36.2016 2a3158aad80fc910b83336485b3e545dea50066c
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BackupPanel.java
@@ -12,7 +12,7 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2008-2009 Sun Microsystems, Inc.
 * Portions Copyright 2014-2015 ForgeRock AS.
 * Portions Copyright 2014-2016 ForgeRock AS.
 */
package org.opends.guitools.controlpanel.ui;
@@ -63,10 +63,7 @@
import org.opends.server.types.BackupInfo;
import org.opends.server.util.ServerConstants;
/**
 * The panel that appears when the user clicks on 'Backup...'.
 *
 */
/** The panel that appears when the user clicks on 'Backup...'. */
public class BackupPanel extends BackupListPanel
{
  private static final long serialVersionUID = -1626301350756394814L;
@@ -97,38 +94,32 @@
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /**
   * Default constructor.
   *
   */
  /** Default constructor. */
  public BackupPanel()
  {
    super();
    createLayout();
  }
  /** {@inheritDoc} */
  @Override
  public LocalizableMessage getTitle()
  {
    return INFO_CTRL_PANEL_BACKUP_TITLE.get();
  }
  /** {@inheritDoc} */
  @Override
  public Component getPreferredFocusComponent()
  {
    return backupID;
  }
  /** {@inheritDoc} */
  @Override
  protected void verifyBackupClicked()
  {
    // Nothing to do: the button is not visible.
  }
  /**
   * Creates the layout of the panel (but the contents are not populated here).
   *
   */
  /** Creates the layout of the panel (but the contents are not populated here). */
  private void createLayout()
  {
    GridBagConstraints gbc = new GridBagConstraints();
@@ -283,7 +274,7 @@
    changeListener = new ChangeListener()
    {
      /** {@inheritDoc} */
      @Override
      public void stateChanged(ChangeEvent ev)
      {
        backends.setEnabled(!allBackends.isSelected());
@@ -310,7 +301,7 @@
  }
  /**
   * Check status of incremental backup radio/checkbox
   * Check status of incremental backup radio/checkbox.
   *
   * @return boolean true if both incremental and parent base ID
   *                  are selected
@@ -321,14 +312,14 @@
            incrementalBackup.isSelected();
  }
  /** {@inheritDoc} */
  @Override
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    final ServerDescriptor desc = ev.getNewDescriptor();
    updateSimpleBackendComboBoxModel(backends, lNoBackendsFound, desc);
    SwingUtilities.invokeLater(new Runnable()
    {
      /** {@inheritDoc} */
      @Override
      public void run()
      {
        allBackends.setVisible(backends.getModel().getSize() > 0);
@@ -351,7 +342,7 @@
      INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(desc.getHostname()));
  }
  /** {@inheritDoc} */
  @Override
  public void okClicked()
  {
    setPrimaryValid(lBackend);
@@ -460,7 +451,7 @@
    final String path = parentDirectory.getText();
    BackgroundTask<Void> worker = new BackgroundTask<Void>()
    {
      /** {@inheritDoc} */
      @Override
      public Void processBackgroundTask() throws Throwable
      {
        // Open the backup directory and make sure it is valid.
@@ -509,7 +500,7 @@
            errors.add(ERR_CTRL_PANEL_BACKUP_ID_ALREADY_EXIST.get(id, path));
            SwingUtilities.invokeLater(new Runnable()
            {
              /** {@inheritDoc} */
              @Override
              public void run()
              {
                setPrimaryInvalid(lBackupID);
@@ -520,7 +511,7 @@
        }
        return null;
      }
      /** {@inheritDoc} */
      @Override
      public void backgroundTaskCompleted(Void returnValue,
          Throwable t)
      {
@@ -587,7 +578,7 @@
    return schedulePanel.getSchedule();
  }
  /** {@inheritDoc} */
  @Override
  public void cancelClicked()
  {
    setPrimaryValid(lBackend);
@@ -598,7 +589,7 @@
    super.cancelClicked();
  }
  /** {@inheritDoc} */
  @Override
  public void toBeDisplayed(boolean visible)
  {
    super.toBeDisplayed(visible);
@@ -612,10 +603,7 @@
    }
  }
  /**
   * Initialize the backup ID field with a value.
   *
   */
  /** Initialize the backup ID field with a value. */
  private void initializeBackupID()
  {
    SimpleDateFormat dateFormat = new SimpleDateFormat(
@@ -624,10 +612,7 @@
    backupID.setText(id);
  }
  /**
   * Class that launches the backup.
   *
   */
  /** Class that launches the backup. */
  protected class BackupTask extends Task
  {
    private Set<String> backendSet;
@@ -674,20 +659,20 @@
      }
    }
    /** {@inheritDoc} */
    @Override
    public Type getType()
    {
      return Type.BACKUP;
    }
    /** {@inheritDoc} */
    @Override
    public LocalizableMessage getTaskDescription()
    {
      return INFO_CTRL_PANEL_BACKUP_TASK_DESCRIPTION.get(
      Utilities.getStringFromCollection(backendSet, ", "), dir);
    }
    /** {@inheritDoc} */
    @Override
    public boolean canLaunch(Task taskToBeLaunched,
        Collection<LocalizableMessage> incompatibilityReasons)
    {
@@ -706,7 +691,7 @@
      return canLaunch;
    }
    /** {@inheritDoc} */
    @Override
    public void runTask()
    {
      state = State.RUNNING;
@@ -750,13 +735,13 @@
      }
    }
    /** {@inheritDoc} */
    @Override
    public Set<String> getBackends()
    {
      return backendSet;
    }
    /** {@inheritDoc} */
    @Override
    protected ArrayList<String> getCommandLineArguments()
    {
      ArrayList<String> args = new ArrayList<>();
@@ -830,7 +815,7 @@
      return args;
    }
    /** {@inheritDoc} */
    @Override
    protected String getCommandLinePath()
    {
      return getCommandLinePath("backup");