Package org.apache.xindice.util

Examples of org.apache.xindice.util.XindiceException


    }

    public String[] listIndexes(String path) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        CollectionManager service = (CollectionManager) col.getService("CollectionManager", "1.0");

        return service.listIndexers();
    }
View Full Code Here


    }

    public void dropIndexer(String path, String name) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        CollectionManager service = (CollectionManager) col.getService("CollectionManager", "1.0");

        service.dropIndexer(name);
    }
View Full Code Here

    }

    public void insertDocument(String path, String name, String doc) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }

        XMLResource document = (XMLResource) col.createResource(name, "XMLResource");
        document.setContent(doc);
        col.storeResource(document);
View Full Code Here

    }

    public int countDocument(String path) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }

        return col.getResourceCount();
    }
View Full Code Here

    }

    public String getDocument(String path, String name) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        XMLResource document = (XMLResource) col.getResource(name);

        if (document == null) {
            return null;
View Full Code Here

    }

    public void updateDocument(String path, String name, String doc) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        XMLResource document = (XMLResource) col.getResource(name);
        document.setContent(doc);
        col.storeResource(document);
    }
View Full Code Here

    }

    public void getDocumentAsSax(String path, String name, ContentHandler handler) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        XMLResource document = (XMLResource) col.getResource(name);

        if (document == null) {
            return;
View Full Code Here

    }

    public void removeDocument(String path, String name) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        XMLResource document = (XMLResource) col.getResource(name);

        col.removeResource(document);
    }
View Full Code Here

    }

    public String getName(String path) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        return col.getName();
    }
View Full Code Here

    }

    public Collection createCollection(String parent, String path, Document configuration) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + parent);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + parent + ") returned null");
        }
        CollectionManager service = (CollectionManager) col.getService("CollectionManager", "1.0");
        return service.createCollection(path, configuration);
    }
View Full Code Here

TOP

Related Classes of org.apache.xindice.util.XindiceException

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.