Package org.apache.xindice.core.data

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


      StringBuffer sb = new StringBuffer(oidTemplate);
      String document = Long.toString(document_id, 16);
      sb.insert(32-document.length(), document);
      sb.setLength(32);

      return new Key(sb.toString());
   }
View Full Code Here


      if ( key == null )
         return createNewOID();
      if ( key instanceof Key )
         return (Key)key;
      else
         return new Key(key.toString());
   }
View Full Code Here

    *
    * @param document The Document
    * @return The new Object Identifier
    */
   public final Key insertDocument(Document document) throws DBException {
      Key key = createNewOID();
      putDocument(key, document /*, true */);
      // update the meta information if necessary
      updateCollectionMeta();
      return key;
   }
View Full Code Here

    * @param key The Object's Key
    */
   public final void remove(Object key) throws DBException {
      checkFiler(FaultCodes.COL_NO_FILER);

      Key objKey = createNewKey(key);

      Document oldDoc = getDocument(objKey);
      if ( oldDoc != null )
         indexManager.removeDocument(objKey, oldDoc);

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

      if ( !filer.deleteRecord(objKey) )
         throw new DBException(FaultCodes.COL_DOCUMENT_NOT_FOUND, "Document Does Not Exist");

      // 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

    * @return The Document
    */
   public final Document getDocument(Object docKey) throws DBException {
      checkFiler(FaultCodes.COL_NO_FILER);

      Key key = createNewKey(docKey);

      Document doc = null;
      if ( documentCache != null )
         doc = documentCache.getDocument(this, key);

View Full Code Here

      final IndexPattern pattern = query.getPattern();

      try {
         query(query, new BTreeCallback() {
            public boolean indexInfo(Value value, long pos) {
               results.add(new IndexMatch(new Key(value), pattern));
               return true;
            }
         });
      }
      catch ( DBException e ) {
View Full Code Here

            throw new FilerException(FaultCodes.GEN_CRITICAL_ERROR, "Error generating RecordSet", e);
         }
      }

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

            Record rec = rs.getNextRecord();

            if ( rec == null )
               continue;
           
            Key key = rec.getKey();
            Document doc = new DocumentImpl(rec.getValue().getData(), symbols, new NodeSource(collection, key));
            try {
               new SAXHandler(key, doc, ACTION_CREATE, list);
            }
            catch ( Exception e ) {
View Full Code Here

         dataPos = keyPos + header.keyLen;
      }

      public synchronized Key getKey() {
         if ( header.keyLen > 0 )
            return new Key(data, keyPos, header.keyLen);
         else
            return null;
      }
View Full Code Here

         return pos < files.length;
      }

      public synchronized Record getNextRecord() throws DBException {
         File file = files[pos++];
         return readRecord(new Key(file.getName()));
      }
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.