return; }        LocationSchedulePG lspg = org.getLocationSchedulePG(); if (lspg == null) { org.setLocationSchedulePG(lspg = new LocationSchedulePGImpl()); }   Schedule oldls = lspg.getSchedule(); Schedule newls; if (oldls == null) { newls = ldmf.newLocationSchedule(EmptyEnumeration.getEnumeration()); } else { newls = ldmf.newLocationSchedule(oldls.getAllScheduleElements()); }   final UID oaUID = oa.getUID();   Collection found = newls.filter(new UnaryPredicate() { public boolean execute(Object o) { if (o instanceof OrgActivity.OAScheduleElement) { return oaUID.equals(((OrgActivity.OAScheduleElement)o).getOrgActivityUID()); } else { return false; } } });  switch (action) { case Envelope.ADD: { if (found.size()>0) { logger.warn("OPlanWatcher() saw redundant OrgActivity add for "+ oa); } ScheduleElement se = oa.getNormalizedScheduleElement(); if (se != null) { newls.add(se); } } break; case Envelope.CHANGE: { newls.removeAll(found); ScheduleElement se = oa.getNormalizedScheduleElement(); if (se != null) { newls.add(se); } } break; case Envelope.REMOVE: newls.removeAll(found); break; default: logger.warn("OPlanWatcher() somehow caught random envelope type "+ action); return; }                         Collection changes = new ArrayList(); changes.add(new LocalPG.LocalPGChangeReport()); ((NewLocationSchedulePG)lspg).setSchedule(newls); rootplan.change(org, changes); }
  private void processOrgActivity(OrgActivity oa, int action) {    // find the matching Organization    final String orgID = oa.getOrgID();    if (logger.isDebugEnabled()) {      logger.debug("OplanWatcherLP() - OrgActivity = " + oa +		   " action = " + action);    }    Organization org = null;    UnaryPredicate pred =       new UnaryPredicate() {        public boolean execute(Object o) {          if (o instanceof Organization) {            return orgID.equals(((Organization)o).getMessageAddress().toString());          }           return false;        }      };    Enumeration enum = rootplan.searchBlackboard(pred);    if (enum != null && enum.hasMoreElements()) {      org = (Organization)enum.nextElement();    } else {