Ejemplo n.º 1
0
 // returns location from first oplan w/ info on that time.
 public GeolocLocation getGeoLoc(long time) {
   Enumeration oplans = getOPlans().elements();
   ClusterOPlan oplan;
   GeolocLocation geo;
   while (oplans.hasMoreElements()) {
     oplan = (ClusterOPlan) oplans.nextElement();
     geo = oplan.getGeoLoc(time);
     if (geo != null) return geo;
   }
   return null;
 }
Ejemplo n.º 2
0
 // Each ClusterOPlan updates its own OrgActivities if needed
 private boolean updateOrgActivities() {
   Iterator en = ClusterOPlans_.values().iterator();
   boolean update = false;
   while (en.hasNext()) {
     ClusterOPlan coplan = (ClusterOPlan) en.next();
     IncrementalSubscription s =
         (IncrementalSubscription) orgActivitySubscriptionOfOPlanUID.get(coplan.getOplanUID());
     update = update || coplan.updateOrgActivities(s);
   }
   return update;
 }
Ejemplo n.º 3
0
 public ClusterOPlan getOperativeOPlan(long time, ContextOfUIDs context) {
   // GLMDebug.DEBUG(this.getClass().getName(), clusterId_,"getOperativeOPlan- context is: " +
   // context);
   for (int i = 0, n = context.size(); i < n; i++) {
     ClusterOPlan oplan = findOPlan(context.get(i));
     if (oplan != null) {
       if ((oplan.getStartTime() <= time) && (oplan.getEndTime() > time)) {
         return oplan;
       }
     }
   }
   return null;
 }
Ejemplo n.º 4
0
  private void getClusterOPlans() {
    Collection c =
        query(
            new UnaryPredicate() {
              public boolean execute(Object o) {
                return o instanceof ClusterOPlan;
              }
            });
    for (Iterator i = c.iterator(); i.hasNext(); ) {
      ClusterOPlan coplan = (ClusterOPlan) i.next();
      ClusterOPlans_.put(coplan.getOplanUID(), coplan);
      // ClusterOPlans_.put(oplanUID, coplan);

      UID oplanUID = coplan.getOplanUID();
      IncrementalSubscription oplanActivities =
          (IncrementalSubscription) orgActivitySubscriptionOfOPlanUID.get(oplanUID);
      if (oplanActivities == null) {
        oplanActivities =
            (IncrementalSubscription) subscribe(new OplanOrgActivitiesPredicate(oplanUID));
        monitorPluginSubscription(oplanActivities);
        orgActivitySubscriptionOfOPlanUID.put(oplanUID, oplanActivities);
      }
    }
  }