Package com.dbxml.db.core.data

Examples of com.dbxml.db.core.data.RecordMetaData


      try {
         CollectionClientImpl col = (CollectionClientImpl)client.getCollection(colName);
         if ( col == null )
            throw new CompilationException("Template Collection '" + colName + "' not found");

         RecordMetaData meta = col.getInternalCollection().getRecordMetaData(tx, new Key(docName));
         long lastModified = System.currentTimeMillis();
         if ( meta != null ) {
            Long lm = (Long)meta.getValue(RecordMetaData.MODIFIED);
            if ( lm != null )
               lastModified = lm.longValue();
         }

         TemplatesInfo info = (TemplatesInfo)cache.get(path);
View Full Code Here


         if ( restHandler && httpEndpoint ) {
            Request request = context.getRequest();
            Response response = context.getResponse();

            RecordMetaData meta = col.getRecordMetaData(tx, key);
            if ( meta != null ) {
               Long lm = (Long)meta.getValue(RecordMetaData.MODIFIED);
               if ( lm != null ) {
                  String lastModified = GDF.format(new Date(lm.longValue()));

                  response.setHeader(HTTP.HEADER_CACHE_CONTROL, HTTP.VALUE_CACHE);
                  response.setHeader(HTTP.HEADER_LAST_MODIFIED, lastModified);
View Full Code Here

   private RecordMetaData buildMetaData(Page p) {
      BTreeFilerPageHeader ph = (BTreeFilerPageHeader)p.getPageHeader();
      HashMap meta = new HashMap(2);
      meta.put(RecordMetaData.CREATED, new Long(ph.getCreated()));
      meta.put(RecordMetaData.MODIFIED, new Long(ph.getModified()));
      return new RecordMetaData(meta);
   }
View Full Code Here

      checkOpened();
      try {
         long pos = findValue(tx, key);
         Page page = getPage(tx, pos);
         Value v = readValue(tx, page);
         RecordMetaData md = buildMetaData(page);
         return new Record(key, v, md);
      }
      catch ( BTreeNotFoundException b ) {
      }
      catch ( BTreeException b ) {
View Full Code Here

   private RecordMetaData buildMetaData(File f) {
      HashMap meta = new HashMap(2);
      meta.put(RecordMetaData.MODIFIED, new Long(f.lastModified()));
      meta.put(RecordMetaData.SIZE, new Long(f.length()));
      return new RecordMetaData(meta);
   }
View Full Code Here

         locks.acquireLock(file);

         if ( file.exists() && file.isFile() ) {
            byte[] valueData = new byte[(int)file.length()];
            FileInputStream fis = new FileInputStream(file);
            RecordMetaData md = buildMetaData(file);

            fis.read(valueData);
            fis.close();

            return new Record(key, new Value(valueData), md);
View Full Code Here

TOP

Related Classes of com.dbxml.db.core.data.RecordMetaData

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.