Updated Branches: refs/heads/master f56e254b4 -> 9e064c845
fixing a bug in checking existing subscriptions Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/9e064c84 Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/9e064c84 Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/9e064c84 Branch: refs/heads/master Commit: 9e064c845f36dfefea5c5248adb67efd515ccf79 Parents: f56e254 Author: Isuru <[email protected]> Authored: Tue Jan 14 13:21:44 2014 +0530 Committer: Isuru <[email protected]> Committed: Tue Jan 14 13:21:44 2014 +0530 ---------------------------------------------------------------------- .../deploy/service/ServiceDeploymentManager.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e064c84/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java index bf1ce62..712aa5b 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java @@ -330,11 +330,17 @@ public class ServiceDeploymentManager { // check if there are already created Subscriptions for this type Collection<CartridgeSubscription> cartridgeSubscriptions = dataInsertionAndRetrievalManager.getCartridgeSubscriptions(type); - if (cartridgeSubscriptions != null && !cartridgeSubscriptions.isEmpty()) { - // can't undeploy; there are existing Subscriptions - String errorMsg = "Cannot undeploy Service since existing Subscriptions are found"; - log.error(errorMsg); - throw new ADCException(errorMsg); + if (cartridgeSubscriptions != null) { + if (!cartridgeSubscriptions.isEmpty()) { + // can't undeploy; there are existing Subscriptions + String errorMsg = "Cannot undeploy Service since existing Subscriptions are found"; + log.error(errorMsg); + throw new ADCException(errorMsg); + } + } + + if (log.isDebugEnabled()) { + log.debug("No subscriptions found for service type: " + type + " , proceeding with undeploying service"); } Service service;
