in src/main/java/com/vmware/vim25/mo/ManagedObject.java [129:158]
protected ObjectContent retrieveObjectProperties(String[] properties) {
ObjectSpec oSpec = PropertyCollectorUtil.creatObjectSpec(
getMOR(), Boolean.FALSE, null);
PropertySpec pSpec = PropertyCollectorUtil.createPropertySpec(
getMOR().getType(),
properties == null || properties.length == 0, //if true, all props of this obj are to be read regardless of propName
properties);
PropertyFilterSpec pfSpec = new PropertyFilterSpec();
pfSpec.setObjectSet(new ObjectSpec[]{oSpec});
pfSpec.setPropSet(new PropertySpec[]{pSpec});
PropertyCollector pc = getServerConnection().getServiceInstance().getPropertyCollector();
ObjectContent[] objs;
try {
objs = pc.retrieveProperties(new PropertyFilterSpec[]{pfSpec});
}
catch (Exception e) {
throw new RuntimeException(e);
}
if (objs == null || objs[0] == null) {
return null;
}
else {
return objs[0];
}
}