Collection container = support.queryBlackboard(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; while (iter.hasNext()) { Asset asset = (Asset)iter.next(); PropertyTree properties = new PropertyTree(); properties.put(PropertyNames.UID_ATTR, getUIDAsString(asset.getUID()));     String name = support.getEncodedAgentName(); properties.put(PropertyNames.AGENT_NAME, name); CommunityPG communityPG = asset.getCommunityPG(new Date().getTime()); String communityName = null; if (communityPG != null) { Collection communities = communityPG.getCommunities(); if (communities.size() > 1) System.out.println("CSMART_CommunityProviderServlet: WARNING: handling agents in multiple communities is not implemented."); Iterator i = communities.iterator(); while (i.hasNext()) { communityName = (String)i.next(); break;
Collection container = support.queryBlackboard(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; while (iter.hasNext()) { Asset asset = (Asset)iter.next(); PropertyTree properties = new PropertyTree(); properties.put(PropertyNames.UID_ATTR, getUIDAsString(asset.getUID()));     String name = support.getEncodedAgentName(); properties.put(PropertyNames.AGENT_NAME, name); CommunityPG communityPG = asset.getCommunityPG(new Date().getTime()); String communityName = null; if (communityPG != null) { Collection communities = communityPG.getCommunities(); if (communities.size() > 1) System.out.println("CSMART_CommunityProviderServlet: WARNING: handling agents in multiple communities is not implemented."); Iterator i = communities.iterator(); while (i.hasNext()) { communityName = (String)i.next(); break; } } else { communityName = "COUGAAR";
  private Vector getSelfInformation(StringBuffer buf) {    Collection container =       support.queryBlackboard(getSelfPred());    Iterator iter = container.iterator();    Vector results = new Vector(1);    int n = 0; // unique index for relationships    while (iter.hasNext()) {      Asset asset = (Asset)iter.next();      PropertyTree properties = new PropertyTree();      properties.put(PropertyNames.UID_ATTR, getUIDAsString(asset.getUID()));      //      String name = asset.getItemIdentificationPG().getNomenclature();      // THIS METHOD OF ACCESSING AGENT NAME MUST MATCH HOW OTHER ServletS      // (ESPECIALLY CSMART_PlanServlet) ACCESS THE AGENT NAME SO COMPARISONS      // CAN BE MADE AT THE CLIENT      String name = support.getEncodedAgentName();      properties.put(PropertyNames.AGENT_NAME, name);      CommunityPG communityPG = asset.getCommunityPG(new Date().getTime());      String communityName = null;      if (communityPG != null) {	Collection communities = communityPG.getCommunities();	if (communities.size() > 1) 	  System.out.println("CSMART_CommunityProviderServlet: WARNING: handling agents in multiple communities is not implemented.");	Iterator i = communities.iterator();	while (i.hasNext()) {	  communityName = (String)i.next();	  break;	}      } else {	communityName = "COUGAAR";      }      if (communityName != null)	properties.put(PropertyNames.AGENT_COMMUNITY_NAME, communityName);            // reconstruct url      String url = buf.toString();      //URL url = psc.lookupURL(psc.getServerPlugInSupport().getClusterIDAsString());      if (url != null)	properties.put(PropertyNames.AGENT_URL, url.toString());      results.add(properties);    }    return results;  }