Package org.apache.xindice.core

Examples of org.apache.xindice.core.Database


            // The rest of the name locates the collection
            colName = name.substring( colIndex + 1 );
         }

         Database db = Database.getDatabase( dbName );
         if ( db == null ) {
            throw new Exception( "Database " + dbName + " could not be found" );
         }
         Collection col = db.getCollection( colName );
         if ( col == null ) {
            throw new Exception( "Collection " + colName + " could not be found" );
         }

         return col;
View Full Code Here


       * configuration */
      String dbname = config.getAttribute(Database.NAME);

      this.db = Database.getDatabase(dbname);
      if (this.db == null) {
         this.db = new Database();
      }

      if (log.isInfoEnabled()) {
         log.info("Database name: '" + dbname + "'");
      }
View Full Code Here

   public void init(ServletConfig config)
         throws ServletException {

      /* note: there no need to call the DatabaseManager since we already
       * know the database we are using: the XML-RPC one */
      db = new Database();

      /* holds the database configuration */
      Document configuration;
      try {
         configuration = loadConfiguration(config);
View Full Code Here

        tests++;
    }

    public void setUp() throws Exception {
        if (db == null) {
            Database db = new Database();
            db.setConfig(new Configuration(DOMParser.toDocument(DATABASE)));
            col = db.createCollection("testcol", new Configuration(DOMParser.toDocument(COLLECTION)));
            col.insertDocument(DOMParser.toDocument(DOCUMENT));

            XPathQueryResolverTest.db = db;
        }
View Full Code Here

                // The rest of the name locates the collection
                colName = name.substring(colIndex + 1);
            }

            Database db = Database.getDatabase(dbName);
            if (db == null) {
                // TODO: Pass an error code. Current XMLPRC does not provide place for detailed error code.
                throw new Exception("Database " + dbName + " could not be found");
            }
            Collection col = db.getCollection(colName);
            if (col == null) {
                throw new Exception("Collection " + colName + " could not be found");
            }

            return col;
View Full Code Here

        super(name);
    }

    public void setUp() throws Exception {
        String name = getClass().getName();
        db = new Database();
        db.setConfig(new Configuration(DOMParser.toDocument(DatabaseTest.DATABASE)));
        collection = db.createCollection(name, new Configuration(
                DOMParser.toDocument(
                        "<collection compressed=\"true\" name=\"" + name + "\" inline-metadata=\"true\">" +
                            "<filer class=\"org.apache.xindice.core.filer.BTreeFiler\" />" +
View Full Code Here

        indexClass = "org.apache.xindice.core.indexer.ValueIndexer";
    }

    public void setUp() throws Exception {
        String name = getClass().getName();
        db = new Database();
        db.setConfig(new Configuration(DOMParser.toDocument(DatabaseTest.DATABASE)));
        collection = db.createCollection(name, new Configuration(
                DOMParser.toDocument(
                        "<collection compressed='true' name='" + name + "' inline-metadata='true'>" +
                            "<filer class='org.apache.xindice.core.filer.BTreeFiler'/>" +
View Full Code Here

        tests++;
    }

    public void setUp() throws Exception {
        if (db == null) {
            Database db = new Database();
            db.setConfig(new Configuration(DOMParser.toDocument(DATABASE)));
            col = db.createCollection("testcol", new Configuration(DOMParser.toDocument(COLLECTION)));
            col.insertDocument(DOMParser.toDocument(DOCUMENT));

            XPathQueryResolverTest.db = db;
        }
View Full Code Here

                // The rest of the name locates the collection
                colName = name.substring(colIndex + 1);
            }

            Database db = Database.getDatabase(dbName);
            if (db == null) {
                throw new XMLDBException(ErrorCodes.NO_SUCH_DATABASE,
                                         "Database '" + dbName + "' could not be found");
            }

            Collection col = db.getCollection(colName);
            if (col == null) {
                throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION,
                                         "Collection '" + colName + "' could not be found");
            }
View Full Code Here

            System.exit(1);
        }

        // create minimal database configuration instead of trying to locate system.xml
        String config = "<root-collection dbroot='" + path + "/' name='" + name + "'/>";
        Database db = new Database();

        boolean success = true;
        try {
            System.out.println("Processing database " + path);
            System.out.println();
            System.out.println("DI\tCollection name");

            db.setConfig(new Configuration(DOMParser.toDocument(config)));

            if (log.isInfoEnabled()) {
                log.info("Rebuilding collections...");
            }
            success = processCollection(db, command);
        } finally {
            db.close();

            System.out.println();
            System.out.println("Legend:");
            System.out.println("    D Data file");
            System.out.println("    I Index files");
View Full Code Here

TOP

Related Classes of org.apache.xindice.core.Database

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.