org.exist.collections
Class CollectionConfigurationManager

java.lang.Object
  extended by org.exist.collections.CollectionConfigurationManager

public class CollectionConfigurationManager
extends Object

Manages index configurations. Index configurations are stored in a collection hierarchy below /db/system/config. CollectionConfigurationManager is called by Collection to retrieve the CollectionConfiguration instance for a given collection.

Author:
wolf

Field Summary
static String COLLECTION_CONFIG_FILENAME
           
static CollectionURI COLLECTION_CONFIG_PATH
           
static String CONFIG_COLLECTION
           
 
Constructor Summary
CollectionConfigurationManager(DBBroker broker)
           
 
Method Summary
 void addConfiguration(Txn transaction, DBBroker broker, Collection collection, String config)
          Add a new collection configuration.
 void checkRootCollectionConfig(DBBroker broker)
          Create a stored default configuration document for the root collection
 void checkRootCollectionConfigCollection(DBBroker broker)
           
 void invalidateAll(XmldbURI collectionPath)
          Notify the manager that a collection.xconf file has changed.
 void testConfiguration(DBBroker broker, String config)
          Check the passed collection configuration.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_COLLECTION

public static final String CONFIG_COLLECTION
See Also:
Constant Field Values

COLLECTION_CONFIG_FILENAME

public static final String COLLECTION_CONFIG_FILENAME
See Also:
Constant Field Values

COLLECTION_CONFIG_PATH

public static final CollectionURI COLLECTION_CONFIG_PATH
Constructor Detail

CollectionConfigurationManager

public CollectionConfigurationManager(DBBroker broker)
                               throws EXistException,
                                      CollectionConfigurationException
Throws:
EXistException
CollectionConfigurationException
Method Detail

addConfiguration

public void addConfiguration(Txn transaction,
                             DBBroker broker,
                             Collection collection,
                             String config)
                      throws CollectionConfigurationException
Add a new collection configuration. The XML document is passed as a string.

Parameters:
transaction - The transaction that will hold the WRITE locks until they are released by commit()/abort()
broker -
collection - the collection to which the configuration applies.
config - the xconf document as a String.
Throws:
CollectionConfigurationException

testConfiguration

public void testConfiguration(DBBroker broker,
                              String config)
                       throws CollectionConfigurationException
Check the passed collection configuration. Throws an exception if errors are detected in the configuration document. Note: some configuration settings depend on the current environment, in particular the availability of trigger or index classes.

Parameters:
broker - DBBroker
config - the configuration to test
Throws:
CollectionConfigurationException - if errors were detected

invalidateAll

public void invalidateAll(XmldbURI collectionPath)
Notify the manager that a collection.xconf file has changed. All cached configurations for the corresponding collection and its sub-collections will be cleared.

Parameters:
collectionPath -

checkRootCollectionConfigCollection

public void checkRootCollectionConfigCollection(DBBroker broker)
                                         throws EXistException
Throws:
EXistException

checkRootCollectionConfig

public void checkRootCollectionConfig(DBBroker broker)
                               throws EXistException
Create a stored default configuration document for the root collection

Parameters:
broker - The broker which will do the operation
Throws:
EXistException


Copyright (C) Wolfgang Meier. All rights reserved.