Package org.apache.xindice.core

Examples of org.apache.xindice.core.DBException


                    }
                }

            }
        } catch (IOException e) {
            throw new DBException(FaultCodes.IDX_CORRUPTED,
                                  "Could not force unwritten data to disk for index " + name + ", collection " + collection.getCanonicalName(), e);
        }
    }
View Full Code Here


                        iw.addDocument(doc);
                        synchronized(lock) {
                            docsAdded++;
                        }
                    } catch (IOException e) {
                        throw new DBException(FaultCodes.IDX_CORRUPTED,
                                              "Failed to add document to the index " + name + ", collection " + collection.getCanonicalName(), e);
                    }
                }
            }

            public void onDocumentDeleted(Key key) throws DBException {
                assertOpen();

                try {
                    iw.deleteDocuments(new Term(KEYNAME, key.toString()));
                    synchronized(lock) {
                        docsDeleted++;
                    }
                } catch (IOException e) {
                    throw new DBException(FaultCodes.IDX_CORRUPTED,
                                          "Failed to delete document from the index " + name + ", collection " + collection.getCanonicalName(), e);
                }
            }

            public void onValueAdded(IndexPattern pattern, String value, Key key, int pos, int len, short elemID, short attrID) {
View Full Code Here

        public Searcher() throws DBException {
            try {
                ir = IndexReader.open(getFile());
                is = new IndexSearcher(ir);
            } catch (IOException e) {
                throw new DBException(FaultCodes.IDX_CORRUPTED,
                                      "Failed to open access " + name + ", collection " + collection.getCanonicalName(), e);
            }
        }
View Full Code Here

        public boolean isCurrent() throws DBException {
            try {
                return ir.isCurrent();
            } catch (IOException e) {
                throw new DBException(FaultCodes.IDX_CORRUPTED,
                                      "Failed to access index " + name + ", collection " + collection.getCanonicalName(), e);
            }
        }
View Full Code Here

                if (ref == 0 || force) {
                    is.close();
                    ir.close();
                }
            } catch (IOException e) {
                throw new DBException(FaultCodes.IDX_CORRUPTED,
                                      "Failed to access index " + name + ", collection " + collection.getCanonicalName(), e);
            }
        }
View Full Code Here

        public Hits search(Query query) throws DBException {
            try {
                return is.search(query);
            } catch (IOException e) {
                throw new DBException(FaultCodes.IDX_CORRUPTED,
                                      "Failed to access index " + name + ", collection " + collection.getCanonicalName(), e);
            }
        }
View Full Code Here

        buf = uri.getBytes();
        pos = 0;
        String tmp;

        if (buf.length == 0) {
            throw new DBException(FaultCodes.URI_EMPTY);
        }

        // TODO: Be Able To Handle Remote URIs
        if ((char) buf[0] != '/') {
            parseName(":"); // Ignore Protocol
View Full Code Here

        int anOperator = theQuery.getOperator();

        // perform the requested matching type
        switch (anOperator) {
            default: // unsupported operator
                throw new DBException(FaultCodes.IDX_NOT_SUPPORTED,
                                      "Unimplemented index query operation code (code = " + anOperator + ")");

            case IndexQuery.EQ: // exact match
                aLocatorSet = (TreeSet) itsValues.get(aLowEndpoint);
                if (aLocatorSet != null) {
View Full Code Here

TOP

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

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.