String msg =
"Updates are only accepted if the url is available. " +
"So no updates will be done. " + "endpoint id: " + endpoint.getId() +
", endpoint path: " + endpoint.getPath() + ".";
log.error(msg);
throw new GovernanceException(msg);
}
boolean succeeded = false;
try {
registry.beginTransaction();
// getting the old endpoint.
Endpoint oldEndpoint = getEndpoint(endpoint.getId());
if (oldEndpoint != null) {
// we are expecting only the OMElement to be different.
String oldPath = oldEndpoint.getPath();
registry.delete(oldPath);
}
addEndpoint(endpoint);
succeeded = true;
} catch (RegistryException e) {
String msg =
"Error in updating the endpoint, endpoint id: " + endpoint.getId() +
", endpoint path: " + endpoint.getPath() + ".";
log.error(msg, e);
throw new GovernanceException(msg, e);
} finally {
if (succeeded) {
try {
registry.commitTransaction();
} catch (RegistryException e) {