Examples of BackupDescriptor


Examples of org.exist.backup.BackupDescriptor

        } catch(final XMLDBException xe) {
            throw new RuntimeException(xe.getMessage(), xe);
        }
       
        //parse the sub-collection descriptor and restore
        final BackupDescriptor subDescriptor = descriptor.getChildBackupDescriptor(name);
        if(subDescriptor != null) {
           
            final SAXParser sax;
            try {
                sax = saxFactory.newSAXParser();
           
                final XMLReader reader = sax.getXMLReader();

                final EXistInputSource is = subDescriptor.getInputSource();
                is.setEncoding( "UTF-8" );

                final RestoreHandler handler = new RestoreHandler(listener, dbBaseUri, dbUsername, dbPassword, subDescriptor);

                reader.setContentHandler(handler);
                reader.parse(is);
            } catch(final ParserConfigurationException pce) {
                listener.error("Could not initalise SAXParser for processing sub-collection: " + descriptor.getSymbolicPath(name, false));
            } catch(final IOException ioe) {
                listener.error("Could not read sub-collection for processing: " + ioe.getMessage());
            } catch(final SAXException se) {
                listener.error("SAX exception while reading sub-collection " + subDescriptor.getSymbolicPath() + " for processing: " + se.getMessage());
            }
        } else {
            listener.error("Collection " + descriptor.getSymbolicPath(name, false) + " does not exist or is not readable.");
        }
    }
View Full Code Here

