95
95
* </ul>
96
96
*
97
97
* The class should be used in combination with {@link ConsistencyCheck}. The error lists returned by ConsistencyCheck can be passed to {@link
98
- * #export(BackupHandler, org.exist.collections.Collection, BackupWriter, java.util.Date, BackupDescriptor, java.util.List, org.exist.dom.persistent.MutableDocumentSet)}.
98
+ * #export(org.exist.collections.Collection, BackupWriter, java.util.Date, BackupDescriptor, java.util.List, org.exist.dom.persistent.MutableDocumentSet)}.
99
99
*/
100
100
public class SystemExport {
101
101
public final static Logger LOG = LogManager .getLogger (SystemExport .class );
@@ -121,7 +121,6 @@ public class SystemExport {
121
121
private StatusCallback callback = null ;
122
122
private boolean directAccess = false ;
123
123
private ProcessMonitor .Monitor monitor = null ;
124
- private BackupHandler bh = null ;
125
124
private ChainOfReceiversFactory chainFactory ;
126
125
127
126
public SystemExport (final DBBroker broker , final Txn transaction , final StatusCallback callback , final ProcessMonitor .Monitor monitor ,
@@ -140,8 +139,6 @@ public SystemExport(final DBBroker broker, final Txn transaction, final StatusCa
140
139
defaultOutputProperties .setProperty (EXistOutputKeys .PROCESS_XSL_PI , "no" );
141
140
142
141
contentsOutputProps .setProperty (OutputKeys .INDENT , "yes" );
143
-
144
- bh = broker .getDatabase ().getPluginsManager ().getBackupHandler (LOG );
145
142
}
146
143
147
144
@ SuppressWarnings ("unchecked" )
@@ -370,7 +367,7 @@ private void exportOrphans(final BackupWriter output, final DocumentSet docs, fi
370
367
* @throws SAXException
371
368
* @throws TerminatedException DOCUMENT ME!
372
369
*/
373
- private void export (final BackupHandler bh , final Collection current , final BackupWriter output , final Date date , final BackupDescriptor prevBackup , final List <ErrorReport > errorList , final MutableDocumentSet docs ) throws IOException , SAXException , TerminatedException , PermissionDeniedException {
370
+ private void export (final Collection current , final BackupWriter output , final Date date , final BackupDescriptor prevBackup , final List <ErrorReport > errorList , final MutableDocumentSet docs ) throws IOException , SAXException , TerminatedException , PermissionDeniedException {
374
371
// if( callback != null ) {
375
372
// callback.startCollection( current.getURI().toString() );
376
373
// }
@@ -405,16 +402,12 @@ private void export(final BackupHandler bh, final Collection current, final Back
405
402
e .printStackTrace ();
406
403
}
407
404
408
- bh .backup (current , attr );
409
-
410
405
serializer .startElement (Namespaces .EXIST_NS , "collection" , "collection" , attr );
411
406
412
407
if (perm instanceof ACLPermission ) {
413
408
Backup .writeACLPermission (serializer , (ACLPermission ) perm );
414
409
}
415
410
416
- bh .backup (current , serializer );
417
-
418
411
final int docsCount = current .getDocumentCountNoLock (broker );
419
412
int count = 0 ;
420
413
@@ -429,7 +422,7 @@ private void export(final BackupHandler bh, final Collection current, final Back
429
422
if (doc .getFileURI ().equalsInternal (CONTENTS_URI ) || doc .getFileURI ().equalsInternal (LOST_URI )) {
430
423
continue ; // skip __contents__.xml documents
431
424
}
432
- exportDocument (bh , output , date , prevBackup , serializer , docsCount , count , doc );
425
+ exportDocument (output , date , prevBackup , serializer , docsCount , count , doc );
433
426
docs .add (doc , false );
434
427
}
435
428
@@ -479,7 +472,7 @@ private void export(final BackupHandler bh, final Collection current, final Back
479
472
}
480
473
481
474
482
- private void exportDocument (final BackupHandler bh , final BackupWriter output , final Date date , final BackupDescriptor prevBackup , final SAXSerializer serializer , final int docsCount , final int count , final DocumentImpl doc ) throws IOException , SAXException , TerminatedException {
475
+ private void exportDocument (final BackupWriter output , final Date date , final BackupDescriptor prevBackup , final SAXSerializer serializer , final int docsCount , final int count , final DocumentImpl doc ) throws IOException , SAXException , TerminatedException {
483
476
if (callback != null ) {
484
477
callback .startDocument (doc .getFileURI ().toString (), count , docsCount );
485
478
}
@@ -571,15 +564,11 @@ private void exportDocument(final BackupHandler bh, final BackupWriter output, f
571
564
// }
572
565
// }
573
566
574
- bh .backup (doc , attr );
575
-
576
567
serializer .startElement (Namespaces .EXIST_NS , "resource" , "resource" , attr );
577
568
if (perms instanceof ACLPermission ) {
578
569
Backup .writeACLPermission (serializer , (ACLPermission ) perms );
579
570
}
580
571
581
- bh .backup (doc , serializer );
582
-
583
572
serializer .endElement (Namespaces .EXIST_NS , "resource" , "resource" );
584
573
}
585
574
@@ -768,7 +757,7 @@ public boolean indexInfo(final Value value, final long pointer) throws Terminate
768
757
lastPercentage = percentage ;
769
758
jmxAgent .updateStatus (broker .getBrokerPool (), percentage );
770
759
}
771
- export (bh , collection , writer , date , bd , errors , docs );
760
+ export (collection , writer , date , bd , errors , docs );
772
761
}
773
762
} catch (final TerminatedException e ) {
774
763
reportError ("Terminating system export upon request" , e );
@@ -837,7 +826,7 @@ public boolean indexInfo(final Value key, final long pointer) throws TerminatedE
837
826
doc .setFileURI (XmldbURI .createInternal (fileURI ));
838
827
writtenDocs .add (fileURI );
839
828
}
840
- exportDocument (bh , output , date , prevBackup , serializer , 0 , 0 , doc );
829
+ exportDocument (output , date , prevBackup , serializer , 0 , 0 , doc );
841
830
} catch (final Exception e ) {
842
831
reportError ("Caught an exception while scanning documents: " + e .getMessage (), e );
843
832
}
0 commit comments