final BasicDBObject systemMap = (BasicDBObject) hostInfoResult.get("system"); final HostInfo.System system = HostInfo.System.create( new DateTime(systemMap.getDate("currentTime")), systemMap.getString("hostname"), systemMap.getInt("cpuAddrSize"),
/** * Access field as a date. * * @param fieldName fully qualified name of the field to be accessed * @return value of the field as a date */ public Date getDate(String fieldName) { BasicDBObject parent = getFieldParent(fieldName); String lf = getLeafName(fieldName); return parent.getDate(lf); }
return 0; final Date serverLocalTime = isMaster.getDate("localTime"); if (serverLocalTime == null) {
return 0; final Date serverLocalTime = isMaster.getDate("localTime"); if (serverLocalTime == null) {
public Todo(BasicDBObject dbObject) { this.id = ((ObjectId) dbObject.get("_id")).toString(); this.title = dbObject.getString("title"); this.done = dbObject.getBoolean("done"); this.createdOn = dbObject.getDate("createdOn"); }
static PCJDetails.Builder toPCJDetails(final BasicDBObject dbo) { requireNonNull(dbo); // PCJ ID. final PCJDetails.Builder builder = PCJDetails.builder() .setId( dbo.getString(PCJ_ID_KEY) ); // PCJ Update Strategy if present. if(dbo.containsField(PCJ_UPDATE_STRAT_KEY)) { builder.setUpdateStrategy( PCJUpdateStrategy.valueOf( dbo.getString(PCJ_UPDATE_STRAT_KEY) ) ); } // Last Update Time if present. if(dbo.containsField(PCJ_LAST_UPDATE_KEY)) { builder.setLastUpdateTime( dbo.getDate(PCJ_LAST_UPDATE_KEY) ); } return builder; }
static PCJDetails.Builder toPCJDetails(final BasicDBObject dbo) { requireNonNull(dbo); // PCJ ID. final PCJDetails.Builder builder = PCJDetails.builder() .setId( dbo.getString(PCJ_ID_KEY) ); // PCJ Update Strategy if present. if(dbo.containsField(PCJ_UPDATE_STRAT_KEY)) { builder.setUpdateStrategy( PCJUpdateStrategy.valueOf( dbo.getString(PCJ_UPDATE_STRAT_KEY) ) ); } // Last Update Time if present. if(dbo.containsField(PCJ_LAST_UPDATE_KEY)) { builder.setLastUpdateTime( dbo.getDate(PCJ_LAST_UPDATE_KEY) ); } return builder; }
return null; Date lastAccess = uiDoc.getDate("expireAt"); if (inactiveUserTimeoutMsec < Math.abs(new Date().getTime() - lastAccess.getTime())) { log.warn("UI for {} expired but were not evicted from DB. Contact MongoDB admin to create expireable " +
.setTemporalIndexDetails(new TemporalIndexDetails(basicObj.getBoolean(TEMPORAL_DETAILS_KEY))) .setFreeTextDetails(new FreeTextIndexDetails(basicObj.getBoolean(FREETEXT_DETAILS_KEY))) .setProspectorDetails(new ProspectorDetails(Optional.<Date>fromNullable(basicObj.getDate(PROSPECTOR_DETAILS_KEY)))) .setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date>fromNullable(basicObj.getDate(JOIN_SELECTIVITY_DETAILS_KEY))));
.setTemporalIndexDetails(new TemporalIndexDetails(basicObj.getBoolean(TEMPORAL_DETAILS_KEY))) .setFreeTextDetails(new FreeTextIndexDetails(basicObj.getBoolean(FREETEXT_DETAILS_KEY))) .setProspectorDetails(new ProspectorDetails(Optional.<Date>fromNullable(basicObj.getDate(PROSPECTOR_DETAILS_KEY)))) .setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date>fromNullable(basicObj.getDate(JOIN_SELECTIVITY_DETAILS_KEY))));
final BasicDBObject systemMap = (BasicDBObject) hostInfoResult.get("system"); final HostInfo.System system = HostInfo.System.create( new DateTime(systemMap.getDate("currentTime")), systemMap.getString("hostname"), systemMap.getInt("cpuAddrSize"),