Package fr.eolya.utils.nosql.mongodb

Examples of fr.eolya.utils.nosql.mongodb.MongoDBCollection


    }
    return nextCrawlStartDate;       
  }

  public String getSourceCrawlProcessStatus(int id) {
    MongoDBCollection coll = new MongoDBCollection(db,"sources");
    String query = String.format("{\"id\": %1$s}", id)
    BasicDBObject docsearch = MongoDBHelper.JSON2BasicDBObject(query);
    DBCursor cur = coll.getColl().find(docsearch);
    if (cur.count()!=1) return null;
    BasicDBObject doc = (BasicDBObject) cur.next();
    return doc.getString("crawl_process_status");
  }
View Full Code Here


      this.dbQueues = this.db;
    this.logger = logger;
  }

  public String getVersion() {
    MongoDBCollection coll = new MongoDBCollection(db,"infos");
    String query = "{\"name\": \"version\"}"
    return coll.getValue(MongoDBHelper.JSON2BasicDBObject (query), "value");   
  }
View Full Code Here

  public MongoDBDocumentCache(String sourceId, MongoDBConnection con, String dbName, String collName) {
    this.con = con;
    this.db = new MongoDBDatabase(this.con, dbName);
    this.collName = collName + "_" + sourceId;
    this.coll = new MongoDBCollection(db,this.collName);
    this.size = this.coll.size();
    this.maxDocSize = 0;
  }
View Full Code Here

  @Override
  public void reset() {
    synchronized (collMonitor) {
      coll.drop();
      coll = new MongoDBCollection(db,this.collName);
    }   
    size = 0;
  }
View Full Code Here

TOP

Related Classes of fr.eolya.utils.nosql.mongodb.MongoDBCollection

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.