Package org.exist.util

Examples of org.exist.util.DatabaseConfigurationException


    }

    public static QName parseQName(Element config, Map<String, String> namespaces) throws DatabaseConfigurationException {
        String name = config.getAttribute(QNAME_ATTR);
        if (StringUtils.isEmpty(name))
            throw new DatabaseConfigurationException("Lucene index configuration error: element " + config.getNodeName() +
                    " must have an attribute " + QNAME_ATTR);

        return parseQName(name, namespaces);
    }
View Full Code Here


            String localName = QName.extractLocalName(name);
            String namespaceURI = "";
            if (prefix != null) {
                namespaceURI = namespaces.get(prefix);
                if(namespaceURI == null) {
                    throw new DatabaseConfigurationException("No namespace defined for prefix: " + prefix +
                            " in index definition");
                }
            }
            QName qname = new QName(localName, namespaceURI, prefix);
            if (isAttribute)
                qname.setNameType(ElementValue.ATTRIBUTE);
            return qname;
        } catch (IllegalArgumentException e) {
            throw new DatabaseConfigurationException("Lucene index configuration error: " + e.getMessage(), e);
        }
    }
View Full Code Here

    public FieldType(Element config, AnalyzerConfig analyzers) throws DatabaseConfigurationException {
       
      if (LuceneConfig.FIELD_TYPE_ELEMENT.equals(config.getLocalName())) {
        id = config.getAttribute(ID_ATTR);
            if (StringUtils.isEmpty(id))
          throw new DatabaseConfigurationException("fieldType needs an attribute 'id'");
      }
     
      String aId = config.getAttribute(ANALYZER_ID_ATTR);
      // save Analyzer for later use in LuceneMatchListener
        if (aId != null && aId.length() > 0) {
          analyzer = analyzers.getAnalyzerById(aId);
            if (analyzer == null)
                throw new DatabaseConfigurationException("No analyzer configured for id " + aId);
            analyzerId = aId;
           
        } else {
          analyzer = analyzers.getDefaultAnalyzer();
        }
       
        String boostAttr = config.getAttribute(BOOST_ATTRIB);
        if (boostAttr != null && boostAttr.length() > 0) {
            try {
                boost = Float.parseFloat(boostAttr);
            } catch (NumberFormatException e) {
                throw new DatabaseConfigurationException("Invalid value for attribute 'boost'. Expected float, " +
                        "got: " + boostAttr);
            }
        }
       
        String storeAttr = config.getAttribute(STORE_ATTRIB);
View Full Code Here

                stack.push(on);
            }
            beanInstances.put(on, mbean);
        } catch (final MalformedObjectNameException e) {
            LOG.warn("Problem registering mbean: " + e.getMessage(), e);
            throw new DatabaseConfigurationException("Exception while registering JMX mbean: " + e.getMessage());
        }
    }
View Full Code Here

                server.registerMBean(mbean, name);
            }

        } catch (final InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {
            LOG.warn("Problem registering mbean: " + e.getMessage(), e);
            throw new DatabaseConfigurationException("Exception while registering JMX mbean: " + e.getMessage());
        }
    }
View Full Code Here

            String localName = QName.extractLocalName(name);
            String namespaceURI = "";
            if (prefix != null) {
                namespaceURI = namespaces.get(prefix);
                if(namespaceURI == null) {
                    throw new DatabaseConfigurationException("NGram index conifg: no namespace defined for prefix: " + prefix +
                        " in index definition");
                }
            }
            qname = new QName(localName, namespaceURI, prefix);
            if (isAttribute)
                qname.setNameType(ElementValue.ATTRIBUTE);
        } catch (IllegalArgumentException e) {
            throw new DatabaseConfigurationException("NGram index configuration: " + e.getMessage(), e);
        }
    }
View Full Code Here

            fileName = config.getAttribute("file");
        if (config.hasAttribute("n"))
            try {
                gramSize = Integer.parseInt(config.getAttribute("n"));
            } catch (NumberFormatException e) {
                throw new DatabaseConfigurationException("Configuration parameter 'n' should be an integer.");
            }
        dataFile = new File(dataDir, fileName);
    }
View Full Code Here

    @Override
    public void open() throws DatabaseConfigurationException {
        try {
            db = new BFile(pool, (byte) 0, false, dataFile, pool.getCacheManager(), 1.4, 0.01, 0.07);
        } catch (DBException e) {
            throw new DatabaseConfigurationException("Failed to create index file: " + dataFile.getAbsolutePath() + ": " +
                e.getMessage());
        }
        if (LOG.isDebugEnabled())
            LOG.debug("Created NGram index: " + dataFile.getAbsolutePath());
    }
View Full Code Here

        this.index = index;
        this.broker = broker;
        try {
            this.engine = new NativeTextEngine(broker, index.getBFile(), broker.getConfiguration());
        } catch (final DBException e) {
            throw new DatabaseConfigurationException(e.getMessage(), e);
        }
    }
View Full Code Here

        LOG.debug("Creating '" + dataFile.getName() + "'...");
        try {
            db = new BFile(pool, (byte)0, false, dataFile, pool.getCacheManager(),
                cacheGrowth, cacheKeyThresdhold, cacheValueThresHold);
        } catch (final DBException e) {
            throw new DatabaseConfigurationException("Failed to create index file: " + dataFile.getAbsolutePath() + ": " +
                e.getMessage());
        }
    }
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.