adding app id to Group
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/7f05298c Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/7f05298c Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/7f05298c Branch: refs/heads/docker-grouping-merge Commit: 7f05298c3680ad1eb72e19cde334fc2df8217514 Parents: 18f1654 Author: Isuru Haththotuwa <[email protected]> Authored: Fri Oct 31 14:33:56 2014 +0530 Committer: Isuru Haththotuwa <[email protected]> Committed: Fri Oct 31 14:33:56 2014 +0530 ---------------------------------------------------------------------- .../org.apache.stratos.autoscaler/pom.xml | 5 +++ .../ApplicationSynchronizerTask.java | 43 ++++++++++++++++++++ .../parser/DefaultApplicationParser.java | 2 +- .../messaging/domain/applications/Group.java | 9 +++- 4 files changed, 57 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/7f05298c/components/org.apache.stratos.autoscaler/pom.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/pom.xml b/components/org.apache.stratos.autoscaler/pom.xml index 35d03da..5ba1eba 100644 --- a/components/org.apache.stratos.autoscaler/pom.xml +++ b/components/org.apache.stratos.autoscaler/pom.xml @@ -170,6 +170,11 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> + <dependency> + <groupId>org.wso2.carbon</groupId> + <artifactId>org.wso2.carbon.ntask.core</artifactId> + <version>4.2.0</version> + </dependency> </dependencies> http://git-wip-us.apache.org/repos/asf/stratos/blob/7f05298c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationSynchronizerTask.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationSynchronizerTask.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationSynchronizerTask.java new file mode 100644 index 0000000..571e7a8 --- /dev/null +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationSynchronizerTask.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.stratos.autoscaler.applications; + +import org.wso2.carbon.ntask.core.Task; + +import java.util.Map; + +public class ApplicationSynchronizerTask implements Task { + + @Override + public void setProperties(Map<String, String> stringStringMap) { + + } + + @Override + public void init() { + + } + + @Override + public void execute() { + + + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/7f05298c/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/parser/DefaultApplicationParser.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/parser/DefaultApplicationParser.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/parser/DefaultApplicationParser.java index 000a06a..c75e883 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/parser/DefaultApplicationParser.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/parser/DefaultApplicationParser.java @@ -416,7 +416,7 @@ public class DefaultApplicationParser implements ApplicationParser { groupCtxt.getAlias() + " is not found in the all Group Definitions collection"); } - Group group = new Group(groupCtxt.getName(), groupCtxt.getAlias()); + Group group = new Group(appId, groupCtxt.getName(), groupCtxt.getAlias()); group.setAutoscalingPolicy(groupCtxt.getAutoscalingPolicy()); group.setDeploymentPolicy(groupCtxt.getDeploymentPolicy()); http://git-wip-us.apache.org/repos/asf/stratos/blob/7f05298c/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/Group.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/Group.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/Group.java index 1f4d323..da52e99 100644 --- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/Group.java +++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/Group.java @@ -39,11 +39,14 @@ public class Group extends ParentComponent implements LifeCycleStateTransitionBe private String deploymentPolicy; // Group level autoscaling policy private String autoscalingPolicy; + // application id + private String applicationId; // Life cycle state manager protected LifeCycleStateManager<GroupStatus> groupStateManager; - public Group (String name, String alias) { + public Group (String applicationId, String name, String alias) { super(); + this.applicationId = applicationId; this.name = name; this.alias = alias; this.groupStateManager = new LifeCycleStateManager<GroupStatus>(GroupStatus.Created, alias); @@ -109,4 +112,8 @@ public class Group extends ParentComponent implements LifeCycleStateTransitionBe public int hashCode () { return name.hashCode() + alias.hashCode(); } + + public String getApplicationId() { + return applicationId; + } }
