private static final QName CREDENTIAL_INTERFACE_QNAME = new QName(ConnectorModuleBuilder.GERCONNECTOR_NAMESPACE, "credential-interface");
static void rectifyPlan(GerConnectorType gerConnector) {
boolean updated = false;
XmlCursor cursor = gerConnector.newCursor();
try {
updated = cursor.removeAttribute(VERSION_QNAME);
} finally {
cursor.dispose();
}
GerResourceadapterType[] resourceAdapters = gerConnector.getResourceadapterArray();
for (int i = 0; i < resourceAdapters.length; i++) {
GerResourceadapterType resourceAdapter = resourceAdapters[i];
if (resourceAdapter.isSetOutboundResourceadapter()) {
GerConnectionDefinitionType[] connectionDefinitions = resourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray();
for (int j = 0; j < connectionDefinitions.length; j++) {
GerConnectionDefinitionType connectionDefinition = connectionDefinitions[j];
GerConnectiondefinitionInstanceType[] connectiondefinitionInstances = connectionDefinition.getConnectiondefinitionInstanceArray();
for (int k = 0; k < connectiondefinitionInstances.length; k++) {
GerConnectiondefinitionInstanceType connectiondefinitionInstance = connectiondefinitionInstances[k];
cursor = connectiondefinitionInstance.newCursor();
try {
if (cursor.toFirstChild()) {
if (cursor.toNextSibling(GLOBAL_JNDI_NAME_QNAME)) {
cursor.removeXml();
updated = true;
}
if (cursor.toNextSibling(CREDENTIAL_INTERFACE_QNAME)) {
cursor.removeXml();
updated = true;
}
}
} finally {
cursor.dispose();
}
}
}
}
}