Github user neykov commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/528#discussion_r25371088
--- Diff:
core/src/main/java/brooklyn/entity/rebind/transformer/CompoundTransformer.java
---
@@ -181,6 +188,18 @@ public Builder changeCatalogItemId(String
oldSymbolicName, String newSymbolicNam
Preconditions.checkNotNull(newSymbolicName,
"new_symbolic_name")+":"+Preconditions.checkNotNull(newVersion, "new_version"));
}
+ /**
+ * Updates all references to a class to a new value
+ * @param oldName the old name of the class
+ * @param newName the new name of the class to be used instead
+ */
+ public Builder renameClass(String oldName, String newName) {
+ return renameClassTag(oldName, newName)
+ .xmlChangeAttribute("//@class[.='" + oldName + "']",
newName)
+ .renameType(oldName, newName);
+ //TODO update reference attributes
--- End diff --
When the same object is used at multiple places it is serialized only once
and referenced from all other places through the `reference` attribute along
with a relative path to the node. When renaming classes the path changes so the
value needs to be updated. Not needed for the advanced-networking transforms so
I didn't spend time implementing it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---