You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Vishanth <gi...@git.apache.org> on 2015/05/13 18:27:10 UTC

[GitHub] stratos pull request: Adding api method for updating cartridge gro...

GitHub user Vishanth opened a pull request:

    https://github.com/apache/stratos/pull/311

    Adding api method for updating cartridge group

    * Added API method for update cartridge group
    * Updated wsdl


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

    $ git pull https://github.com/Vishanth/stratos update-group

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

    https://github.com/apache/stratos/pull/311.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 #311
    
----
commit 6cddb02d12ede270855d76393fbe5a5e28467039
Author: Vishanth <vi...@gmail.com>
Date:   2015-05-13T16:24:07Z

    Adding api method for updating cartridge group

----


---
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] stratos pull request: Adding api method for updating cartridge gro...

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

    https://github.com/apache/stratos/pull/311


---
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] stratos pull request: Adding api method for updating cartridge gro...

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

    https://github.com/apache/stratos/pull/311#discussion_r30254464
  
    --- Diff: components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java ---
    @@ -348,6 +349,28 @@ public void persistServiceGroup(ServiceGroup servicegroup) {
             }
         }
     
    +
    +    public void updateServiceGroup(ServiceGroup serviceGroup) throws InvalidServiceGroupException {
    +        try {
    +            if (serviceGroup == null || StringUtils.isEmpty(serviceGroup.getName())) {
    +                throw new IllegalArgumentException("Cartridge group or group name cannot be null");
    +            }
    +            if (getServiceGroup(serviceGroup.getName()) == null) {
    +                throw new InvalidServiceGroupException(String.format("Cartridge group does not exist: " +
    +                        "[cartridge-group] %s", serviceGroup.getName()));
    +            }
    +
    +            persistServiceGroup(serviceGroup);
    +
    +            if (log.isDebugEnabled()) {
    +                log.debug(String.format("Updated cartridge group: [group-name] %s", serviceGroup.getName()));
    +            }
    +        } catch (Exception e) {
    --- End diff --
    
    Yes please throw an exception with a proper message.


---
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] stratos pull request: Adding api method for updating cartridge gro...

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

    https://github.com/apache/stratos/pull/311#issuecomment-101942797
  
    @imesh resolved the merge conflicts


---
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] stratos pull request: Adding api method for updating cartridge gro...

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

    https://github.com/apache/stratos/pull/311#discussion_r30249647
  
    --- Diff: components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java ---
    @@ -348,6 +349,28 @@ public void persistServiceGroup(ServiceGroup servicegroup) {
             }
         }
     
    +
    +    public void updateServiceGroup(ServiceGroup serviceGroup) throws InvalidServiceGroupException {
    +        try {
    +            if (serviceGroup == null || StringUtils.isEmpty(serviceGroup.getName())) {
    +                throw new IllegalArgumentException("Cartridge group or group name cannot be null");
    +            }
    +            if (getServiceGroup(serviceGroup.getName()) == null) {
    +                throw new InvalidServiceGroupException(String.format("Cartridge group does not exist: " +
    +                        "[cartridge-group] %s", serviceGroup.getName()));
    +            }
    +
    +            persistServiceGroup(serviceGroup);
    +
    +            if (log.isDebugEnabled()) {
    +                log.debug(String.format("Updated cartridge group: [group-name] %s", serviceGroup.getName()));
    +            }
    +        } catch (Exception e) {
    --- End diff --
    
    We can throw the exception to client.


---
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] stratos pull request: Adding api method for updating cartridge gro...

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

    https://github.com/apache/stratos/pull/311#discussion_r30265026
  
    --- Diff: components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java ---
    @@ -348,6 +349,28 @@ public void persistServiceGroup(ServiceGroup servicegroup) {
             }
         }
     
    +
    +    public void updateServiceGroup(ServiceGroup serviceGroup) throws InvalidServiceGroupException {
    +        try {
    +            if (serviceGroup == null || StringUtils.isEmpty(serviceGroup.getName())) {
    +                throw new IllegalArgumentException("Cartridge group or group name cannot be null");
    +            }
    +            if (getServiceGroup(serviceGroup.getName()) == null) {
    +                throw new InvalidServiceGroupException(String.format("Cartridge group does not exist: " +
    +                        "[cartridge-group] %s", serviceGroup.getName()));
    +            }
    +
    +            persistServiceGroup(serviceGroup);
    +
    +            if (log.isDebugEnabled()) {
    +                log.debug(String.format("Updated cartridge group: [group-name] %s", serviceGroup.getName()));
    +            }
    +        } catch (Exception e) {
    --- End diff --
    
    Made the changes.


---
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.
---