You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by neykov <gi...@git.apache.org> on 2015/02/24 15:22:16 UTC

[GitHub] incubator-brooklyn pull request: Improve persistence transformers

GitHub user neykov opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/528

    Improve persistence transformers

    * Accept a list of single key-value maps so one file can contain multiple actions with same name
    * When renaming a class replace the new name in the class tag, type element, class attribute

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/neykov/incubator-brooklyn tranformers-rename-class

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/528.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #528
    
----
commit 596bc528aa99023600ffdce2890b13346835b42a
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2015-02-24T13:54:26Z

    Improve state transformers
    
    * Accept a list of single key-value maps so one file can contain multiple actions with same name
    * When renaming a class replace the new name in the class tag, type element, class attribute

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Improve persistence transformers

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/528#issuecomment-76005496
  
    Test failure looks unrelated, and has been happening far too often. Perhaps we need to mark everything that requires an open port to be integration tests?!
    
        java.lang.RuntimeException: unable to find a free port at or above 8080
        	at brooklyn.util.net.Networking.nextAvailablePort(Networking.java:156)
        	at io.brooklyn.camp.CampServer$CampServerUtils.startServer(CampServer.java:151)



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Improve persistence transformers

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/528#issuecomment-76007185
  
    Looks good; merging.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Improve persistence transformers

Posted by neykov <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Improve persistence transformers

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/528#discussion_r25358447
  
    --- 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 --
    
    Not sure what this TODO means?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Improve persistence transformers

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-brooklyn/pull/528


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---