loaded.setCode(conf.getSimpleProperties().get(pKey).getStringValue());
} else if (pKey.equals("type")) {
loaded.setType(conf.getSimpleProperties().get(pKey).getStringValue());
}
}
Operation write = new WriteAttribute(address);
write.addAdditionalProperty("name", attribute);//attribute to execute on
//now complete the write operation by updating the value
write.addAdditionalProperty("value", (Object) currentAttributeState);
executeWriteAndGenerateAs7ServerUpdate(report, conf, write);
} else {//Need to locate specific module type
//locate specific node and populate the config
String loginModuleIdentifier = attribute + ":";
int index = path.indexOf(loginModuleIdentifier);
String loginModuleIndex = path.substring(index + loginModuleIdentifier.length());
int lmi = Integer.valueOf(loginModuleIndex);//Ex 0,1,30
Value valueObject = currentAttributeState.get(lmi);
//iterate over properties and update values appropriately
for (String pKey : conf.getSimpleProperties().keySet()) {
if (pKey.equals("flag")) {
valueObject.setFlag(conf.getSimpleProperties().get(pKey).getStringValue());
} else if (pKey.equals("code")) {
valueObject.setCode(conf.getSimpleProperties().get(pKey).getStringValue());
} else if (pKey.equals("type")) {
valueObject.setType(conf.getSimpleProperties().get(pKey).getStringValue());
}
}
Operation write = new WriteAttribute(address);
write.addAdditionalProperty("name", attribute);//attribute to execute on
//now complete the write operation by updating the value
write.addAdditionalProperty("value", (Object) currentAttributeState);
executeWriteAndGenerateAs7ServerUpdate(report, conf, write);
}
}
} else if (supportsLoginModuleOptionType(grandParentType)) {//Module Options child.
//get type and lookup supported node and type
String attribute = ModuleOptionsComponent.attributeMap.get(grandParentType.getName());
//get the current attribute value. Will write module types back out exactly as read in with these new updates
ReadAttribute op = new ReadAttribute(address, attribute);
Result result = getASConnection().execute(op);
if (result.isSuccess()) {
//populate attribute values
List<Value> currentAttributeState = new ArrayList<Value>();
currentAttributeState = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
ModuleOptionsComponent.loadModuleOptionType(attribute));
//locate specific node and populate the config
String loginModuleIdentifier = attribute + ":";
int index = path.indexOf(loginModuleIdentifier);
String loginModuleIndex = path.substring(index + loginModuleIdentifier.length());
String[] split = loginModuleIndex.split(",");
int lmi = Integer.valueOf(split[0]);//Ex 0,1,30
Value valueObject = currentAttributeState.get(lmi);
//retrieve current config changes
Configuration conf = report.getConfiguration();
//list current conf stated being defined.
String mapKey = (String) conf.getMap().keySet().toArray()[0];
PropertyMap mapType = (PropertyMap) conf.getMap().get(mapKey);
//insert update logic.
//set this new state passed in as state of the attribute.
LinkedHashMap<String, Object> currentOptions = new LinkedHashMap<String, Object>();
for (String propertyKey : mapType.getMap().keySet()) {
currentOptions.put(propertyKey, ((PropertySimple) mapType.get(propertyKey)).getStringValue());
}
//make these settings the new state for this part of the attribute.
valueObject.setOptions(currentOptions);
currentAttributeState.set(lmi, valueObject);
Operation write = new WriteAttribute(address);
write.addAdditionalProperty("name", attribute);//attribute to execute on
//now complete the write operation by updating the value
write.addAdditionalProperty("value", (Object) currentAttributeState);
executeWriteAndGenerateAs7ServerUpdate(report, conf, write);
}
} else {
ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(configDef, getASConnection(), address);
delegate.updateResourceConfiguration(report);