Examples of org.exist.backup.BackupDescriptor

                for( int i = 0; i < files.length; i++ ) {
                    matcher.reset( files[i].getName() );

                    if( matcher.matches() ) {
                        BackupDescriptor descriptor;

                        try {

                            if( files[i].getName().endsWith( ".zip" ) ) {
                                descriptor = new ZipArchiveBackupDescriptor( files[i] );
                            } else {
                              final File descriptorFile = new File(new File(files[i], "db"), BackupDescriptor.COLLECTION_DESCRIPTOR);
                                descriptor = new FileSystemBackupDescriptor( descriptorFile );
                            }
                            final Properties properties = descriptor.getProperties();

                            if( properties != null ) {
                                final AttributesImpl attrs = new AttributesImpl();
                                attrs.addAttribute( "", "file", "file", "CDATA", files[i].getName() );
                                builder.startElement( BACKUP_ELEMENT, attrs );
View Full Code Here

Examples of org.exist.backup.BackupDescriptor

        //exclude /db/system collection and sub-collections, as these have already been restored
//        if ((currentCollection.getURI().startsWith(XmldbURI.SYSTEM)))
//            return;
       
        //parse the sub-collection descriptor and restore
        final BackupDescriptor subDescriptor = descriptor.getChildBackupDescriptor(name);
        if(subDescriptor != null) {
           
            final SAXParser sax;
            try {
                sax = saxFactory.newSAXParser();
           
                final XMLReader reader = sax.getXMLReader();

                final EXistInputSource is = subDescriptor.getInputSource();
                is.setEncoding( "UTF-8" );

                final SystemImportHandler handler = new SystemImportHandler(broker, listener, dbBaseUri, subDescriptor);

                reader.setContentHandler(handler);
View Full Code Here

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

    {
      task.canLaunch(newTask, errors);
    }
    if (errors.isEmpty())
    {
      BackupDescriptor backup = getSelectedBackup();
      launchOperation(newTask,
          INFO_CTRL_PANEL_VERIFYING_BACKUP_SUMMARY.get(backup.getID()),
          INFO_CTRL_PANEL_VERIFYING_BACKUP_SUCCESSFUL_SUMMARY.get(),
          INFO_CTRL_PANEL_VERIFYING_BACKUP_SUCCESSFUL_DETAILS.get(),
          ERR_CTRL_PANEL_VERIFYING_BACKUP_ERROR_SUMMARY.get(),
          null,
          ERR_CTRL_PANEL_VERIFYING_BACKUP_ERROR_DETAILS,
View Full Code Here

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

    listener = new ListSelectionListener()
    {
      public void valueChanged(ListSelectionEvent ev)
      {
        BackupDescriptor backup = getSelectedBackup();
        setEnabledOK((backup != null) && !errorPane.isVisible());
      }
    };
    backupList.getSelectionModel().addListSelectionListener(listener);
View Full Code Here

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

    setPrimaryValid(lAvailableBackups);
    setPrimaryValid(lBackupID);

    final LinkedHashSet<Message> errors = new LinkedHashSet<Message>();

    BackupDescriptor backup = getSelectedBackup();

    if (isLocal())
    {
      boolean selected = backupList.isVisible() && (backup != null);
      if (!selected)
      {
        if (backupList.getRowCount() == 0)
        {
          setPrimaryInvalid(lPath);
          errors.add(ERR_CTRL_PANEL_NO_PARENT_BACKUP_TO_VERIFY.get());
        }
        else
        {
          errors.add(ERR_CTRL_PANEL_REQUIRED_BACKUP_TO_VERIFY.get());
        }
        setPrimaryInvalid(lAvailableBackups);
      }
    }
    else
    {
      String parentPath = parentDirectory.getText();
      if ((parentPath == null) || (parentPath.trim().equals("")))
      {
        errors.add(ERR_CTRL_PANEL_NO_BACKUP_PATH_PROVIDED.get());
        setPrimaryInvalid(lPath);
      }

      String id = backupID.getText();
      if ((id == null) || (id.trim().equals("")))
      {
        errors.add(ERR_CTRL_PANEL_NO_BACKUP_ID_PROVIDED.get());
        setPrimaryInvalid(lBackupID);
      }
    }

    if (errors.isEmpty())
    {
      ProgressDialog progressDialog = new ProgressDialog(
          Utilities.createFrame(), Utilities.getParentDialog(this), getTitle(),
          getInfo());
      RestoreTask newTask = new RestoreTask(getInfo(), progressDialog, false);
      for (Task task : getInfo().getTasks())
      {
        task.canLaunch(newTask, errors);
      }
//    Ask for confirmation
      boolean confirmed = true;
      if (errors.isEmpty())
      {
        confirmed = displayConfirmationDialog(
            INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(),
            INFO_CTRL_PANEL_CONFIRM_RESTORE_DETAILS.get());
      }

      if ((errors.isEmpty()) && confirmed)
      {
        launchOperation(newTask,
            INFO_CTRL_PANEL_RESTORING_SUMMARY.get(backup.getID()),
            INFO_CTRL_PANEL_RESTORING_SUCCESSFUL_SUMMARY.get(),
            INFO_CTRL_PANEL_RESTORING_SUCCESSFUL_DETAILS.get(),
            ERR_CTRL_PANEL_RESTORING_ERROR_SUMMARY.get(),
            null,
            ERR_CTRL_PANEL_RESTORING_ERROR_DETAILS,
View Full Code Here

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

    {
      super(info, dlg);
      this.verify = verify;
      if (isLocal())
      {
        BackupDescriptor backup = getSelectedBackup();
        dir = backup.getPath().getAbsolutePath();
        backupID = backup.getID();
      }
      else
      {
        dir = parentDirectory.getText();
        backupID = RestorePanel.this.backupID.getText();
View Full Code Here

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

   * Returns the selected backup in the list.
   * @return the selected backup in the list.
   */
  protected BackupDescriptor getSelectedBackup()
  {
    BackupDescriptor backup = null;
    int row = backupList.getSelectedRow();
    if (row != -1)
    {
      BackupTableModel model = (BackupTableModel)backupList.getModel();
      backup = model.get(row);
View Full Code Here

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

      /**
       * {@inheritDoc}
       */
      public void valueChanged(ListSelectionEvent ev)
      {
        BackupDescriptor backup = getSelectedBackup();
        verifyBackup.setEnabled(backup != null);
      }
    };
    backupList.getSelectionModel().addListSelectionListener(listener);
    listener.valueChanged(null);
View Full Code Here

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

        {
          if (returnValue.size() > 0)
          {
            for (BackupInfo backup : returnValue)
            {
              model.add(new BackupDescriptor(backup));
            }
            model.fireTableDataChanged();
            Utilities.updateTableSizes(backupList);
            tableScroll.setVisible(true);
            lRefreshingList.setVisible(false);
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.