_context.getServiceContent().getPropertyCollector(),
new PropertyFilterSpec[] { pfSpec });
if(ocs != null && ocs.length > 0) {
for(ObjectContent oc : ocs) {
ArrayOfManagedObjectReference morVms = null;
String gcTagValue = null;
String name = null;
for(DynamicProperty prop : oc.getPropSet()) {
if(prop.getName().equals("name"))
name = prop.getVal().toString();
else if(prop.getName().equals("vm"))
morVms = (ArrayOfManagedObjectReference)prop.getVal();
else if(prop.getName().startsWith("value[")) {
CustomFieldStringValue val = (CustomFieldStringValue)prop.getVal();
if(val != null)
gcTagValue = val.getValue();
}
}
NetworkDetails details = new NetworkDetails(name, oc.getObj(),
(morVms != null ? morVms.getManagedObjectReference() : null),
gcTagValue);
networks.add(details);
}
s_logger.debug("Retrieved " + networks.size() + " networks with key : " + gcTagKey);