Examples of toDb()


Examples of com.ikanow.infinit.e.application.data_model.TestLogstashExtractorPojo.toDb()

        // Copy into the slaves' queue
        DBCursor dbc = DbManager.getIngest().getLogHarvesterSlaves().find();
        while (dbc.hasNext()) {           
          BasicDBObject slave = (BasicDBObject) dbc.next();
          testInfo.forSlave = slave.getString("_id");
          _logHarvesterQ.push(testInfo.toDb());
          testInfo.forSlave = null;

          //DEBUG
          //System.out.println("DISTRIBUTING DELETION MESSAGE TO " + slave.toString());
          _logger.info("distributing deletion message to host=" + slave.toString());
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.config.source.SimpleFederatedCache.toDb()

      for (long i = 0; i < (1 + SimpleFederatedCache.QUERY_FEDERATION_CACHE_CLEANSE_SIZE); ++i) {
        SimpleFederatedCache fakeCacheElement = new SimpleFederatedCache();
        fakeCacheElement.expiryDate = new Date(new Date().getTime() - 3600L*1000L); // (ie expired an hour ago)
        fakeCacheElement._id = testName + "_" + i;
        fakeCacheElement.cachedJson = new BasicDBObject();
        endpointCacheCollection.save(fakeCacheElement.toDb());
      }
      _lastChecked = new Date(new Date().getTime() - 602L*1000L).getTime();
    }
    long count = endpointCacheCollection.count();
    if (shouldBeFull) {
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.config.source.SourcePipelinePojo.toDb()

     
      try {

        // (See records.service for the programmatic definition of this message)
        logstashElement.logstash.config = logStashConfig;
        BasicDBObject logStashDbo = (BasicDBObject) logstashElement.toDb();
        logStashDbo.put("_id", requestId);
        logStashDbo.put("maxDocs", context.getStandaloneMaxDocs());
        logStashDbo.put("sourceKey", source.getKey());
        logStashDbo.put("isAdmin", isAdmin);
 
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.config.source.SourcePojo.toDb()

      DBObject dbo = (BasicDBObject)DbManager.getIngest().getSource().findOne(query);
      SourcePojo sp = SourcePojo.fromDb(dbo,SourcePojo.class);
      sp.setApproved(true);

      DbManager.getIngest().getSource().update(query, (DBObject) sp.toDb());
      rp.setData(sp, new SourcePojoApiMap(null, communityIdSet, null));
      rp.setResponse(new ResponseObject("Approve Source",true,"Source approved successfully"));
     
      // Send email notification to the person who submitted the source
      emailSourceApproval(sp, submitterId, "Approved");
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.config.source.SourcePojo.toDb()

     
      // Case 1: is currently active, set to inactive
     
      if (sp.isApproved()) {
        sp.setApproved(false);
        DbManager.getIngest().getSource().update(query, (DBObject) sp.toDb());
        rp.setResponse(new ResponseObject("Decline Source",true,"Source set to unapproved, use config/source/delete to remove it"));
      }
     
      // Case 2: is currently inactive, has been active
     
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.custom.mapreduce.CustomMapReduceJobPojo.toDb()

      if (null != job) {
        job.lastRunTime = new Date();
        job.nextRunTime = job.lastRunTime.getTime();
        if (!_bLocalMode) {
          // Need to store the times or they just get lost between here and the job completion check 
          MongoDbManager.getCustom().getLookup().save(job.toDb());
            // (not that efficient, but this is essentially a DB call so whatever)
        }
        initializeJob(job);
      }
    }
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.document.DocumentPojo.toDb()

      boolean bAssocs = (null != doc.getAssociations()) && !doc.getAssociations().isEmpty();
     
      if (bEnts || bAssocs) {       
        dummy.setEntities(doc.getEntities());
        dummy.setAssociations(doc.getAssociations());
        DBObject toWrite = dummy.toDb();
        BasicDBObject updateQuery = new BasicDBObject(DocumentPojo.sourceKey_, doc.getSourceKey());
        updateQuery.put(DocumentPojo._id_, doc.getId());
        MongoDbManager.getDocument().getMetadata().update(updateQuery, new BasicDBObject(MongoDbManager.set_, toWrite));
      }//TESTED
     
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.feature.association.AssociationFeaturePojo.toDb()

            }
            if (null != egp.getVerb()) {
              for (String verb: egp.getVerb()) evtFeature.addVerb(verb);
            }             
            if (_diagnosticMode) {
              System.out.println("EventAggregationUtils.updateEventFeatures, found: " + ((BasicDBObject)egp.toDb()).toString());
              System.out.println("EventAggregationUtils.updateEventFeatures, ^^^ found from query: " + query.toString() + " / " + updateOp.toString());
            }
            // (In background aggregation mode we update db_sync_prio when checking the -otherwise unused, unlike entities- document update schedule)
          }
          else // (the object in memory is now an accurate representation of the database, minus some fields we'll now add)
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.feature.entity.EntityFeaturePojo.toDb()

              }
              if (null != gp.getSemanticLinks()) {
                entFeature.addToSemanticLinks(gp.getSemanticLinks());
              }
              if (_diagnosticMode) {
                System.out.println("EntityAggregationUtils.updateEntityFeatures, found: " + ((BasicDBObject)gp.toDb()).toString());
                System.out.println("EntityAggregationUtils.updateEntityFeatures, ^^^ found from query: " + query.toString() + " / " + updateOp.toString());
              }
              // (In background aggregation mode we update db_sync_prio when checking the doc update schedule)
            }
            else // (the object in memory is now an accurate representation of the database, minus some fields we'll now add)
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.authentication.AuthenticationPojo.toDb()

public class AuthUtils {
  public static boolean isAdmin(ObjectId userId) {
    try {
      AuthenticationPojo authQuery = new AuthenticationPojo();
      authQuery.setProfileId(userId);
      BasicDBObject dbo = (BasicDBObject) DbManager.getSocial().getAuthentication().findOne(authQuery.toDb());
      if (null != dbo) {
        AuthenticationPojo ap = AuthenticationPojo.fromDb(dbo, AuthenticationPojo.class);
        if (null != ap.getAccountType()) {
          if (ap.getAccountType().equalsIgnoreCase("admin")) {
            return true;
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.