Package org.exist.util

Examples of org.exist.util.DatabaseConfigurationException


        try {
            btree = new BTreeStore(pool, STRUCTURAL_INDEX_ID, false,
                    file, pool.getCacheManager(), DEFAULT_STRUCTURAL_KEY_THRESHOLD);
        } catch (final DBException e) {
            LOG.error("Failed to initialize structural index: " + e.getMessage(), e);
            throw new DatabaseConfigurationException(e.getMessage(), e);
        }
    }
View Full Code Here


        String match = node.getAttribute("match");
        if (match != null && match.length() > 0) {
            try {
                path = new NodePath(namespaces, match);
                if (path.length() == 0)
                    throw new DatabaseConfigurationException("Range index module: Invalid match path in collection config: " + match);
            } catch (IllegalArgumentException e) {
                throw new DatabaseConfigurationException("Range index module: invalid qname in configuration: " + e.getMessage());
            }
        } else if (node.hasAttribute("qname")) {
            QName qname = LuceneIndexConfig.parseQName(node, namespaces);
            path = new NodePath(NodePath.SKIP);
            path.addComponent(qname);
            isQNameIndex = true;
        }
        String typeStr = node.getAttribute("type");
        if (typeStr != null && typeStr.length() > 0) {
            try {
                this.type = Type.getType(typeStr);
            } catch (XPathException e) {
                throw new DatabaseConfigurationException("Invalid type declared for range index on " + match + ": " + typeStr);
            }
        }
        String collation = node.getAttribute("collation");
        if (collation != null && collation.length() > 0) {
            try {
                analyzer = new CollationKeyAnalyzer(RangeIndex.LUCENE_VERSION_IN_USE, Collations.getCollationFromURI(null, collation));
            } catch (XPathException e) {
                throw new DatabaseConfigurationException(e.getMessage(), e);
            }
        }
        String nested = node.getAttribute("nested");
        includeNested = (nested == null || nested.equalsIgnoreCase("yes"));
View Full Code Here

    public RangeIndexConfigField(NodePath parentPath, Element elem, Map<String, String> namespaces) throws DatabaseConfigurationException {
        name = elem.getAttribute("name");
        path = parentPath;
        if (name == null || name.length() == 0) {
            throw new DatabaseConfigurationException("Range index module: field element requires a name attribute");
        }
        String match = elem.getAttribute("match");
        if (match != null && match.length() > 0) {
            try {
                relPath = new NodePath(namespaces, match);
                if (relPath.length() == 0)
                    throw new DatabaseConfigurationException("Range index module: Invalid match path in collection config: " + match);
                path = new NodePath(parentPath);
                path.append(relPath);
            } catch (IllegalArgumentException e) {
                throw new DatabaseConfigurationException("Range index module: invalid qname in configuration: " + e.getMessage());
            }
        } else {
            path = parentPath;
        }
        String typeStr = elem.getAttribute("type");
        if (typeStr != null && typeStr.length() > 0) {
            try {
                this.type = Type.getType(typeStr);
            } catch (XPathException e) {
                throw new DatabaseConfigurationException("Invalid type declared for range index on " + match + ": " + typeStr);
            }
        }
        String custom = elem.getAttribute("converter");
        if (custom != null && custom.length() > 0) {
            try {
View Full Code Here

    public void configure(BrokerPool pool, String dataDir, Element config) throws DatabaseConfigurationException {       
        super.configure(pool, dataDir, config);
        try {
            checkDatabase();
        } catch (ClassNotFoundException e) {
            throw new DatabaseConfigurationException(e.getMessage());
        } catch (SQLException e) {
            throw new DatabaseConfigurationException(e.getMessage());
        }
    }
View Full Code Here

    Configuration conf = new Configuration();
   
    String dataDirPath = (String) conf.getProperty(BrokerPool.PROPERTY_DATA_DIR);
   
    if(dataDirPath == null || dataDirPath.equals(""))
      throw new DatabaseConfigurationException("Could not find configuration for data directory");
   
    dataDirPath = dataDirPath.replaceAll("/$", "");
   
//    java.util.GregorianCalendar cal = new java.util.GregorianCalendar();
//    String dateString = cal.toString();
View Full Code Here

        File dir = new File(getDataDir(), getDirName());
        if (LOG.isDebugEnabled())
            LOG.debug("Opening Lucene index directory: " + dir.getAbsolutePath());
        if (dir.exists()) {
            if (!dir.isDirectory())
                throw new DatabaseConfigurationException("Lucene index location is not a directory: " +
                    dir.getAbsolutePath());
        } else
            dir.mkdirs();
        IndexWriter writer = null;
        try {
            directory = FSDirectory.open(dir);
            taxonomyDirectory = FSDirectory.open(new File(dir, "taxonomy"));

            writer = getWriter();
           
        } catch (IOException e) {
            throw new DatabaseConfigurationException("Exception while reading lucene index directory: " +
                e.getMessage(), e);
        } finally {
            releaseWriter(writer);
        }
    }
View Full Code Here

                                if (elem.hasAttribute(BOOST_ATTRIB)) {
                                    String value = elem.getAttribute(BOOST_ATTRIB);
                                    try {
                                        boost = Float.parseFloat(value);
                                    } catch (NumberFormatException e) {
                                        throw new DatabaseConfigurationException("Invalid value for 'boost' attribute in "
                                                + "lucene index config: float expected, got " + value);
                                    }
                                }
                                if (elem.hasAttribute(DIACRITICS)) {
                                    String value = elem.getAttribute(DIACRITICS);
View Full Code Here

        try {
            btree = new BTreeStore(pool, SORT_INDEX_ID, false,
                    file, pool.getCacheManager(), DEFAULT_SORT_KEY_THRESHOLD);
        } catch (DBException e) {
            LOG.error("Failed to initialize structural index: " + e.getMessage(), e);
            throw new DatabaseConfigurationException(e.getMessage(), e);
        }
    }
View Full Code Here

        } else {
            String matchPath = config.getAttribute(MATCH_ATTR);
            try {
        path = new NodePath(namespaces, matchPath);
        if (path.length() == 0)
            throw new DatabaseConfigurationException("Lucene module: Invalid match path in collection config: " +
                matchPath);
      } catch (IllegalArgumentException e) {
        throw new DatabaseConfigurationException("Lucene module: invalid qname in configuration: " + e.getMessage());
      }
        }
        String name = config.getAttribute(FIELD_ATTR);
        if (name != null && name.length() > 0)
          setName(name);
View Full Code Here

                if (null != localName) {
                    switch (localName) {
                        case IGNORE_ELEMENT: {
                            String qnameAttr = ((Element) child).getAttribute(QNAME_ATTR);
                            if (StringUtils.isEmpty(qnameAttr)) {
                                throw new DatabaseConfigurationException("Lucene configuration element 'ignore' needs an attribute 'qname'");
                            }
                            if (specialNodes == null) {
                                specialNodes = new TreeMap<>();
                            }
                            specialNodes.put(parseQName(qnameAttr, namespaces), N_IGNORE);
                            break;
                        }
                        case INLINE_ELEMENT: {
                            String qnameAttr = ((Element) child).getAttribute(QNAME_ATTR);
                            if (StringUtils.isEmpty(qnameAttr)) {
                                throw new DatabaseConfigurationException("Lucene configuration element 'inline' needs an attribute 'qname'");
                            }
                            if (specialNodes == null) {
                                specialNodes = new TreeMap<>();
                            }
                            specialNodes.put(parseQName(qnameAttr, namespaces), N_INLINE);
View Full Code Here

TOP

Related Classes of org.exist.util.DatabaseConfigurationException

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.