Examples of DBCollection


Examples of com.mongodb.DBCollection

    try {

      // force connection to be established
      mongoClient.getDatabaseNames();

      DBCollection ChangedAttr = db.getCollection(ChangedAttributes);

      BasicDBObject newVal = new BasicDBObject("name", comp.getName())
          .append("time", System.currentTimeMillis())
          .append("op", "changed").append("attribute", attr)
          .append("value", newValue).append("oldValue", oldValue);

      for (Map.Entry<String, Object> e : comp.getAllProperties()
          .entrySet()) {
        newVal.append(e.getKey(), e.getValue().toString());
      }
      ChangedAttr.insert(newVal);
    } catch (MongoException e) {

      stop();
    }
  }
View Full Code Here

Examples of com.mongodb.DBCollection

    try {

      // force connection to be established
      mongoClient.getDatabaseNames();

      DBCollection ChangedAttr = db.getCollection(ChangedAttributes);

      BasicDBObject newVal = new BasicDBObject("name", comp.getName())
          .append("time", System.currentTimeMillis())
          .append("op", "removed").append("attribute", attr)
          .append("oldValue", oldValue);

      for (Map.Entry<String, Object> e : comp.getAllProperties()
          .entrySet()) {
        newVal.append(e.getKey(), e.getValue().toString());
      }
      ChangedAttr.insert(newVal);
    } catch (MongoException e) {

      stop();
    }
  }
View Full Code Here

Examples of com.mongodb.DBCollection

      // force connection to be established
      mongoClient.getDatabaseNames();

      logger.info("removing component");
      DBCollection ME = db.getCollection(Entities);

      BasicDBObject created = new BasicDBObject("name", comp.getName())
          .append("time", System.currentTimeMillis()).append("op",
              "deleted");
      ME.insert(created);

    } catch (MongoException e) {

      stop();
    }
View Full Code Here

Examples of com.mongodb.DBCollection

    try {

      // force connection to be established
      mongoClient.getDatabaseNames();

      DBCollection ChangedLink = db.getCollection(Links);

      BasicDBObject newLink = new BasicDBObject("name", wire.getSource()
          .getName()).append("time", System.currentTimeMillis())
          .append("linkType", "Wire")
          .append("linkId", wire.getName())
          .append("removed", wire.getDestination().getName());

      ChangedLink.insert(newLink);

    } catch (MongoException e) {

      stop();
    }
View Full Code Here

Examples of com.mongodb.DBCollection

    public SystemSetting(MongoConnection mongoConnection) {
        super(mongoConnection);
    }
   
    public boolean getBoolean(String key) {
        DBCollection coll = getCollection();
       
        DBObject query = new BasicDBObject();
        query.put("key", key);
       
        DBObject result = coll.findOne(query);
        if (result == null) {
            return false;
        }
       
        if (result.get("value").equals(true)) {
View Full Code Here

Examples of xbird.storage.DbCollection

    private static final boolean DEBUG_LIGHT = true;
    private static final String TEST_FILE = "D:/workspace/xbird/main/test/resources/scenario/storage/auction.xml";

    public DocumentTableTest() throws DbException {
        super(DocumentTableTest.class.getName());
        DbCollection rootCol = DbCollection.getRootCollection();
        rootCol.removeCollection("/test");
        DbCollection testCol = rootCol.createCollection("test");
        testCol.createCollection("xmark");
    }
View Full Code Here

Examples of xbird.storage.DbCollection

        DbCollection testCol = rootCol.createCollection("test");
        testCol.createCollection("xmark");
    }

    public void xtestPutDocument() throws XQueryException, DbException, FileNotFoundException {
        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("dtm");
        assert (xmark.getDirectory().exists());
        DocumentTableModel dtm = new DocumentTableModel(false);
        File file = new File(TEST_FILE);
        dtm.loadDocument(new FileInputStream(file));
        IDocumentTable doc = dtm.getDocumentTable();
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

Examples of xbird.storage.DbCollection

        xmark.putDocument(new Transaction(), file.getName(), doc);
    }

    public void xtestPutDocumentPageOut() throws XQueryException, DbException,
            FileNotFoundException {
        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("dtms");
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new DocumentTable.PersistentDocumentTable(xmark, FileUtils.getFileName(file));
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

Examples of xbird.storage.DbCollection

        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }

    public void xtestPutDocumentBig() throws XQueryException, DbException, FileNotFoundException {
        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("big_dtm");
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new BigDocumentTable();
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

Examples of xbird.storage.DbCollection

        xmark.putDocument(new Transaction(), file.getName(), doc);
    }

    public void xtestPutDocumentPageOutBig() throws XQueryException, DbException,
            FileNotFoundException {
        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("big_dtms");
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new BigDocumentTable.PersistentBigDocumentTable(xmark, FileUtils.getFileName(file));
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.