Skip to content

Commit 2afa43d

Browse files
authored
Merge pull request eXist-db#4158 from evolvedbinary/cleanup/remove-plugins-managaer
Remove unused PluginsManager
2 parents 9f506da + 326024b commit 2afa43d

25 files changed

+9
-1227
lines changed

exist-core/src/main/java/org/exist/Database.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.exist.dom.persistent.SymbolTable;
3535
import org.exist.indexing.IndexManager;
3636
import org.exist.numbering.NodeIdFactory;
37-
import org.exist.plugin.PluginsManager;
3837
import org.exist.scheduler.Scheduler;
3938
import org.exist.security.AuthenticationException;
4039
import org.exist.security.SecurityManager;
@@ -181,8 +180,6 @@ public interface Database {
181180

182181
public NotificationService getNotificationService();
183182

184-
public PluginsManager getPluginsManager();
185-
186183
public BlobStore getBlobStore();
187184

188185
public SymbolTable getSymbols();

exist-core/src/main/java/org/exist/backup/BackupHandler.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

exist-core/src/main/java/org/exist/backup/RestoreHandler.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

exist-core/src/main/java/org/exist/backup/SystemExport.java

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
* </ul>
9696
*
9797
* 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)}.
9999
*/
100100
public class SystemExport {
101101
public final static Logger LOG = LogManager.getLogger(SystemExport.class);
@@ -121,7 +121,6 @@ public class SystemExport {
121121
private StatusCallback callback = null;
122122
private boolean directAccess = false;
123123
private ProcessMonitor.Monitor monitor = null;
124-
private BackupHandler bh = null;
125124
private ChainOfReceiversFactory chainFactory;
126125

127126
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
140139
defaultOutputProperties.setProperty(EXistOutputKeys.PROCESS_XSL_PI, "no");
141140

142141
contentsOutputProps.setProperty(OutputKeys.INDENT, "yes");
143-
144-
bh = broker.getDatabase().getPluginsManager().getBackupHandler(LOG);
145142
}
146143

147144
@SuppressWarnings("unchecked")
@@ -370,7 +367,7 @@ private void exportOrphans(final BackupWriter output, final DocumentSet docs, fi
370367
* @throws SAXException
371368
* @throws TerminatedException DOCUMENT ME!
372369
*/
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 {
374371
// if( callback != null ) {
375372
// callback.startCollection( current.getURI().toString() );
376373
// }
@@ -405,16 +402,12 @@ private void export(final BackupHandler bh, final Collection current, final Back
405402
e.printStackTrace();
406403
}
407404

408-
bh.backup(current, attr);
409-
410405
serializer.startElement(Namespaces.EXIST_NS, "collection", "collection", attr);
411406

412407
if (perm instanceof ACLPermission) {
413408
Backup.writeACLPermission(serializer, (ACLPermission) perm);
414409
}
415410

416-
bh.backup(current, serializer);
417-
418411
final int docsCount = current.getDocumentCountNoLock(broker);
419412
int count = 0;
420413

@@ -429,7 +422,7 @@ private void export(final BackupHandler bh, final Collection current, final Back
429422
if (doc.getFileURI().equalsInternal(CONTENTS_URI) || doc.getFileURI().equalsInternal(LOST_URI)) {
430423
continue; // skip __contents__.xml documents
431424
}
432-
exportDocument(bh, output, date, prevBackup, serializer, docsCount, count, doc);
425+
exportDocument(output, date, prevBackup, serializer, docsCount, count, doc);
433426
docs.add(doc, false);
434427
}
435428

@@ -479,7 +472,7 @@ private void export(final BackupHandler bh, final Collection current, final Back
479472
}
480473

481474

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 {
483476
if (callback != null) {
484477
callback.startDocument(doc.getFileURI().toString(), count, docsCount);
485478
}
@@ -571,15 +564,11 @@ private void exportDocument(final BackupHandler bh, final BackupWriter output, f
571564
// }
572565
// }
573566

574-
bh.backup(doc, attr);
575-
576567
serializer.startElement(Namespaces.EXIST_NS, "resource", "resource", attr);
577568
if (perms instanceof ACLPermission) {
578569
Backup.writeACLPermission(serializer, (ACLPermission) perms);
579570
}
580571

581-
bh.backup(doc, serializer);
582-
583572
serializer.endElement(Namespaces.EXIST_NS, "resource", "resource");
584573
}
585574

@@ -768,7 +757,7 @@ public boolean indexInfo(final Value value, final long pointer) throws Terminate
768757
lastPercentage = percentage;
769758
jmxAgent.updateStatus(broker.getBrokerPool(), percentage);
770759
}
771-
export(bh, collection, writer, date, bd, errors, docs);
760+
export(collection, writer, date, bd, errors, docs);
772761
}
773762
} catch (final TerminatedException e) {
774763
reportError("Terminating system export upon request", e);
@@ -837,7 +826,7 @@ public boolean indexInfo(final Value key, final long pointer) throws TerminatedE
837826
doc.setFileURI(XmldbURI.createInternal(fileURI));
838827
writtenDocs.add(fileURI);
839828
}
840-
exportDocument(bh, output, date, prevBackup, serializer, 0, 0, doc);
829+
exportDocument(output, date, prevBackup, serializer, 0, 0, doc);
841830
} catch (final Exception e) {
842831
reportError("Caught an exception while scanning documents: " + e.getMessage(), e);
843832
}

