Package org.apache.xindice.util

Examples of org.apache.xindice.util.XindiceException


            if (!execute()) {
                printHelp();
            }
        } catch (IllegalArgumentException e) {
            printHelp();
            throw new XindiceException("ERROR : " + e.getMessage(), e);
        } catch (NoSuchElementException e) {
            throw new NoSuchElementException("ERROR : " + e + " Switch found. Parameter missing.");
        } catch (NullPointerException e) {
            e.printStackTrace(System.err);
            throw new NullPointerException("ERROR : " + e);
        } catch (Exception e) {
            e.printStackTrace(System.err);
            throw new XindiceException("ERROR : " + e.getMessage(), e);
        }
    }
View Full Code Here


        Configuration config = loadConfiguration();

        this.database = Database.getDatabase(config);
        if (null == this.database) {
            log.fatal("Unable to configure database");
            throw new XindiceException("Unable to configure database");
        }

        if (log.isDebugEnabled()) {
            log.info("Database name: '" + this.database.getName() + "'");
        }
View Full Code Here

    public ManagedDatabaseImpl(String databaseName) throws FileNotFoundException, XindiceException {
        this.database = Database.getDatabase(databaseName);

        if (null == database) {
            log.fatal("The database " + databaseName + " has not been created.");
            throw new XindiceException("The " + getName() + " driver requires that the database "
                                       + "instance be created and available in the JVM");
        }
    }
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

    }

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

    }

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

    }

    public void createIndexer(String path, String name, String indexdef) 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.createIndexer(DOMParser.toDocument(indexdef));
    }
View Full Code Here

    }

    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

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.