Package org.exist.storage

Examples of org.exist.storage.DBBroker.openCollection()


        final DocumentImpl doc = source.getDocument(broker, resourcePath.lastSegment());
            if(doc == null) {
                transact.abort(transaction);
                throw new XMLDBException(ErrorCodes.NO_SUCH_RESOURCE, "Resource " + resourcePath + " not found");
            }
            destination = broker.openCollection(destinationPath, Lock.WRITE_LOCK);
            if(destination == null) {
                transact.abort(transaction);
                throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION, "Collection " + destinationPath + " not found");
            }
          if(newName == null) {
View Full Code Here


            broker = pool.get(guest);
      transact = pool.getTransactionManager();
      assertNotNull(transact);
      transaction = transact.beginTransaction();

            test = broker.openCollection(uri, Lock.WRITE_LOCK);
            broker.removeCollection(transaction, test);
            transact.commit(transaction);
        } catch (Exception e) {
      transact.abort(transaction);
      e.printStackTrace();
View Full Code Here

    private void retrieveDoc(XmldbURI uri) {
        DBBroker broker = null;
        Collection test = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
            test = broker.openCollection(uri, Lock.WRITE_LOCK);
            assertNotNull(test);
           
            DocumentImpl doc = test.getDocument(broker, XmldbURI.createInternal("document.xml"));
            assertNotNull(doc);
           
View Full Code Here

      final Subject subject = brokerPool.getSubject();
        DBBroker broker = null;
        Collection collection = null;
        try {
            broker = brokerPool.get(user);
            collection = broker.openCollection(path, lockMode);
            if(collection == null) {
                throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + path + " not found");
            }
            collection.setReader(userReader);
        } catch(final PermissionDeniedException e) {
View Full Code Here

        Collection collection = null;
        final TransactionManager transact = brokerPool.getTransactionManager();
        final Txn transaction = transact.beginTransaction();
        try {
            broker = brokerPool.get(user);
            collection = broker.openCollection(path, Lock.WRITE_LOCK);
            if(collection == null) {
                throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + path + " not found");
            }
            broker.saveCollection(transaction, collection);
            transact.commit(transaction);
View Full Code Here

            final Subject subject = brokerPool.getSubject();
            DBBroker broker = null;
            Collection collection = null;
            try {
                broker = brokerPool.get(user);
                collection = broker.openCollection(path, Lock.READ_LOCK);
                if(collection == null) {
                    throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + path + " not found");
                }
                parent = new LocalCollection(user, brokerPool, null, collection.getParentURI(), accessCtx);
            } catch(final PermissionDeniedException e) {
View Full Code Here

            throw new XMLDBException(ErrorCodes.INVALID_URI,e);
        }
       
        try {
            broker = brokerPool.get(user);
            collection = broker.openCollection(path, Lock.READ_LOCK);
            if(collection == null) {
                throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + path + " not found");
            }

            //you only need execute access on the collection, this is enforced in broker.openCollection above!
View Full Code Here

      final Subject subject = brokerPool.getSubject();
        Collection collection = null;
        DBBroker broker = null;
        try {
            broker = brokerPool.get(user);
            collection = broker.openCollection(path, Lock.READ_LOCK);
            if(collection == null) {
                throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + path + " not found");
            }
           
            final List<XmldbURI> allresources = new ArrayList<XmldbURI>();
View Full Code Here

        try {
            if(LOG.isDebugEnabled()) {
                LOG.debug("removing " + resURI);
            }
            broker = brokerPool.get(user);
            collection = broker.openCollection(path, Lock.WRITE_LOCK);
            if(collection == null) {
                transact.abort(transaction);
                throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + path + " not found");
            }
            //Check that the document exists
View Full Code Here

       
        Collection collection = null;
        DBBroker broker = null;
        try {
            broker = brokerPool.get(user);
            collection = broker.openCollection(path, Lock.WRITE_LOCK);
            if(collection == null) {
                transact.abort(txn);
                throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + path + " not found");
            }
           
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.