exist-core/src/main/java/org/exist/backup/restore/SystemImportHandler.java

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,8 @@
2424
import org.exist.Namespaces;
2525
import org.exist.backup.BackupDescriptor;
2626
import org.exist.backup.restore.listener.RestoreListener;
27-
import org.exist.collections.Collection;
28-
import org.exist.dom.persistent.LockedDocument;
29-
import org.exist.security.PermissionDeniedException;
3027
import org.exist.storage.DBBroker;
31-
import org.exist.storage.lock.Lock;
3228
import org.exist.storage.txn.Txn;
33-
import org.exist.xmldb.XmldbURI;
3429
import org.xml.sax.Attributes;
3530
import org.xml.sax.SAXException;
3631

@@ -45,8 +40,6 @@
4540
* @author <a href="mailto:adam@exist-db.org">Adam Retter</a>
4641
*/
4742
public class SystemImportHandler extends AbstractRestoreHandler {
48-
49-
private final org.exist.backup.RestoreHandler rh;
5043

5144
/**
5245
* @param broker the database broker
@@ -59,13 +52,11 @@ public class SystemImportHandler extends AbstractRestoreHandler {
5952
public SystemImportHandler(final DBBroker broker, @Nullable final Txn transaction, final BackupDescriptor descriptor,
6053
final RestoreListener listener) {
6154
super(broker, transaction, descriptor, listener, null);
62-
this.rh = broker.getDatabase().getPluginsManager().getRestoreHandler();
6355
}
6456

6557
@Override
6658
public void startDocument() throws SAXException {
6759
super.startDocument();
68-
rh.startDocument();
6960
}
7061

7162
@Override
@@ -77,8 +68,6 @@ public void startElement(final String namespaceURI, final String localName, fina
7768
DELETED_ELEMENT_NAME.equals(localName) ||
7869
ACE_ELEMENT_NAME.equals(localName))) {
7970
super.startElement(namespaceURI, localName, qName, atts);
80-
} else {
81-
rh.startElement(namespaceURI, localName, qName, atts);
8271
}
8372
}
8473

@@ -91,8 +80,6 @@ public void endElement(final String namespaceURI, final String localName, final
9180
DELETED_ELEMENT_NAME.equals(localName) ||
9281
ACE_ELEMENT_NAME.equals(localName))) {
9382
super.endElement(namespaceURI, localName, qName);
94-
} else {
95-
rh.endElement(namespaceURI, localName, qName);
9683
}
9784
}
9885

@@ -102,32 +89,4 @@ protected AbstractRestoreHandler newSelf(final DBBroker broker, final @Nullable
10289
@Nullable final Set<String> pathsToIgnore) {
10390
return new SystemImportHandler(broker, transaction, descriptor, listener);
10491
}
105-
106-
@Override
107-
protected void notifyStartCollectionRestore(final XmldbURI collectionUri, final Attributes attributes) throws PermissionDeniedException {
108-
try (final Collection collection = broker.openCollection(collectionUri, Lock.LockMode.WRITE_LOCK)) {
109-
rh.startCollectionRestore(collection, attributes);
110-
}
111-
}
112-
113-
@Override
114-
protected void notifyEndCollectionRestore(final XmldbURI collectionUri) throws PermissionDeniedException {
115-
try (final Collection collection = broker.openCollection(collectionUri, Lock.LockMode.WRITE_LOCK)) {
116-
rh.endCollectionRestore(collection);
117-
}
118-
}
119-
120-
@Override
121-
protected void notifyStartDocumentRestore(final XmldbURI documentUri, final Attributes attributes) throws PermissionDeniedException {
122-
try (final LockedDocument lockedDocument = broker.getXMLResource(documentUri, Lock.LockMode.WRITE_LOCK)) {
123-
rh.startDocumentRestore(lockedDocument.getDocument(), attributes);
124-
}
125-
}
126-
127-
@Override
128-
protected void notifyEndDocumentRestore(final XmldbURI documentUri) throws PermissionDeniedException {
129-
try (final LockedDocument lockedDocument = broker.getXMLResource(documentUri, Lock.LockMode.WRITE_LOCK)) {
130-
rh.endDocumentRestore(lockedDocument.getDocument());
131-
}
132-
}
13392
}

exist-core/src/main/java/org/exist/client/InteractiveClient.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,6 @@ public class InteractiveClient {
191191

192192
protected ClientFrame frame;
193193

194-
//XXX:make pluggable
195-
private static boolean havePluggableCommands = false;
196-
static {
197-
try {
198-
Class.forName("org.exist.plugin.command.Commands");
199-
havePluggableCommands = true;
200-
} catch (final Exception e) {
201-
havePluggableCommands = false;
202-
}
203-
}
204194
//*************************************
205195

206196
private final CommandlineOptions options;
@@ -245,10 +235,6 @@ protected void displayHelp() {
245235
messageln(" the current collection.");
246236
messageln("lock resource put a write lock on the specified resource.");
247237
messageln("unlock resource remove a write lock from the specified resource.");
248-
if (havePluggableCommands) {
249-
messageln("svn subversion command-line client.");
250-
messageln("threads threads debug information.");
251-
}
252238
messageln("quit quit the program");
253239
}
254240

@@ -1109,20 +1095,6 @@ protected boolean process(final String line) {
11091095
displayHelp();
11101096
} else if (args[0].equalsIgnoreCase("quit")) {
11111097
return false;
1112-
//XXX:make it pluggable
1113-
} else if (havePluggableCommands) {
1114-
final EXistCollectionManagementService mgtService = current.getService(EXistCollectionManagementService.class);
1115-
try {
1116-
mgtService.runCommand(args);
1117-
} catch (final XMLDBException e) {
1118-
if (e.getCause() != null && e.getCause().getClass().getName().equals("org.exist.plugin.command.CommandNotFoundException")) {
1119-
messageln("unknown command: '" + args[0] + "'");
1120-
return true;
1121-
} else {
1122-
throw e;
1123-
}
1124-
}
1125-
//****************************************************************
11261098
} else {
11271099
messageln("unknown command: '" + args[0] + "'");
11281100
return true;

exist-core/src/main/java/org/exist/plugin/Plug.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)