Package org.apache.xindice.core.data

Examples of org.apache.xindice.core.data.Key


     *
     * @param docKey The document Key
     * @param document The document to insert
     */
    public final Key insertDocument(Object docKey, Document document) throws DBException {
        Key key = createNewKey(docKey);
        if (log.isInfoEnabled()) {
            log.info(debugHeader() + "Insert document: " + key);
        }
        putDocument(key, document /*, true */);

 
View Full Code Here


     *
     * @param objKey The Key to use
     * @param obj The Object to insert
     */
    public final Key insertObject(String objKey, XMLSerializable obj) throws DBException {
        Key key = createNewKey(objKey);
        if (log.isInfoEnabled()) {
            log.info(debugHeader() + "Insert object: " + key);
        }
        putObject(key, obj /*, true */);

 
View Full Code Here

            // give a hint to the size of the record set, saves on arraylist array copies.
            ArrayList temp = new ArrayList((int) filer.getRecordCount());

            RecordSet set = filer.getRecordSet();
            while (set.hasMoreRecords()) {
                Key key = set.getNextKey();
                temp.add(key.toString());
            }

            return (String[]) temp.toArray(new String[temp.size()]);
        }
    }
View Full Code Here

            log.info(debugHeader() + "Remove " + key);
        }

        checkFiler(FaultCodes.COL_NO_FILER);

        Key objKey = createNewKey(key);

        objKey = getIdentityKey(objKey);
        synchronized (objKey) {
            Object oldDoc = getEntry(objKey);
            if (oldDoc != null && oldDoc instanceof Document) {
                indexManager.removeDocument(objKey, (Document)oldDoc);
            }

            if (documentCache != null) {
                documentCache.removeDocument(this, objKey);
            }

            if (!filer.deleteRecord(objKey)) {
                throw new DBException(FaultCodes.COL_DOCUMENT_NOT_FOUND,
                                      "Resource '" + objKey + "' does not exist in '" + getCanonicalName() + "'");
            }

            // update the meta for this collection if necessary
            updateCollectionMeta();
            // remove the document meta
            if (isMetaEnabled()) {
                getMetaSystemCollection().dropDocumentMeta(this, objKey.toString());
            }
        }
        DBObserver.getInstance().dropDocument(this, objKey);
    }
View Full Code Here

                log.warn("Meta information requested but not enabled in config!");
            }
            return;
        }

        Key key = getIdentityKey(createNewKey(id));
        synchronized (key) {
            Object obj = getEntry(id);
            if (null == obj) {
                throw new DBException(FaultCodes.COL_DOCUMENT_NOT_FOUND,
                                      "Resource '" + id + "' does not exist in '" + getCanonicalName() + "'");
View Full Code Here

        metacol.setDocumentMeta(this, id, meta);
    }

    private Key getIdentityKey(Key key) {
        synchronized (identityMap) {
            Key id = null;
            WeakReference ref = (WeakReference) identityMap.get(key);
            if (ref != null) {
                id = (Key) ref.get();
            }
            if (id == null) {
View Full Code Here

        if (src != null) {
            final String prefix = sourcePrefix("src", NodeSource.SOURCE_NS);

            setAttribute(XMLNS_PREFIX + ":" + prefix, NodeSource.SOURCE_NS);
            setAttribute(prefix + ":" + NodeSource.SOURCE_COL, src.getCollection().getCanonicalName());
            Key k = src.getKey();
            if (k != null) {
                setAttribute(prefix + ":" + NodeSource.SOURCE_KEY, k.toString());
            }
        }
    }
View Full Code Here

        }

        public Container getNextContainer() throws DBException {
            if (set.hasMoreRecords()) {
                Record rec = set.getNextRecord();
                Key key = rec.getKey();
                Value val = rec.getValue();
                if (val.getLength() > 0) {
                    try {
                        if (compressed) {
                            Document doc = new DocumentImpl(val.getData(), symbols, new NodeSource(Collection.this, key));
View Full Code Here

                                         "Error generating RecordSet", e);
            }
        }

        public synchronized boolean indexInfo(Value value, long pointer) {
            keys.add(new Key(value));
            return true;
        }
View Full Code Here

        }

        SortedSet set = new TreeSet();
        boolean done = false;
        List highs = new ArrayList();
        Key highest = null;
        while (!done) {
            boolean eq = true;

            for (int i = 0; i < ptrs.length; i++) {
                Key comp = keySets[i][ptrs[i]];
                if (highest == null) {
                    highest = comp;
                    highs.add(new Integer(i));
                } else {
                    int c = highest.compareTo(comp);
View Full Code Here

TOP

Related Classes of org.apache.xindice.core.data.Key

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.