// No success -> no point in continuing
if (report.getStatus() != SUCCESS) {
return report;
}
Address datasourceAddress = new Address(report.getResourceKey());
// outer create resource did not cater for the connection or xa properties, so lets add them now
String connPropAttributeNameOnServer, connPropPluginConfigPropertyName, keyName;
if (isXADatasourceResource(resourceType)) {
connPropAttributeNameOnServer = "xa-datasource-properties";
connPropPluginConfigPropertyName = XA_DATASOURCE_PROPERTIES_ATTRIBUTE;
keyName = "key";
} else {
connPropAttributeNameOnServer = "connection-properties";
connPropPluginConfigPropertyName = CONNECTION_PROPERTIES_ATTRIBUTE;
keyName = "pname";
}
PropertyList listPropertyWrapper = config.getList(connPropPluginConfigPropertyName);
Map<String, String> connectionPropertiesAsMap = getConnectionPropertiesAsMap(listPropertyWrapper, keyName);
// if no conn or xa props supplied in the create resource request, skip and continue
if (!connectionPropertiesAsMap.isEmpty()) {
CompositeOperation cop = new CompositeOperation();
for (Map.Entry<String, String> connectionProperty : connectionPropertiesAsMap.entrySet()) {
Address propertyAddress = new Address(datasourceAddress);
propertyAddress.add(connPropAttributeNameOnServer, connectionProperty.getKey());
Operation op = new Operation("add", propertyAddress);
op.addAdditionalProperty("value", connectionProperty.getValue());
cop.addStep(op);
}
Result res = getASConnection().execute(cop);