* if all are matched, do nothing.
*/
private void updateInRecoveryProperty() {
PropertyInfo[] current = cms.getVAppConfig().getProperty();
int index = -1;
PropertySpec propSpec = null;
if (current != null) {
index = InRecoveryPropertyDefinition.find(current);
}
if (index == -1) {
//not found, should add this property
propSpec = new PropertySpecImpl();
PropertyInfo prop = InRecoveryPropertyDefinition.getProp();
prop.setKey(current == null ? 0 : current.length);
propSpec.setInfo(prop);
propSpec.setOperation(Operation.add);
} else if (!InRecoveryPropertyDefinition.match(current[index])) {
//not match the latest definition, update
propSpec = new PropertySpecImpl();
PropertyInfo prop = InRecoveryPropertyDefinition.getProp();
prop.setKey(index);
propSpec.setInfo(prop);
propSpec.setOperation(Operation.edit);
}
if (propSpec != null) {
final ConfigSpec config = new ConfigSpecImpl();
VmConfigSpec spec = new VmConfigSpecImpl();
spec.setProperty(new PropertySpec[]{propSpec});