if (logger.isInfoEnabled()) logger.info(getAgentIdentifier() + ".addConsPGs Re-BGing PackagedPOLConsumerPG for " + anAsset);
if (logger.isDebugEnabled()) logger.debug(getAgentIdentifier() + ".addConsPGs Re-BGing PackagedPOLConsumerPG for " + anAsset);
  protected void addConsumerPGs(Collection meiConsumers) {    if (logger.isInfoEnabled())      logger.info(getAgentIdentifier() + " in addConsumerPGs with " + meiConsumers.size() + " meis");    Iterator meis = meiConsumers.iterator();    Asset a, anAsset;    // Loop over all the MEIs, adding PGs as necessary    while (meis.hasNext()) {      // Reset this boolean for each Asset so decision to publishChange is accurate      boolean addedPG = false; // Did we add any PGs to this Asset?      a = (Asset)meis.next();      if (a instanceof AggregateAsset) {        anAsset = ((AggregateAsset)a).getAsset();      } else {        anAsset = a;      }      if (anAsset instanceof ClassVIIMajorEndItem) {	if (logger.isInfoEnabled())	  logger.info(getAgentIdentifier() + ".addConsumerPGs for Class7MEI: " + anAsset);        if (anAsset instanceof Level2MEIAsset) {          //This cargo category code means, "do not transport me."          setNoTransportCargoCode(anAsset);        }        boolean[] consumed = checkMeiConsumption(anAsset);	// For each class of supply, add the appropriate consumer PG as necessary        if (consumes(consumed, FUEL)) {	  NewFuelConsumerPG fuelpg = (NewFuelConsumerPG) anAsset.searchForPropertyGroup(FuelConsumerPG.class);	  if ( fuelpg == null) {	    if (logger.isInfoEnabled())	      logger.info("addConsumerPGs() CREATING FuelConsumerPG for "+anAsset+" in "+			  getAgentIdentifier());	    fuelpg =              (NewFuelConsumerPG)getLDM().getFactory().createPropertyGroup(FuelConsumerPG.class);	    fuelpg.setMei(a);	    fuelpg.setService(service);	    fuelpg.setTheater(THEATER);	    if (anAsset instanceof Level2MEIAsset) {	      fuelpg.setFuelBG(new Level2FuelConsumerBG(fuelpg));	    } else {	      fuelpg.setFuelBG(new FuelConsumerBG(fuelpg));	    }	    fuelpg.initialize(this);	    anAsset.setPropertyGroup(fuelpg);	    addedPG = true;	  } else {	    if (logger.isInfoEnabled())	      logger.info(getAgentIdentifier() + ".addConsPGs Re-BGing FuelConsumerPG for " + anAsset);	    if (didRehydrate()) {	      if (logger.isInfoEnabled())		logger.info("          Due to rehydrate. Will re-initialize BG only.");	      fuelpg.initialize(this);	    } else {	      if (logger.isDebugEnabled())		logger.debug("          DidRehydrate is false. Blindly assume the PG is ok and avoid doing excess work.");	      // Note that we could check the Mei, Service, Theater, and BG. But there's	      // no situation where they should not be OK.	    }	  }	} else {	  if (logger.isInfoEnabled())	    logger.info(getAgentIdentifier() + ".addConsPGs not putting FuelPG on asset that does not consume it: " + anAsset);	}        if (consumes(consumed, AMMO)) {          NewAmmoConsumerPG ammopg =	    (NewAmmoConsumerPG)anAsset.searchForPropertyGroup(AmmoConsumerPG.class);	  if (ammopg == null) {	    if (logger.isInfoEnabled())	      logger.info("addConsumerPGs() CREATING AmmoConsumerPG for "+anAsset+" in "+			  getAgentIdentifier());	    ammopg =              (NewAmmoConsumerPG)getLDM().getFactory().createPropertyGroup(AmmoConsumerPG.class);	    ammopg.setMei(a);	    ammopg.setService(service);	    ammopg.setTheater(THEATER);	    if (anAsset instanceof Level2MEIAsset) {	      ammopg.setAmmoBG(new Level2AmmoConsumerBG(ammopg));	    } else {	      ammopg.setAmmoBG(new AmmoConsumerBG(ammopg));	    }	    ammopg.initialize(this);	    anAsset.setPropertyGroup(ammopg);	    addedPG = true;	  } else {	    if (logger.isInfoEnabled())	      logger.info(getAgentIdentifier() + ".addConsPGs Re-BGing AmmoConsumerPG for " + anAsset);	    if (didRehydrate()) {	      if (logger.isInfoEnabled())		logger.info("          Due to rehydrate. Will re-initialize BG only.");	      ammopg.initialize(this);	    } else {	      if (logger.isDebugEnabled())		logger.debug("          DidRehydrate is false. Blindly assume the PG is ok and avoid doing excess work.");	      // Note that we could check the Mei, Service, Theater, and BG. But there's	      // no situation where they should not be OK.	    } // end of block to handle re-BG not rehydrate	  } // end of block to handle existing PG	} else {	  if (logger.isInfoEnabled())	    logger.info(getAgentIdentifier() + ".addConsPGs not putting AmmopG on asset that does not consume it: " + anAsset);	}	        if (consumes(consumed, PKG_POL)) {          NewPackagedPOLConsumerPG packagedpg = (NewPackagedPOLConsumerPG)anAsset.searchForPropertyGroup(PackagedPOLConsumerPG.class);	  if (packagedpg == null) {	    if (logger.isInfoEnabled())	      logger.info("addConsumerPGs() CREATING PackagedPOLConsumerPG for "+anAsset+" in "+			  getAgentIdentifier());	    	    packagedpg =              (NewPackagedPOLConsumerPG)getLDM().getFactory().createPropertyGroup(PackagedPOLConsumerPG.class);	    packagedpg.setMei(a);	    packagedpg.setService(service);	    packagedpg.setTheater(THEATER);	    packagedpg.setPackagedPOLBG(new PackagedPOLConsumerBG(packagedpg));	    packagedpg.initialize(this);	    anAsset.setPropertyGroup(packagedpg);	    addedPG = true;	  } else {	    // Already had this PG	    if (logger.isInfoEnabled())	      logger.info(getAgentIdentifier() + ".addConsPGs Re-BGing PackagedPOLConsumerPG for " + anAsset);	    if (didRehydrate()) {	      if (logger.isInfoEnabled())		logger.info("          Due to rehydrate. Will re-initialize BG only.");	      packagedpg.initialize(this);	    } else {	      if (logger.isDebugEnabled())		logger.debug("          DidRehydrate is false. Blindly assume the PG is ok and avoid doing excess work.");	      // Note that we could check the Mei, Service, Theater, and BG. But there's	      // no situation where they should not be OK.	    } // end of block to handle non-rehydrate existing PG	      	  } // end of block to handle existing PG	} else {	  if (logger.isInfoEnabled())	    logger.info(getAgentIdentifier() + ".addConsPGs not putting PackagedPOLPG on asset that does not consume it: " + anAsset);	}        if (consumes(consumed, SPARES)) {          NewRepairPartConsumerPG partpg =	    (NewRepairPartConsumerPG)anAsset.searchForPropertyGroup(RepairPartConsumerPG.class);	  if (partpg == null) {	    if (logger.isInfoEnabled())	      logger.info("addConsumerPGs() CREATING RepairPartConsumerPG for "+anAsset+" in "+			  getAgentIdentifier());	    	    partpg =              (NewRepairPartConsumerPG)getLDM().getFactory().createPropertyGroup(RepairPartConsumerPG.class);	    partpg.setMei(a);	    partpg.setService(service);	    partpg.setTheater(THEATER);	    partpg.setRepairPartBG(new RepairPartConsumerBG(partpg));	    partpg.initialize(this);	    anAsset.setPropertyGroup(partpg);	    addedPG = true;	  } else {	    // Already had this PG	    if (logger.isInfoEnabled())	      logger.info(getAgentIdentifier() + ".addConsPGs Re-BGing RepairPartConsumerPG for " + anAsset);	    if (didRehydrate()) {	      if (logger.isInfoEnabled())		logger.info("          Due to rehydrate. Will re-initialize BG only.");	      partpg.initialize(this);	    } else {	      if (logger.isDebugEnabled())		logger.debug("          DidRehydrate is false. Blindly assume the PG is ok and avoid doing excess work.");	      // Note that we could check the Mei, Service, Theater, and BG. But there's	      // no situation where they should not be OK.	    } // end of block to handle non-rehydrate existing PG	    	  } // end of block to handle existing PG	} else {	  if (logger.isInfoEnabled())	    logger.info(getAgentIdentifier() + ".addConsPGs not putting RepairPartPG on asset that does not consume it: " + anAsset);	} // end of block to handle RepairPartPG at all		// Only publishChange the Asset if we really changed it        if (addedPG) {          publishChange(a);        } else if (logger.isInfoEnabled()) {	  logger.info(getAgentIdentifier() + ".addConsumerPGs did not add any PGs to " + a);	}      } else {	// Not a Class7MEI	if (logger.isInfoEnabled())	  logger.info(getAgentIdentifier() + ".addConsumerPGs had non Class7MEI: " + a);      }    } // while loop over MEIs  } // addConsumerBGs method