Package org.exist.collections

Examples of org.exist.collections.CollectionConfigurationManager


            Collection root = broker.getOrCreateCollection(transaction, TestConstants.TEST_COLLECTION_URI);
            assertNotNull(root);
            broker.saveCollection(transaction, root);

            CollectionConfigurationManager mgr = pool.getConfigurationManager();
            mgr.addConfiguration(transaction, broker, root, COLLECTION_CONFIG);

            docs = new DefaultDocumentSet();

            IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create("test_string.xml"), XML);
            assertNotNull(info);
View Full Code Here


    DBBroker broker = null;
        final TransactionManager transact = pool.getTransactionManager();
        final Txn txn = transact.beginTransaction();
        try {
            broker = pool.get(user);
            final CollectionConfigurationManager mgr = pool.getConfigurationManager();
            mgr.addConfiguration(txn, broker, parent.getCollection(), configData);
            transact.commit(txn);
            System.out.println("Configured '" + parent.getCollection().getURI() + "'");
        } catch (final CollectionConfigurationException e) {
            transact.abort(txn);
      throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);
View Full Code Here

                    //import an initial collection configuration
                    try {
                        final String initCollectionConfig = readInitCollectionConfig();
                        if(initCollectionConfig != null) {
                            CollectionConfigurationManager collectionConfigurationManager = pool.getConfigurationManager();
                            if(collectionConfigurationManager == null) {
                                //might not yet have been initialised
                                pool.initCollectionConfigurationManager(this);
                                collectionConfigurationManager = pool.getConfigurationManager();
                            }

                            if(collectionConfigurationManager != null) {
                                collectionConfigurationManager.addConfiguration(transaction, this, current, initCollectionConfig);
                            }
                        }
                    } catch(final CollectionConfigurationException cce) {
                        LOG.error("Could not load initial collection configuration for /db: " + cce.getMessage(), cce);
                    }
View Full Code Here

            synchronized(collectionsCache) {
                final XmldbURI uri = collection.getURI();
                final String collName = uri.getRawCollectionPath();

                // Notify the collection configuration manager
                final CollectionConfigurationManager manager = pool.getConfigurationManager();
                if(manager != null) {
                    manager.invalidate(uri, getBrokerPool());
                }

                if(LOG.isDebugEnabled()) {
                    LOG.debug("Removing children collections from their parent '" + collName + "'...");
                }
View Full Code Here

            Collection root = broker.getOrCreateCollection(transaction, col1uri);
            assertNotNull(root);
            broker.saveCollection(transaction, root);

            CollectionConfigurationManager mgr = pool.getConfigurationManager();
            mgr.addConfiguration(transaction, broker, root, COLLECTION_CONFIG);

            System.out.println("store "+doc1uri);
            IndexInfo info = root.validateXMLResource(transaction, broker, doc1uri.lastSegment(), XML);
            assertNotNull(info);
            root.store(transaction, broker, info, XML, false);
View Full Code Here

            final Collection root = broker.getOrCreateCollection(txn, col1uri);
            assertNotNull(root);
            broker.saveCollection(txn, root);

            final CollectionConfigurationManager mgr = pool.getConfigurationManager();
            mgr.addConfiguration(txn, broker, root, COLLECTION_CONFIG);

            //store test data
            IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), XML1);
            root.store(txn, broker, info, XML1, false);
            info = root.validateXMLResource(txn, broker, doc2uri.lastSegment(), XML2);
View Full Code Here

    private void initialiseTriggersForCollections(final DBBroker broker, final XmldbURI uri) throws EXistException, PermissionDeniedException {
        final Collection collection = broker.getCollection(uri);

        //initialize configurations watcher trigger
        if(collection != null) {
            final CollectionConfigurationManager manager = getConfigurationManager();
            final CollectionConfiguration collConf = manager.getOrCreateCollectionConfiguration(broker, collection);

            final DocumentTriggerProxy triggerProxy = new DocumentTriggerProxy(ConfigurationDocumentTrigger.class); //, collection.getURI());
            collConf.documentTriggers().add(triggerProxy);
        }
    }
View Full Code Here

    }

    public void initCollectionConfigurationManager(final DBBroker broker) {
        if(collectionConfigurationManager == null) {
            try {
                collectionConfigurationManager = new CollectionConfigurationManager(broker);
            } catch(final Exception e) {
                LOG.error("Found an error while initializing database: " + e.getMessage(), e);
            }
        }
    }
View Full Code Here

            Collection root = broker.getOrCreateCollection(txn, col1uri);
            assertNotNull(root);
            broker.saveCollection(txn, root);

            CollectionConfigurationManager mgr = pool.getConfigurationManager();
            mgr.addConfiguration(txn, broker, root, COLLECTION_CONFIG);

            System.out.println("STORING DOCUMENT....");
            IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), XML1);
            assertNotNull(info);
            System.out.println("STORING DOCUMENT....SECOND ROUND....");
View Full Code Here

 
              root = broker.getOrCreateCollection(txn, col1uri);
              assertNotNull(root);
              broker.saveCollection(txn, root);
 
              CollectionConfigurationManager mgr = pool.getConfigurationManager();
              mgr.addConfiguration(txn, broker, root, COLLECTION_CONFIG);
 
              System.out.println("store "+doc1uri);
              IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), XML1);
              assertNotNull(info);
              root.store(txn, broker, info, XML1, false);
 
              txnManager.commit(txn);
          } catch (Exception e) {
              e.printStackTrace();
              txnManager.abort(txn);
              fail(e.getMessage());
          }
           
        Metas docMD = md.getMetas(doc1uri);
        assertNotNull(docMD);
       
        String uuid = docMD.getUUID();

            try {
              txn = txnManager.beginTransaction();
              assertNotNull(txn);
              System.out.println("Transaction started ...");
 
              root = broker.getOrCreateCollection(txn, col1uri);
              assertNotNull(root);
              broker.saveCollection(txn, root);
 
              CollectionConfigurationManager mgr = pool.getConfigurationManager();
              mgr.addConfiguration(txn, broker, root, COLLECTION_CONFIG);
 
              System.out.println("store "+doc1uri);
              IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), wrongXML);
              assertNotNull(info);
              root.store(txn, broker, info, wrongXML, false);
View Full Code Here

TOP

Related Classes of org.exist.collections.CollectionConfigurationManager

Copyright © 2018 www.massapicom. 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.