public class ExistDatabase extends Object implements XMLDatabase, org.springframework.context.Lifecycle
| Modifier and Type | Field and Description |
|---|---|
static String |
COLLECTION_XCONF
eXist collection configuration special file.
|
| Constructor and Description |
|---|
ExistDatabase() |
| Modifier and Type | Method and Description |
|---|---|
String |
backup()
make a backup of entire database.
|
boolean |
collectionExists(String collection)
check whether a collection exists.
|
void |
create(String name,
String collection,
String content)
creates a new resource or updates the resource if it already exists.
|
void |
createCollection(String collection)
creates a new collection, non recursively.
|
String |
getBackupDir()
Return the dir that contains all backups.
|
protected org.xmldb.api.base.Collection |
getCollection(String collection)
helper method.
|
protected org.xmldb.api.modules.CollectionManagementService |
getColman() |
String |
getConfigFile() |
protected org.xmldb.api.base.Database |
getDatabase() |
protected org.exist.xmldb.DatabaseInstanceManager |
getManager() |
protected org.xmldb.api.modules.XPathQueryService |
getQueryService() |
protected org.xmldb.api.base.Collection |
getRoot() |
String |
getRootCollection()
returns the name of the root collection.
|
Map<String,Trigger> |
getTriggerConf() |
boolean |
isRunning() |
List<String> |
list(String collection)
list the content of a collection.
|
List<String> |
listChildCollections(String collection)
lists child collections.
|
String |
read(String name,
String collection)
read a resource string xml.
|
void |
registerTrigger(Trigger trigger,
String collection)
register a new trigger on a collection.
|
boolean |
remove(String name,
String collection)
removes a resource.
|
void |
removeCollection(String collection)
remove a collection.
|
void |
setBackupDir(String backupDir) |
protected void |
setColman(org.xmldb.api.modules.CollectionManagementService colman) |
void |
setConfigFile(String configFile) |
protected void |
setDatabase(org.xmldb.api.base.Database database) |
protected void |
setManager(org.exist.xmldb.DatabaseInstanceManager manager) |
protected void |
setQueryService(org.xmldb.api.modules.XPathQueryService queryService) |
protected void |
setRoot(org.xmldb.api.base.Collection root) |
void |
setTriggerConf(Map<String,Trigger> triggerConf) |
void |
start() |
void |
stop() |
void |
update(String name,
String collection,
String content)
updates and already existing resource.
|
Iterator<String> |
xquery(String query)
Execute an xquery.
|
void |
xupdate(String query) |
public static final String COLLECTION_XCONF
public void start()
start in interface org.springframework.context.LifecycleLifecycle.start()protected org.xmldb.api.base.Collection getCollection(String collection) throws org.xmldb.api.base.XMLDBException
collection - collection nameorg.xmldb.api.base.XMLDBException - happenspublic void create(String name, String collection, String content) throws org.xmldb.api.base.XMLDBException
create in interface XMLDatabasename - file namecollection - collection namecontent - serialized xml stringorg.xmldb.api.base.XMLDBException - happensXMLDatabase.create(java.lang.String, java.lang.String, java.lang.String)public boolean remove(String name, String collection) throws org.xmldb.api.base.XMLDBException
remove in interface XMLDatabasename - file namecollection - collection nameorg.xmldb.api.base.XMLDBException - could happenXMLDatabase.remove(java.lang.String, java.lang.String)public void update(String name, String collection, String content) throws org.xmldb.api.base.XMLDBException
update in interface XMLDatabasename - file namecollection - collection namecontent - serialized xml stringorg.xmldb.api.base.XMLDBException - fails if the resource doesn't existXMLDatabase.update(java.lang.String, java.lang.String, java.lang.String)public String read(String name, String collection) throws org.xmldb.api.base.XMLDBException
read in interface XMLDatabasename - file namecollection - collection nameorg.xmldb.api.base.XMLDBException - happensXMLDatabase.read(java.lang.String, java.lang.String)public Iterator<String> xquery(String query) throws org.xmldb.api.base.XMLDBException
xquery in interface XMLDatabasequery - xquery sourceorg.xmldb.api.base.XMLDBException - happensXMLDatabase.xquery(java.lang.String)public void xupdate(String query) throws org.xmldb.api.base.XMLDBException
xupdate in interface XMLDatabaseorg.xmldb.api.base.XMLDBExceptionpublic void stop()
stop in interface org.springframework.context.LifecycleLifecycle.stop()public boolean collectionExists(String collection) throws org.xmldb.api.base.XMLDBException
collectionExists in interface XMLDatabasecollection - collection nameorg.xmldb.api.base.XMLDBException - happensXMLDatabase.collectionExists(java.lang.String)public void createCollection(String collection) throws org.xmldb.api.base.XMLDBException
createCollection in interface XMLDatabasecollection - collection nameorg.xmldb.api.base.XMLDBException - happensXMLDatabase.createCollection(java.lang.String)public void removeCollection(String collection) throws org.xmldb.api.base.XMLDBException
removeCollection in interface XMLDatabasecollection - collection nameorg.xmldb.api.base.XMLDBException - happens also when the collection doesn't eXistXMLDatabase.removeCollection(java.lang.String)public String getConfigFile()
public void setConfigFile(String configFile)
public String getBackupDir()
XMLDatabasegetBackupDir in interface XMLDatabasepublic void setBackupDir(String backupDir)
public boolean isRunning()
isRunning in interface org.springframework.context.Lifecycleuseless contract with spring.protected org.xmldb.api.base.Database getDatabase()
protected void setDatabase(org.xmldb.api.base.Database database)
protected org.xmldb.api.base.Collection getRoot()
protected void setRoot(org.xmldb.api.base.Collection root)
protected org.exist.xmldb.DatabaseInstanceManager getManager()
protected void setManager(org.exist.xmldb.DatabaseInstanceManager manager)
protected org.xmldb.api.modules.XPathQueryService getQueryService()
protected void setQueryService(org.xmldb.api.modules.XPathQueryService queryService)
protected org.xmldb.api.modules.CollectionManagementService getColman()
protected void setColman(org.xmldb.api.modules.CollectionManagementService colman)
public String getRootCollection()
XMLDatabasegetRootCollection in interface XMLDatabasepublic List<String> listChildCollections(String collection) throws org.xmldb.api.base.XMLDBException
listChildCollections in interface XMLDatabasecollection - parent collectionsorg.xmldb.api.base.XMLDBException - happensXMLDatabase.listChildCollections(java.lang.String)public List<String> list(String collection) throws org.xmldb.api.base.XMLDBException
list in interface XMLDatabasecollection - parent collectionorg.xmldb.api.base.XMLDBException - happensXMLDatabase.list(java.lang.String)public void registerTrigger(Trigger trigger, String collection) throws org.xmldb.api.base.XMLDBException
registerTrigger in interface XMLDatabasetrigger - trigger instancecollection - collection patternorg.xmldb.api.base.XMLDBException - happensXMLDatabase.registerTrigger(eu.dnetlib.xml.database.Trigger, java.lang.String)public String backup() throws org.xmldb.api.base.XMLDBException, org.exist.util.DatabaseConfigurationException
backup in interface XMLDatabaseorg.xmldb.api.base.XMLDBException - could happenorg.exist.util.DatabaseConfigurationException - could happenXMLDatabase.backup()Copyright © 2026. All rights reserved.