Package org.apache.xindice.util

Examples of org.apache.xindice.util.XindiceException


    }

    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

        try {
            init();
            parseArguments(args);
            execute();
        } catch (IllegalArgumentException e) {
            throw new XindiceException("ERROR : " + e.getMessage() + " Try -h for help.", e);
        } catch (NoSuchElementException e) {
            throw new NoSuchElementException("ERROR : " + e + " Switch found. Parameter missing. Try -h for help.");
        } catch (NullPointerException e) {
            throw new NullPointerException("ERROR : " + e + " Try -h for help.");
        } catch (Exception e) {
            throw new XindiceException("ERROR : " + e.getMessage() + " Try -h for help.", e);
        }
    }
View Full Code Here

     */
    public synchronized void configure() throws IOException, XindiceException {
        db = Database.getDatabase(loadConfiguration());
        if (null == db) {
            log.fatal("Unable to configure database");
            throw new XindiceException("Unable to configure database");
        }
        if (log.isInfoEnabled()) {
            log.info("Database name: '" + db.getName() + "'");
        }
    }
View Full Code Here

               XMLDBException, XindiceException {

        ensureInitialized();
        Collection collection = DatabaseManager.getCollection(collectionUri);
        if (collection == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + collectionUri + ") returned null.");
        }

        return collection;
    }
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.