You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2015/12/09 18:06:26 UTC

[01/21] stratos git commit: initial changes for signup deletion

Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x bb22134fb -> 647cb07a2


initial changes for signup deletion


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2951b419
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2951b419
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2951b419

Branch: refs/heads/stratos-4.1.x
Commit: 2951b419ad2a3ce0b143d20f01efee5a0b47860a
Parents: 4e868f2
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Fri Nov 27 10:13:24 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Fri Nov 27 10:13:24 2015 +0530

----------------------------------------------------------------------
 .../modules/artifactmgt/git/agentgithandler.py  | 19 +++++++++++++++++
 .../plugins/DefaultArtifactCheckout.py          | 22 ++++++++++++++++++++
 2 files changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/2951b419/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
index c283011..2cb4c38 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
@@ -28,6 +28,7 @@ import time
 from config import Config
 from exception import GitRepositorySynchronizationException
 from git import *
+import errno
 
 from ...util.asyncscheduledtask import AbstractAsyncScheduledTask, ScheduledExecutor
 from ...util.log import LogFactory
@@ -313,12 +314,30 @@ class AgentGitHandler:
             AgentGitHandler.log.exception(
                 "Could not remove repository folder for tenant:%s  %s" % (git_repo.tenant_id, e))
 
+        # restore default artifacts
+        AgentGitHandler.restore_default_artifacts("/tmp/default_artifacts", git_repo.local_repo_path)
+
         AgentGitHandler.clear_repo(tenant_id)
         AgentGitHandler.log.info("Git repository deleted for tenant %s" % git_repo.tenant_id)
 
         return True
 
     @staticmethod
+    def restore_default_artifacts (default_artifact_backup_location, local_repo_path):
+        try:
+            if os.path.isdir(default_artifact_backup_location):
+                # first remove all the artifacts in the local_repo_path
+                if os.listdir(local_repo_path):
+                    # non-empty
+                    filelist = [f for f in os.listdir(local_repo_path)]
+                    for f in filelist:
+                        GitUtils.delete_folder_tree(local_repo_path + '/' + f)
+            AgentGitHandler.log.info('Restoring default artifacts from ' + default_artifact_backup_location + ' to ' + local_repo_path)
+            shutil.copytree(default_artifact_backup_location, local_repo_path)
+        except OSError as e:
+            AgentGitHandler.log.error('Contents of ' + default_artifact_backup_location + ' not restored. Error: %s' % e)
+
+    @staticmethod
     def execute_git_command(command, repo_path):
         """
         Executes the given command string with given environment parameters

http://git-wip-us.apache.org/repos/asf/stratos/blob/2951b419/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
index c25d0e8..1bef17b 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
@@ -21,6 +21,9 @@ from modules.artifactmgt.git.agentgithandler import AgentGitHandler
 from config import Config
 import constants
 from exception import *
+import shutil
+import errno
+import os
 
 
 class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
@@ -90,6 +93,10 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
                           git_repo.repo_url, git_repo.local_repo_path)
             self.log.info("Executing git clone: [tenant-id] %s [repo-url] %s, [repo path] %s",
                           git_repo.tenant_id, git_repo.repo_url, git_repo.local_repo_path)
+
+            # copy default artifacts (if any) to a /tmp/default_artifacts
+            self.backupDefaultArtifacts(git_repo.local_repo_path, "/tmp/default_artifacts")
+
             try:
                 git_repo = AgentGitHandler.clone(git_repo)
                 AgentGitHandler.add_repo(git_repo)
@@ -101,3 +108,18 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
                 self.log.info("Retrying git clone operation...")
                 AgentGitHandler.retry_clone(git_repo)
                 AgentGitHandler.add_repo(git_repo)
+
+    def backupDefaultArtifacts(src, dest):
+        try:
+            if not os.path.isdir(src):
+                self.log.info ('Direcotry ' + src + ' does not exist')
+                return
+            if os.path.isdir(dest):
+                self.log.info('Directory ' + dest + ' already exists, will delete')
+                shutil.rmtree(dest)
+            self.log.info('Copying default artifacts from ' + src + ' to ' + dest)
+            shutil.copytree(src, dest)
+        except OSError as e:
+            self.log.error('Directory not copied. Error: %s' % e)
+
+


[20/21] stratos git commit: fixing conflict with stratos-4.1.x

Posted by is...@apache.org.
fixing conflict with stratos-4.1.x


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/44562bae
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/44562bae
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/44562bae

Branch: refs/heads/stratos-4.1.x
Commit: 44562bae23e58d69c2fafbe76cea35cd2b75c405
Parents: cbde779 bb22134
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Wed Dec 9 21:56:29 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 21:56:29 2015 +0530

----------------------------------------------------------------------

----------------------------------------------------------------------



[17/21] stratos git commit: Updating and formatting cep and das README files

Posted by is...@apache.org.
Updating and formatting cep and das README files


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/6ae01857
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/6ae01857
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/6ae01857

Branch: refs/heads/stratos-4.1.x
Commit: 6ae01857c94d82173178d20e62995d90e202cef8
Parents: f554d30
Author: Thanuja <th...@wso2.com>
Authored: Sun Dec 6 15:05:17 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:33 2015 +0530

----------------------------------------------------------------------
 extensions/cep/modules/distribution/README.md   | 34 +++++++++++++--
 .../artifacts/metering-dashboard/README.md      | 36 +++++++++++-----
 .../metering-dashboard/ues-patch/README.md      |  5 ++-
 .../artifacts/monitoring-dashboard/README.md    | 33 +++++++++-----
 extensions/das/modules/distribution/README.md   | 45 +++++++++++++++++++-
 .../das/modules/stratos-das-extension/README.md | 10 +++--
 6 files changed, 132 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/6ae01857/extensions/cep/modules/distribution/README.md
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/README.md b/extensions/cep/modules/distribution/README.md
index ebf6bf2..03358a4 100755
--- a/extensions/cep/modules/distribution/README.md
+++ b/extensions/cep/modules/distribution/README.md
@@ -1,8 +1,36 @@
 # Apache Stratos CEP Extensions
 
-Apache Stratos Complex Event Processor (CEP) extensions include Window Processors for processing 
-health statistic events. These extensions are available in Stratos binary distribution, in a 
-distributed deployment where CEP is run externally, these extensions need to be deployed manually.
+Apache Stratos Complex Event Processor (CEP) extensions include Window Processors for processing health statistic
+events. These extensions are available in Stratos binary distribution, in a distributed deployment where CEP is run
+externally, these extensions need to be deployed manually.
+
+You can setup stratos with either WSO2 CEP 3.0.0 or WSO2 CEP 3.1.0. Please note that only WSO2 CEP 3.1.0 supports
+highly available clustered deployment.
+
+1. Copy jar files in apache-stratos-cep-extension-4.1.5/lib folder to <CEP_HOME>/repository/components/lib. These jar
+files are common to both WSO2 CEP 3.0.0 and WSO2 CEP 3.1.0
+
+2. Copy files in apache-stratos-cep-extension-4.1.5/wso2cep-<version>/eventbuilders to
+<CEP_HOME>/repository/deployment/server/eventbuilders
+
+3. Copy files in apache-stratos-cep-extension-4.1.5/wso2cep-<version>/eventformatters to
+<CEP_HOME>/repository/deployment/server/eventformatters
+
+4. Copy files in apache-stratos-cep-extension-4.1.5/wso2cep-<version>/executionplans to
+<CEP_HOME>/repository/deployment/server/executionplans
+
+5. Copy files in apache-stratos-cep-extension-4.1.5/wso2cep-<version>/inputeventadaptors to
+<CEP_HOME>/repository/deployment/server/inputeventadaptors
+
+6. Copy files in apache-stratos-cep-extension-4.1.5/wso2cep-<version>/outputeventadaptors to
+<CEP_HOME>/repository/deployment/server/outputeventadaptors
+
+7. Copy files in apache-stratos-cep-extension-4.1.5/wso2cep-<version>/streamdefinitions to
+<CEP_HOME>/repository/deployment/server/streamdefinitions
+
+8. Update message broker endpoint in <CEP_HOME>/repository/deployment/server/outputeventadaptors/JMSOutputAdaptor.xml
+
+9. Copy files in apache-stratos-cep-extension-4.1.5/wso2cep-<version>/lib to <CEP_HOME>/repository/components/lib
 
 Please refer below link for more information on WSO2 CEP.
 http://wso2.com/products/complex-event-processor/

http://git-wip-us.apache.org/repos/asf/stratos/blob/6ae01857/extensions/das/modules/artifacts/metering-dashboard/README.md
----------------------------------------------------------------------
diff --git a/extensions/das/modules/artifacts/metering-dashboard/README.md b/extensions/das/modules/artifacts/metering-dashboard/README.md
index 21ea33f..c0df3d5 100644
--- a/extensions/das/modules/artifacts/metering-dashboard/README.md
+++ b/extensions/das/modules/artifacts/metering-dashboard/README.md
@@ -1,13 +1,27 @@
 # Apache Stratos Metering Dashboard
 
-This directory contains following artifacts: <br/>
-(1) capps - Includes stratos-metering-service car file which bundles all Event Stream, Event receiver, Even Store, Gadgets, SparkScripts and Dashboard artifacts. <br/>
-(2) jaggery-files <br/>
-(3) ues-patch <br/>
-
-Follow the below steps to generate the metering dashboard: <br/>
-1. Follow instruction given in <Stratos-SOURCE-HOME>/extensions/das/stratos-das-extension/README.md file to add stratos-das-extension jar to DAS. <br/>
-2. Add jaggery files which can be found in <Stratos-DAS-Distribution>/metering-dashboard/jaggery-files/ to DAS server path <DAS_HOME/repository/deployment/server/jaggeryapps/portal/controllers/apis/ <br/>
-3. Create MySQL database and tables using queries in <Stratos-DAS-Distribution>/metering-dashboard/metering-mysqlscript.sql manually. <br/>
-4. Apply ues-patch files in <Stratos-DAS-Distribution>/metering-dashboard/ues-patch/ to DAS as mentioned in its README file. <br/>
-5. Add stratos-metering-service car file in <Stratos-DAS-Distribution>/metering-dashboard/ to <DAS-HOME>/repository/deployment/server/carbonapps/ to generate the metering dashboard. <br/>
\ No newline at end of file
+## This directory contains following artifacts:
+
+(1) capps - Includes stratos-metering-service car file which bundles all Event Stream, Event receiver, Even Store,
+            Gadgets, SparkScripts and Dashboard artifacts.
+
+(2) jaggery-files
+
+(3) ues-patch
+
+## Follow the below steps to generate the metering dashboard:
+
+1. Follow instruction given in <Stratos-SOURCE-HOME>/extensions/das/stratos-das-extension/README.md file to add
+stratos-das-extension jar to DAS.
+
+2. Add jaggery files which can be found in <Stratos-DAS-Distribution>/metering-dashboard/jaggery-files/ to DAS server
+ path <DAS_HOME/repository/deployment/server/jaggeryapps/portal/controllers/apis/
+
+3. Create MySQL database and tables using queries in
+<Stratos-DAS-Distribution>/metering-dashboard/metering-mysqlscript.sql manually.
+
+4. Apply ues-patch files in <Stratos-DAS-Distribution>/metering-dashboard/ues-patch/ to DAS as mentioned in its
+README file.
+
+5. Add stratos-metering-service car file in <Stratos-DAS-Distribution>/metering-dashboard/ to
+<DAS-HOME>/repository/deployment/server/carbonapps/ to generate the metering dashboard.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/6ae01857/extensions/das/modules/artifacts/metering-dashboard/ues-patch/README.md
----------------------------------------------------------------------
diff --git a/extensions/das/modules/artifacts/metering-dashboard/ues-patch/README.md b/extensions/das/modules/artifacts/metering-dashboard/ues-patch/README.md
index 2bafefa..0d85e02 100644
--- a/extensions/das/modules/artifacts/metering-dashboard/ues-patch/README.md
+++ b/extensions/das/modules/artifacts/metering-dashboard/ues-patch/README.md
@@ -2,7 +2,10 @@ This folder (ues-patch) contains fix for DAS-3.0.0 analytics dashboard to  suppo
 dashboard url and publish the values to gadgets.
 
 You can find the related UES product jira here: https://wso2.org/jira/browse/UES-582
+
 Please follow below steps to apply the patch locally:
 
-1. Copy 'ues-gadgets.js' and 'ues-pubsub.js' files to <DAS-HOME>/repository/deployment/server/jaggeryapps/portal/js/ folder.
+1. Copy 'ues-gadgets.js' and 'ues-pubsub.js' files to <DAS-HOME>/repository/deployment/server/jaggeryapps/portal/js/ 
+folder.
+
 2. Copy 'dashboard.jag' file to <DAS-HOME>/repository/deployment/server/jaggeryapps/portal/theme/templates/ folder.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/6ae01857/extensions/das/modules/artifacts/monitoring-dashboard/README.md
----------------------------------------------------------------------
diff --git a/extensions/das/modules/artifacts/monitoring-dashboard/README.md b/extensions/das/modules/artifacts/monitoring-dashboard/README.md
index d80ff14..968b8cc 100644
--- a/extensions/das/modules/artifacts/monitoring-dashboard/README.md
+++ b/extensions/das/modules/artifacts/monitoring-dashboard/README.md
@@ -1,12 +1,25 @@
 # Apache Stratos Monitoring Dashboard
 
-This directory contains following artifacts: <br />
-(1) capps - Includes stratos-monitoring-service car file which bundles all Event Stream, Event receiver, Even Store, Gadgets, SparkScripts and Dashboard artifacts. <br />
-(2) jaggery-files <br />
-
-Follow the below steps to generate the monitoring dashboard: <br />
-1. Add jaggery files which can be found in <Stratos-DAS-Distribution>/monitoring-dashboard/jaggery-files/ to DAS path '<DAS_HOME/repository/deployment/server/jaggeryapps/portal/controllers/apis/' <br/>
-2. Create MySQL database and tables using queries in <Stratos-DAS-Distribution>/monitoring-dashboard/monitoring-mysqlscript.sql manually. <br />
-3. Copy CEP  EventFormatter artifacts in <Stratos-DAS-Distribution>/wso2cep-<version>/eventformatters/ to <CEP-HOME>/repository/deployment/server/eventformatters/. <br />
-4. Copy CEP OutputEventAdapter artifact in <Stratos-DAS-Distribution>/wso2cep-<version>/outputeventadaptors/ to <CEP-HOME>/repository/deployment/server/outputeventadaptors  and update the tcp and ssl ports according to DAS server port offset. <br />
-5. Add stratos-monitoring-service car file in <Stratos-DAS-Distribution>/monitoring-dashboard/ to <DAS-HOME>/repository/deployment/server/carbonapps/ to generate the monitoring dashboard. <br />
\ No newline at end of file
+## This directory contains following artifacts:
+(1) capps - Includes stratos-monitoring-service car file which bundles all Event Stream, Event receiver, Even Store,
+Gadgets, SparkScripts and Dashboard artifacts.
+
+(2) jaggery-files
+
+## Follow the below steps to generate the monitoring dashboard:
+
+1. Add jaggery files which can be found in <Stratos-DAS-Distribution>/monitoring-dashboard/jaggery-files/ to DAS path
+ <DAS_HOME/repository/deployment/server/jaggeryapps/portal/controllers/apis/.
+
+2. Create MySQL database and tables using queries in
+<Stratos-DAS-Distribution>/monitoring-dashboard/monitoring-mysqlscript.sql manually.
+
+3. Copy CEP  EventFormatter artifacts in <Stratos-DAS-Distribution>/wso2cep-<version>/eventformatters/ to
+<CEP-HOME>/repository/deployment/server/eventformatters/.
+
+4. Copy CEP OutputEventAdapter artifact in <Stratos-DAS-Distribution>/wso2cep-<version>/outputeventadaptors/ to
+<CEP-HOME>/repository/deployment/server/outputeventadaptors  and update the tcp and ssl ports according to DAS server
+ port offset.
+
+5. Add stratos-monitoring-service car file in <Stratos-DAS-Distribution>/monitoring-dashboard/ to
+<DAS-HOME>/repository/deployment/server/carbonapps/ to generate the monitoring dashboard.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/6ae01857/extensions/das/modules/distribution/README.md
----------------------------------------------------------------------
diff --git a/extensions/das/modules/distribution/README.md b/extensions/das/modules/distribution/README.md
index 1354716..0ae46c9 100644
--- a/extensions/das/modules/distribution/README.md
+++ b/extensions/das/modules/distribution/README.md
@@ -1,7 +1,48 @@
 # Apache Stratos DAS Extensions
 
-Apache Stratos Data Analytics Server (DAS) extensions include DAS artifacts and spark udf to run spark script.
-These extensions need to be deployed manually when running DAS externally.
+Apache Stratos Data Analytics Server (DAS) extensions include DAS artifacts and stratos-das-extension jar which has
+spark UDF (User Defined Funtion) used in spark script. You can configure an external DAS for stratos metering and
+monitoring feature as below:
+
+## Follow the below steps to configure DAS for metering dashboard:
+
+1. Add org.apache.stratos.das.extension-<stratos-version>.jar file to <DAS-HOME>/repository/components/lib/.
+
+2. Add UDF class '<class-name>org.apache.stratos.das.extension.TimeUDF</class-name>' to 'spark-udf-config.xml' file 
+in <DAS-HOME>/repository/conf/analytics/spark/' folder.
+
+3. Add jaggery files which can be found in <Stratos-DAS-Distribution>/metering-dashboard/jaggery-files/ to DAS server
+ path <DAS_HOME/repository/deployment/server/jaggeryapps/portal/controllers/apis/.
+
+4. Create MySQL database and tables using queries in
+<Stratos-DAS-Distribution>/metering-dashboard/metering-mysqlscript.sql manually.
+
+5. Apply ues-patch files in <Stratos-DAS-Distribution>/metering-dashboard/ues-patch/ to DAS below:
+    -   Copy 'ues-gadgets.js' and 'ues-pubsub.js' files to
+    <DAS-HOME>/repository/deployment/server/jaggeryapps/portal/js/ folder.
+    - Copy 'dashboard.jag' file to <DAS-HOME>/repository/deployment/server/jaggeryapps/portal/theme/templates/ folder.
+
+6. Add stratos-metering-service car file in <Stratos-DAS-Distribution>/metering-dashboard/ to
+<DAS-HOME>/repository/deployment/server/carbonapps/ to generate the metering dashboard.
+
+## Follow the below steps to configure DAS for monitoring dashboard:
+
+1. Add jaggery files which can be found in <Stratos-DAS-Distribution>/monitoring-dashboard/jaggery-files/ to DAS path
+'<DAS_HOME/repository/deployment/server/jaggeryapps/portal/controllers/apis/'.
+
+2. Create MySQL database and tables using queries in
+<Stratos-DAS-Distribution>/monitoring-dashboard/monitoring-mysqlscript.sql manually.
+
+3. Copy CEP  EventFormatter artifacts in <Stratos-DAS-Distribution>/wso2cep-<version>/eventformatters/ to
+<CEP-HOME>/repository/deployment/server/eventformatters/.
+
+4. Copy CEP OutputEventAdapter artifact in <Stratos-DAS-Distribution>/wso2cep-<version>/outputeventadaptors/ to
+<CEP-HOME>/repository/deployment/server/outputeventadaptors  and update the tcp and ssl ports according to DAS server
+port offset.
+
+5. Add stratos-monitoring-service car file in <Stratos-DAS-Distribution>/monitoring-dashboard/ to
+<DAS-HOME>/repository/deployment/server/carbonapps/ to generate the monitoring dashboard.
+
 
 Please refer below link for more information on WSO2 DAS.
 https://docs.wso2.com/display/DAS300/WSO2+Data+Analytics+Server+Documentation

http://git-wip-us.apache.org/repos/asf/stratos/blob/6ae01857/extensions/das/modules/stratos-das-extension/README.md
----------------------------------------------------------------------
diff --git a/extensions/das/modules/stratos-das-extension/README.md b/extensions/das/modules/stratos-das-extension/README.md
index 58bdd5b..59fe665 100644
--- a/extensions/das/modules/stratos-das-extension/README.md
+++ b/extensions/das/modules/stratos-das-extension/README.md
@@ -1,6 +1,8 @@
 # Apache Stratos DAS Extension
 
-This directory contains DAS Extensions needed for Stratos. <br />
-1. Add org.apache.stratos.das.extension-<stratos-version>.jar file to '<DAS-HOME>/repository/components/lib/'. <br />
-2. Add below UDF class path to 'spark-udf-config.xml' file in '<DAS-HOME>/repository/conf/analytics/spark/' folder. <br />
-   <class-name>org.apache.stratos.das.extension.TimeUDF</class-name> <br />
\ No newline at end of file
+This directory contains DAS Extensions needed for Stratos.
+
+1. Add org.apache.stratos.das.extension-<stratos-version>.jar file to <DAS-HOME>/repository/components/lib/.
+
+2. Add UDF class '<class-name>org.apache.stratos.das.extension.TimeUDF</class-name>' to 'spark-udf-config.xml'
+file in <DAS-HOME>/repository/conf/analytics/spark/ folder.
\ No newline at end of file


[06/21] stratos git commit: configuration for enabling initial artifact backup

Posted by is...@apache.org.
configuration for enabling initial artifact backup


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/762ffd7d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/762ffd7d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/762ffd7d

Branch: refs/heads/stratos-4.1.x
Commit: 762ffd7d765522f6659c603389a95dbb75fe0e6f
Parents: 7fc829e
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Wed Dec 9 18:11:13 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:11:13 2015 +0530

----------------------------------------------------------------------
 .../src/main/python/cartridge.agent/cartridge.agent/agent.conf    | 1 +
 .../src/main/python/cartridge.agent/cartridge.agent/config.py     | 3 +++
 .../src/main/python/cartridge.agent/cartridge.agent/constants.py  | 1 +
 .../cartridge.agent/plugins/DefaultArtifactCheckout.py            | 3 ++-
 4 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/762ffd7d/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
index a8c8a19..6875d25 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
@@ -45,3 +45,4 @@ APPLICATION_PATH                      =APPLICATION-PATH
 metadata.service.url                  =METADATA-SERVICE-URL
 super.tenant.repository.path          =/repository/deployment/server/
 tenant.repository.path                =/repository/tenants/
+enable.initial.artifact.backup        =ENABLE_INITIAL_ARTIFACT_UPDATE

http://git-wip-us.apache.org/repos/asf/stratos/blob/762ffd7d/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
index f1a70ec..baea8e8 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
@@ -112,6 +112,8 @@ class Config:
     """ :type : str  """
     super_tenant_repository_path = None
     """ :type : str  """
+    backup_initial_artifacts = False
+    """ :type : bool  """
     deployment = None
     """ :type : str  """
     manager_service_name = None
@@ -346,6 +348,7 @@ class Config:
             Config.lb_public_ip = Config.read_property(constants.LB_PUBLIC_IP, False)
             Config.tenant_repository_path = Config.read_property(constants.TENANT_REPO_PATH, False)
             Config.super_tenant_repository_path = Config.read_property(constants.SUPER_TENANT_REPO_PATH, False)
+            Config.backup_initial_artifacts = Config.read_property(constants.ENABLE_INITIAL_ARTIFACT_BACKUP, False)
 
             Config.is_primary = Config.read_property(constants.CLUSTERING_PRIMARY_KEY, False)
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/762ffd7d/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
index 4672579..93879d1 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
@@ -77,6 +77,7 @@ SUPERTENANT_TEMP_PATH = "/tmp/-1234/"
 
 SUPER_TENANT_REPO_PATH = "super.tenant.repository.path"
 TENANT_REPO_PATH = "tenant.repository.path"
+ENABLE_INITIAL_ARTIFACT_BACKUP = "enable.initial.artifact.backup"
 
 # topic names to subscribe
 INSTANCE_NOTIFIER_TOPIC = "instance/#"

http://git-wip-us.apache.org/repos/asf/stratos/blob/762ffd7d/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
index 1b7baa0..a2cd5c6 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
@@ -95,7 +95,8 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
             self.log.info("Executing git clone: [tenant-id] %s [repo-url] %s, [repo path] %s",
                           git_repo.tenant_id, git_repo.repo_url, git_repo.local_repo_path)
 
-            self.check_and_backup_initial_artifacts(git_repo.local_repo_path)
+            if not Config.backup_initial_artifacts is None and Config.backup_initial_artifacts:
+                self.check_and_backup_initial_artifacts(git_repo.local_repo_path)
 
             try:
                 git_repo = AgentGitHandler.clone(git_repo)


[04/21] stratos git commit: fixing http://stackoverflow.com/questions/9160227/dir-util-copy-tree-fails-after-shutil-rmtree, improving ScheduledExecutor and using str(tenant_id) in getting cached git repo objects

Posted by is...@apache.org.
fixing http://stackoverflow.com/questions/9160227/dir-util-copy-tree-fails-after-shutil-rmtree, improving ScheduledExecutor and using str(tenant_id) in getting cached git repo objects


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/11a35ed1
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/11a35ed1
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/11a35ed1

Branch: refs/heads/stratos-4.1.x
Commit: 11a35ed1d388a577b997cf30a3c5df745e717206
Parents: bfb50f4
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Tue Dec 1 16:26:41 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Tue Dec 1 16:26:41 2015 +0530

----------------------------------------------------------------------
 .../modules/artifactmgt/git/agentgithandler.py    | 12 ++++++++++++
 .../modules/util/asyncscheduledtask.py            |  5 +++--
 .../modules/util/cartridgeagentutils.py           |  9 ++++++++-
 .../plugins/DefaultArtifactCheckout.py            | 18 +++++++++++-------
 4 files changed, 34 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/11a35ed1/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
index 9b8658e..224ca31 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
@@ -21,6 +21,7 @@ import tempfile
 import urllib
 import os
 from distutils.dir_util import copy_tree
+import distutils.dir_util
 from threading import current_thread
 
 import constants
@@ -155,6 +156,9 @@ class AgentGitHandler:
                 "Cloning artifacts from URL: %s to temp location: %s" % (git_repo.repo_url, temp_repo_path))
             Repo.clone_from(git_repo.auth_url, temp_repo_path)
 
+            # clear the paths to get rid of the following bug in distutils:
+            # http://stackoverflow.com/questions/9160227/dir-util-copy-tree-fails-after-shutil-rmtree
+            distutils.dir_util._path_created = {}
             # move the cloned dir to application path
             copy_tree(temp_repo_path, git_repo.local_repo_path)
             AgentGitHandler.log.info("Git clone operation for tenant %s successful" % git_repo.tenant_id)
@@ -209,8 +213,16 @@ class AgentGitHandler:
 
     @staticmethod
     def clear_repo(tenant_id):
+        tenant_id = str(tenant_id)
+        AgentGitHandler.log.info ('########################## in clear_repo method...' + tenant_id)
         if tenant_id in AgentGitHandler.__git_repositories:
             del AgentGitHandler.__git_repositories[tenant_id]
+            AgentGitHandler.log.info('########################## cached repo object deleted for tenant ' +
+                  tenant_id)
+        if tenant_id in AgentGitHandler.__git_repositories:
+            AgentGitHandler.log.info('########################## cached repo object still exists for tenant ' + tenant_id)
+        else:
+            AgentGitHandler.log.info('########################## no cached obj found for ' + tenant_id)
 
     @staticmethod
     def create_git_repo(repo_info):

http://git-wip-us.apache.org/repos/asf/stratos/blob/11a35ed1/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py
index f727414..5b54598 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py
@@ -61,8 +61,9 @@ class ScheduledExecutor(Thread):
         """
         while not self.terminated:
             time.sleep(self.delay)
-            task_thread = Thread(target=self.task.execute_task)
-            task_thread.start()
+            if not self.terminated:
+                task_thread = Thread(target=self.task.execute_task)
+                task_thread.start()
 
     def terminate(self):
         """

http://git-wip-us.apache.org/repos/asf/stratos/blob/11a35ed1/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
index c212a82..016692d 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
@@ -122,8 +122,8 @@ def check_ports_active(ip_address, ports):
 
     return True
 
-class Utils (object):
 
+class Utils(object):
     @staticmethod
     def directory_exists(dir):
         """
@@ -176,6 +176,13 @@ class Utils (object):
         except OSError as e:
             log.error('Directory not moved. Error: %s' % e)
 
+    @staticmethod
+    def print_dictionary(dic):
+        for x in dic:
+            print (x)
+            for y in dic[x]:
+                print (y, ':', dic[x][y])
+
 class IncrementalCeilingListIterator(object):
     """
     Iterates through a given list and returns elements. At the end of the list if terminate_at_end is set to false,

http://git-wip-us.apache.org/repos/asf/stratos/blob/11a35ed1/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
index 0a45d91..413090e 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
@@ -83,6 +83,7 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
                 git_repo.cloned = False
                 self.log.debug("Executing git clone: [tenant-id] %s [repo-url] %s",
                                git_repo.tenant_id, git_repo.repo_url)
+
                 git_repo = AgentGitHandler.clone(git_repo)
                 AgentGitHandler.add_repo(git_repo)
                 self.log.debug("Git clone executed: [tenant-id] %s [repo-url] %s",
@@ -94,13 +95,7 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
             self.log.info("Executing git clone: [tenant-id] %s [repo-url] %s, [repo path] %s",
                           git_repo.tenant_id, git_repo.repo_url, git_repo.local_repo_path)
 
-            # copy default artifacts (if any) to a a temp location
-            # if directory name is dir, the backup directory name would be dir_backup
-            if self.initial_artifacts_exists(git_repo.local_repo_path):
-                self.log.info("Default artifacts exist at " + git_repo.local_repo_path)
-                self.backup_initial_artifacts(git_repo.local_repo_path)
-            else:
-                self.log.info("No default artifacts exist at " + git_repo.local_repo_path)
+            self.check_and_backup_initial_artifacts(git_repo.local_repo_path)
 
             try:
                 git_repo = AgentGitHandler.clone(git_repo)
@@ -114,6 +109,15 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
                 AgentGitHandler.retry_clone(git_repo)
                 AgentGitHandler.add_repo(git_repo)
 
+    def check_and_backup_initial_artifacts(self, initial_artifact_dir):
+        # copy default artifacts (if any) to a a temp location
+        # if directory name is dir, the backup directory name would be dir_backup
+        if self.initial_artifacts_exists(initial_artifact_dir):
+            self.log.info("Default artifacts exist at " + initial_artifact_dir)
+            self.backup_initial_artifacts(initial_artifact_dir)
+        else:
+            self.log.info("No default artifacts exist at " + initial_artifact_dir)
+
     def initial_artifacts_exists(self, dir):
         try:
             return os.path.exists(dir) and os.listdir(dir)


[14/21] stratos git commit: Revert "Update the AS registry manager"

Posted by is...@apache.org.
Revert "Update the AS registry manager"

This reverts commit e64081f7944dadced190054eb44f8d1dafe0f892.


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f36e9d33
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f36e9d33
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f36e9d33

Branch: refs/heads/stratos-4.1.x
Commit: f36e9d3319b1b3d903d84b3cd206c99919e6cff5
Parents: 73fbeb6
Author: gayangunarathne <ga...@wso2.com>
Authored: Sun Dec 6 13:21:47 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:33 2015 +0530

----------------------------------------------------------------------
 .../apache/stratos/autoscaler/registry/RegistryManager.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f36e9d33/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java
index 343b76a..925c4ff 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java
@@ -85,7 +85,7 @@ public class RegistryManager {
         return instance;
     }
 
-    private synchronized Object retrieve(String resourcePath) {
+    private Object retrieve(String resourcePath) {
         try {
             Resource resource = registryService.get(resourcePath);
             return resource.getContent();
@@ -99,7 +99,7 @@ public class RegistryManager {
         }
     }
 
-    private synchronized void delete(String resourcePath) {
+    private void delete(String resourcePath) {
         try {
             registryService.beginTransaction();
             registryService.delete(resourcePath);
@@ -138,7 +138,7 @@ public class RegistryManager {
      * @param dataObj      object to be persisted.
      * @param resourcePath resource path to be persisted.
      */
-    private synchronized void persist(Object dataObj, String resourcePath) throws AutoScalerException {
+    private void persist(Object dataObj, String resourcePath) throws AutoScalerException {
 
         try {
             registryService.beginTransaction();


[03/21] stratos git commit: Merge branch 'stratos-4.1.x' into singup_deletion_cleanup

Posted by is...@apache.org.
Merge branch 'stratos-4.1.x' into singup_deletion_cleanup


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/bfb50f4b
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/bfb50f4b
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/bfb50f4b

Branch: refs/heads/stratos-4.1.x
Commit: bfb50f4b3a8711091e633de0fb0877d3aa14530a
Parents: dbd2f07 64f05a5
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Tue Dec 1 11:08:38 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Tue Dec 1 11:08:38 2015 +0530

----------------------------------------------------------------------
 .../AutoscalerTopologyEventReceiver.java        |  277 ++--
 .../services/impl/AutoscalerServiceImpl.java    |   38 +-
 .../cluster/ClusterStatusActiveProcessor.java   |   22 +-
 .../group/GroupStatusActiveProcessor.java       |   84 +-
 .../processor/group/GroupStatusProcessor.java   |   10 +-
 .../group/GroupStatusTerminatedProcessor.java   |   42 +-
 .../CloudControllerServiceComponent.java        |    2 +-
 .../messaging/topology/TopologyBuilder.java     |   67 +-
 .../publisher/ThriftStatisticsPublisher.java    |   31 +-
 .../test/ThriftClientConfigParserTest.java      |   73 +-
 .../test/ThriftStatisticsPublisherTest.java     |   70 ++
 .../src/test/resources/thrift-client-config.xml |   53 +-
 .../domain/application/Application.java         |   11 +-
 .../processor/MessageProcessorChain.java        |    2 +
 .../ApplicationCreatedMessageProcessor.java     |   25 +-
 .../ApplicationDeletedMessageProcessor.java     |   12 +-
 ...cationInstanceActivatedMessageProcessor.java |   42 +-
 ...licationInstanceCreatedMessageProcessor.java |   25 +-
 ...tionInstanceInactivatedMessageProcessor.java |   40 +-
 ...ationInstanceTerminatedMessageProcessor.java |   25 +-
 ...tionInstanceTerminatingMessageProcessor.java |   41 +-
 .../ApplicationsMessageProcessorChain.java      |   38 +-
 .../ApplicationSignUpMessageProcessorChain.java |   13 +
 ...rStatusClusterActivatedMessageProcessor.java |   10 +-
 ...StatusClusterInactivateMessageProcessor.java |   10 +-
 ...sClusterInstanceCreatedMessageProcessor.java |   10 +-
 ...usterStatusClusterResetMessageProcessor.java |   10 +-
 ...StatusClusterTerminatedMessageProcessor.java |   10 +-
 ...tatusClusterTerminatingMessageProcessor.java |   10 +-
 .../ClusterStatusMessageProcessorChain.java     |   18 +
 .../DomainMappingMessageProcessorChain.java     |   11 +
 .../stat/HealthStatMessageProcessorChain.java   |   41 +-
 .../InitializerMessageProcessorChain.java       |   15 +
 .../InstanceNotifierMessageProcessorChain.java  |   12 +
 .../InstanceStatusMessageProcessorChain.java    |   14 +
 .../tenant/TenantMessageProcessorChain.java     |   14 +
 .../topology/TopologyMessageProcessorChain.java |   48 +
 .../ApplicationsEventMessageDelegator.java      |    4 +
 .../application/ApplicationsEventReceiver.java  |    4 +
 .../notifier/InstanceNotifierEventReceiver.java |   62 +-
 .../metadata/service/api/MetadataApi.java       |   18 +-
 .../metadata/service/registry/DataStore.java    |   21 +-
 .../service/registry/MetadataApiRegistry.java   |   37 +-
 .../iaas/internal/MockIaasServiceComponent.java |    6 -
 .../iaas/services/impl/MockIaasServiceImpl.java |   65 +-
 .../iaas/services/impl/MockIaasServiceUtil.java |   23 -
 .../mock/iaas/services/impl/MockInstance.java   |  187 ++-
 .../publisher/MockHealthStatisticsNotifier.java |   56 +-
 .../mock/iaas/test/MockIaasServiceTest.java     |  149 ++-
 .../src/test/resources/jndi.properties          |   22 +
 .../src/test/resources/thrift-client-config.xml |   50 +
 .../cartridge.agent/cartridge.agent/agent.py    |   62 +-
 .../cartridge.agent/healthstats.py              |   16 +-
 .../modules/artifactmgt/git/agentgithandler.py  |    7 +-
 .../modules/event/eventhandler.py               | 1180 +++++++++---------
 .../modules/util/cartridgeagentutils.py         |    4 +-
 .../plugins/DefaultArtifactCheckout.py          |    6 +-
 .../cartridge.agent/publisher.py                |   72 +-
 .../cartridge.agent/subscriber.py               |    8 +-
 .../rest/endpoint/api/StratosApiV41Utils.java   |    6 +-
 extensions/cep/modules/distribution/pom.xml     |   10 +
 .../modules/distribution/src/assembly/bin.xml   |    9 +
 .../stratos-cep-extension/wso2cep-3.1.0/pom.xml |    2 +-
 extensions/cep/pom.xml                          |    2 +-
 .../artifacts/metering-dashboard/capps/pom.xml  |   14 +-
 .../monitoring-dashboard/capps/pom.xml          |   12 -
 .../scaling_decision_1.0.0.json                 |    4 +-
 .../load-balancer/modules/aws-extension/pom.xml |    2 +-
 pom.xml                                         |   12 +-
 .../integration/tests/ADCExtensionTestCase.java |   32 +-
 .../tests/ADCMTAppTenantUserTestCase.java       |   47 +-
 .../integration/tests/ADCMTAppTestCase.java     |   46 +-
 .../agent/integration/tests/ADCTestCase.java    |   44 +-
 .../tests/ADCValidationTestCase.java            |  163 +++
 .../integration/tests/AgentStartupTestCase.java |   44 +-
 .../integration/tests/CEPHAModeTestCase.java    |   63 +-
 .../tests/MessageBrokerHATestCase.java          |   68 +-
 .../tests/PythonAgentIntegrationTest.java       |   82 +-
 .../resources/ADCValidationTestCase/agent.conf  |   46 +
 .../resources/ADCValidationTestCase/logging.ini |   52 +
 .../ADCValidationTestCase/payload/launch-params |    1 +
 .../MessageBrokerHATestCase/agent.conf          |    2 +-
 .../src/test/resources/log4j.properties         |    2 +-
 .../src/test/resources/test-suite-all.xml       |    1 +
 .../src/test/resources/test-suite-smoke.xml     |    2 +
 .../integration/common/RestConstants.java       |    1 +
 .../common/StratosTestServerManager.java        |  102 +-
 .../integration/common/TopologyHandler.java     |  511 +++++---
 .../integration/common/rest/RestClient.java     |   61 +-
 .../tests/StratosIntegrationTest.java           |    5 +-
 .../integration/tests/adc/GitHookTestCase.java  |  108 +-
 .../ApplicationBurstingTestCase.java            |  145 +--
 .../ApplicationStartupOrderTestCase.java        |  165 +--
 .../application/ApplicationUpdateTestCase.java  |  131 +-
 .../application/GroupStartupOrderTestCase.java  |  229 ++--
 .../GroupTerminationBehaviorTestCase.java       |  196 ++-
 .../application/MetadataServiceTestCase.java    |   32 +-
 ...PartitionOneAfterAnotherClusterTestCase.java |  148 ++-
 .../PartitionRoundRobinClusterTestCase.java     |  129 +-
 .../SampleApplicationStartupTestCase.java       |   46 +-
 .../application/SampleApplicationsTestCase.java |  401 +++---
 .../SingleClusterScalingTestCase.java           |  131 +-
 .../tests/cartridge/CartridgeGroupTestCase.java |  241 ++++
 .../tests/cartridge/CartridgeTestCase.java      |  183 +++
 .../tests/group/CartridgeGroupTestCase.java     |  251 ----
 .../tests/group/CartridgeTestCase.java          |  183 ---
 .../tests/iaas/IaaSProviderTestCase.java        |   28 +-
 .../iaas/IaasProviderAttributeTestCase.java     |   61 +-
 .../policies/ApplicationPolicyTestCase.java     |  111 +-
 .../policies/AutoscalingPolicyTestCase.java     |    5 +-
 .../policies/DeploymentPolicyTestCase.java      |    7 +-
 .../policies/NetworkPartitionTestCase.java      |    7 +-
 .../server/StratosServerRestartTestCase.java    |   90 +-
 .../integration/tests/users/TenantTestCase.java |    8 +-
 .../integration/tests/users/UserTestCase.java   |    5 +-
 .../src/test/resources/common/log4j.properties  |   14 +-
 .../src/test/resources/test-suite-all.xml       |    4 +-
 .../src/test/resources/test-suite-smoke.xml     |    2 +-
 118 files changed, 4338 insertions(+), 3506 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/bfb50f4b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/bfb50f4b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/bfb50f4b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
index 52648a1,27cf99c..0a45d91
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
@@@ -113,19 -101,3 +113,19 @@@ class DefaultArtifactCheckout(IArtifact
                  self.log.info("Retrying git clone operation...")
                  AgentGitHandler.retry_clone(git_repo)
                  AgentGitHandler.add_repo(git_repo)
 +
 +    def initial_artifacts_exists(self, dir):
 +        try:
 +            return os.path.exists(dir) and os.listdir(dir)
 +        except OSError as e:
 +            self.log.error('Unable to check if directory exists | non-empty, error: %s' % e)
 +            return False
 +
 +    def backup_initial_artifacts(self, src):
 +        self.log.info('Initial artifacts exists, taking backup to ' + Utils.strip_trailing_slash(src)
 +                      + constants.BACKUP_DIR_SUFFIX +
 +                      ' directory')
 +        try:
 +            shutil.copytree(src, Utils.strip_trailing_slash(src) + constants.BACKUP_DIR_SUFFIX)
 +        except OSError as e:
-             self.log.error('Directory not copied. Error: %s' % e)
++            self.log.error('Directory not copied. Error: %s' % e)


[11/21] stratos git commit: Remove init() call in setEnaled method in ThriftStatisticsPublisher since it is invoked from the constructor. Remove setEnabled(true) call in MockHealthStatisticsNotifier since it is read from thrift-client-config.xml

Posted by is...@apache.org.
Remove init() call in setEnaled method in ThriftStatisticsPublisher since it is invoked from the constructor. Remove setEnabled(true) call in MockHealthStatisticsNotifier since it is read from thrift-client-config.xml


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3c7eeb31
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3c7eeb31
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3c7eeb31

Branch: refs/heads/stratos-4.1.x
Commit: 3c7eeb317d4193947c614e4cb6482c82042cd288
Parents: de9ffd2
Author: Akila Perera <ra...@gmail.com>
Authored: Tue Dec 1 18:07:28 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:32 2015 +0530

----------------------------------------------------------------------
 .../publisher/ThriftStatisticsPublisher.java           | 13 +++++--------
 .../publisher/MockHealthStatisticsNotifier.java        |  2 --
 2 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3c7eeb31/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
index bf0db61..7af804b 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
@@ -88,8 +88,9 @@ public class ThriftStatisticsPublisher implements StatisticsPublisher {
 
         for (ThriftClientInfo thriftClientInfo : thriftClientInfoList) {
             if (thriftClientInfo.isStatsPublisherEnabled()) {
-                dataPublisherHolders.add(new DataPublisherHolder(null, buildUrl(thriftClientInfo), thriftClientInfo.getUsername(),
-                        thriftClientInfo.getPassword()));
+                dataPublisherHolders
+                        .add(new DataPublisherHolder(null, buildUrl(thriftClientInfo), thriftClientInfo.getUsername(),
+                                thriftClientInfo.getPassword()));
                 if (log.isDebugEnabled()) {
                     log.debug(String.format("Thrift client [id] %s [ip] %s [port] %s is added to data publisher holder",
                             thriftClientInfo.getId(), thriftClientInfo.getIp(), thriftClientInfo.getPort()));
@@ -112,9 +113,6 @@ public class ThriftStatisticsPublisher implements StatisticsPublisher {
     @Override
     public void setEnabled(boolean enabled) {
         this.enabled = enabled;
-        if (this.enabled) {
-            init();
-        }
     }
 
     @Override
@@ -134,8 +132,8 @@ public class ThriftStatisticsPublisher implements StatisticsPublisher {
 
         try {
             if (log.isDebugEnabled()) {
-                log.debug(String.format("Publishing thrift event: [stream] %s [version] %s",
-                        streamDefinition.getName(), streamDefinition.getVersion()));
+                log.debug(String.format("Publishing thrift event: [stream] %s [version] %s", streamDefinition.getName(),
+                        streamDefinition.getVersion()));
             }
             loadBalancingDataPublisher.publish(streamDefinition.getName(), streamDefinition.getVersion(), event);
             if (log.isDebugEnabled()) {
@@ -143,7 +141,6 @@ public class ThriftStatisticsPublisher implements StatisticsPublisher {
                         streamDefinition.getName(), streamDefinition.getVersion()));
             }
 
-
         } catch (AgentException e) {
             if (log.isErrorEnabled()) {
                 log.error(String.format("Could not publish thrift event: [stream] %s [version] %s",

http://git-wip-us.apache.org/repos/asf/stratos/blob/3c7eeb31/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/statistics/publisher/MockHealthStatisticsNotifier.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/statistics/publisher/MockHealthStatisticsNotifier.java b/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/statistics/publisher/MockHealthStatisticsNotifier.java
index 4f3de51..637e4bf 100644
--- a/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/statistics/publisher/MockHealthStatisticsNotifier.java
+++ b/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/statistics/publisher/MockHealthStatisticsNotifier.java
@@ -44,11 +44,9 @@ public class MockHealthStatisticsNotifier implements Runnable {
         this.mockMemberContext = mockMemberContext;
         this.healthStatisticsPublisher = HealthStatisticsPublisherFactory
                 .createHealthStatisticsPublisher(StatisticsPublisherType.WSO2CEP);
-        this.healthStatisticsPublisher.setEnabled(true);
 
         this.inFlightRequestPublisher = InFlightRequestPublisherFactory
                 .createInFlightRequestPublisher(StatisticsPublisherType.WSO2CEP);
-        this.inFlightRequestPublisher.setEnabled(true);
     }
 
     @Override


[02/21] stratos git commit: initial changes for restoring initial artifacts after signup removal

Posted by is...@apache.org.
initial changes for restoring initial artifacts after signup removal


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/dbd2f07f
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/dbd2f07f
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/dbd2f07f

Branch: refs/heads/stratos-4.1.x
Commit: dbd2f07f1a2395a5256e2439595242ff8d521abe
Parents: 2951b41
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Tue Dec 1 11:07:56 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Tue Dec 1 11:07:56 2015 +0530

----------------------------------------------------------------------
 .../cartridge.agent/constants.py                |  2 +
 .../modules/artifactmgt/git/agentgithandler.py  | 22 ++++----
 .../modules/util/cartridgeagentutils.py         | 55 ++++++++++++++++++++
 .../plugins/DefaultArtifactCheckout.py          | 34 +++++++-----
 4 files changed, 86 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/dbd2f07f/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
index cd2ce36..4672579 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py
@@ -140,3 +140,5 @@ MONITORING_RECEIVER_PORT = "monitoring.server.port"
 MONITORING_RECEIVER_SECURE_PORT = "monitoring.server.secure.port"
 MONITORING_SERVER_ADMIN_USERNAME = "monitoring.server.admin.username"
 MONITORING_SERVER_ADMIN_PASSWORD = "monitoring.server.admin.password"
+
+BACKUP_DIR_SUFFIX = "_backup"

http://git-wip-us.apache.org/repos/asf/stratos/blob/dbd2f07f/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
index 2cb4c38..7546619 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
@@ -28,10 +28,10 @@ import time
 from config import Config
 from exception import GitRepositorySynchronizationException
 from git import *
-import errno
 
 from ...util.asyncscheduledtask import AbstractAsyncScheduledTask, ScheduledExecutor
 from ...util.log import LogFactory
+from ...util.cartridgeagentutils import Utils
 
 
 class AgentGitHandler:
@@ -315,7 +315,9 @@ class AgentGitHandler:
                 "Could not remove repository folder for tenant:%s  %s" % (git_repo.tenant_id, e))
 
         # restore default artifacts
-        AgentGitHandler.restore_default_artifacts("/tmp/default_artifacts", git_repo.local_repo_path)
+        if Utils.directory_exists(Utils.strip_trailing_slash(git_repo.local_repo_path) +
+                                          constants.BACKUP_DIR_SUFFIX):
+            AgentGitHandler.restore_default_artifacts(git_repo.local_repo_path)
 
         AgentGitHandler.clear_repo(tenant_id)
         AgentGitHandler.log.info("Git repository deleted for tenant %s" % git_repo.tenant_id)
@@ -323,19 +325,13 @@ class AgentGitHandler:
         return True
 
     @staticmethod
-    def restore_default_artifacts (default_artifact_backup_location, local_repo_path):
+    def restore_default_artifacts(default_dir):
         try:
-            if os.path.isdir(default_artifact_backup_location):
-                # first remove all the artifacts in the local_repo_path
-                if os.listdir(local_repo_path):
-                    # non-empty
-                    filelist = [f for f in os.listdir(local_repo_path)]
-                    for f in filelist:
-                        GitUtils.delete_folder_tree(local_repo_path + '/' + f)
-            AgentGitHandler.log.info('Restoring default artifacts from ' + default_artifact_backup_location + ' to ' + local_repo_path)
-            shutil.copytree(default_artifact_backup_location, local_repo_path)
+            Utils.move_directory(Utils.strip_trailing_slash(default_dir) + constants.BACKUP_DIR_SUFFIX, default_dir)
+            AgentGitHandler.log.info('Restored contents from backup location ' +Utils.strip_trailing_slash(default_dir)
+                                     + constants.BACKUP_DIR_SUFFIX)
         except OSError as e:
-            AgentGitHandler.log.error('Contents of ' + default_artifact_backup_location + ' not restored. Error: %s' % e)
+            AgentGitHandler.log.error('Contents of ' + default_dir + ' not restored. Error: %s' % e)
 
     @staticmethod
     def execute_git_command(command, repo_path):

http://git-wip-us.apache.org/repos/asf/stratos/blob/dbd2f07f/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
index ebd6889..74c7e75 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
@@ -21,6 +21,8 @@ import time
 import socket
 import string
 import hashlib
+import shutil
+import os
 
 from log import LogFactory
 
@@ -120,6 +122,59 @@ def check_ports_active(ip_address, ports):
 
     return True
 
+class Utils (object):
+
+    @staticmethod
+    def directory_exists(dir):
+        """
+        Checks if the given directory exists
+        :param dir: directory to check
+        :return: True if the directory dir exists, else False
+        :rtype: bool
+        """
+        try:
+            return os.path.isdir(dir)
+        except OSError as e:
+            log.error("Unable to check directory existance [%s]" % e)
+            return False
+
+    @staticmethod
+    def copy_directory(src, destination):
+        """
+        Copies if the directory 'src' to 'destination'
+        :param src: location of directory to copy
+        :param destination: new directory location
+        """
+        try:
+            shutil.copytree(src, destination)
+            log.debug("Directory [%s] copied to [%s]" % (src, destination))
+        except OSError as e:
+            log.error('Directory not copied. Error: %s' % e)
+
+    @staticmethod
+    def strip_trailing_slash(string):
+        """
+        If the string has a trailing '/', removes it
+        :param string: string to check
+        :return: string without a trailing '/'
+        :rtype: string
+        """
+        if string.endswith('/'):
+            return string[:-1]
+        return string
+
+    @staticmethod
+    def move_directory(src, destination):
+        """
+        Moves if the directory 'src' to 'destination'
+        :param src: location of directory to move
+        :param destination: new directory location
+        """
+        try:
+            shutil.move(src, destination)
+            log.debug("Directory [%s] moved to [%s]" % (src, destination))
+        except OSError as e:
+            log.error('Directory not moved. Error: %s' % e)
 
 class IncrementalCeilingListIterator(object):
     """

http://git-wip-us.apache.org/repos/asf/stratos/blob/dbd2f07f/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
index 1bef17b..52648a1 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
@@ -17,12 +17,12 @@
 
 from plugins.contracts import IArtifactCheckoutPlugin
 from modules.util.log import LogFactory
+from modules.util.cartridgeagentutils import Utils
 from modules.artifactmgt.git.agentgithandler import AgentGitHandler
 from config import Config
 import constants
 from exception import *
 import shutil
-import errno
 import os
 
 
@@ -94,8 +94,13 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
             self.log.info("Executing git clone: [tenant-id] %s [repo-url] %s, [repo path] %s",
                           git_repo.tenant_id, git_repo.repo_url, git_repo.local_repo_path)
 
-            # copy default artifacts (if any) to a /tmp/default_artifacts
-            self.backupDefaultArtifacts(git_repo.local_repo_path, "/tmp/default_artifacts")
+            # copy default artifacts (if any) to a a temp location
+            # if directory name is dir, the backup directory name would be dir_backup
+            if self.initial_artifacts_exists(git_repo.local_repo_path):
+                self.log.info("Default artifacts exist at " + git_repo.local_repo_path)
+                self.backup_initial_artifacts(git_repo.local_repo_path)
+            else:
+                self.log.info("No default artifacts exist at " + git_repo.local_repo_path)
 
             try:
                 git_repo = AgentGitHandler.clone(git_repo)
@@ -109,17 +114,18 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
                 AgentGitHandler.retry_clone(git_repo)
                 AgentGitHandler.add_repo(git_repo)
 
-    def backupDefaultArtifacts(src, dest):
+    def initial_artifacts_exists(self, dir):
         try:
-            if not os.path.isdir(src):
-                self.log.info ('Direcotry ' + src + ' does not exist')
-                return
-            if os.path.isdir(dest):
-                self.log.info('Directory ' + dest + ' already exists, will delete')
-                shutil.rmtree(dest)
-            self.log.info('Copying default artifacts from ' + src + ' to ' + dest)
-            shutil.copytree(src, dest)
+            return os.path.exists(dir) and os.listdir(dir)
         except OSError as e:
-            self.log.error('Directory not copied. Error: %s' % e)
-
+            self.log.error('Unable to check if directory exists | non-empty, error: %s' % e)
+            return False
 
+    def backup_initial_artifacts(self, src):
+        self.log.info('Initial artifacts exists, taking backup to ' + Utils.strip_trailing_slash(src)
+                      + constants.BACKUP_DIR_SUFFIX +
+                      ' directory')
+        try:
+            shutil.copytree(src, Utils.strip_trailing_slash(src) + constants.BACKUP_DIR_SUFFIX)
+        except OSError as e:
+            self.log.error('Directory not copied. Error: %s' % e)
\ No newline at end of file


[07/21] stratos git commit: adding a log for default artifact backup = false

Posted by is...@apache.org.
adding a log for default artifact backup = false


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/af0c9a1a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/af0c9a1a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/af0c9a1a

Branch: refs/heads/stratos-4.1.x
Commit: af0c9a1ac21f4ad6a93102de2169ac002f861d23
Parents: 762ffd7
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Wed Dec 9 18:17:36 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:17:36 2015 +0530

----------------------------------------------------------------------
 .../cartridge.agent/plugins/DefaultArtifactCheckout.py             | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/af0c9a1a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
index a2cd5c6..f9883aa 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
@@ -97,6 +97,8 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
 
             if not Config.backup_initial_artifacts is None and Config.backup_initial_artifacts:
                 self.check_and_backup_initial_artifacts(git_repo.local_repo_path)
+            else:
+                self.log.info("Default artifact backup disabled")
 
             try:
                 git_repo = AgentGitHandler.clone(git_repo)


[15/21] stratos git commit: Move acquireWriteLock call in terminateInstance method to a separate try-finally block in-order to avoid releasing locks which are not taken

Posted by is...@apache.org.
Move acquireWriteLock call in terminateInstance method to a separate try-finally block in-order to avoid releasing locks which are not taken


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/cbde779f
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/cbde779f
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/cbde779f

Branch: refs/heads/stratos-4.1.x
Commit: cbde779f99690d72edddfc6360fafad445cbcb13
Parents: 6ae0185
Author: Akila Perera <ra...@gmail.com>
Authored: Mon Dec 7 16:04:38 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:33 2015 +0530

----------------------------------------------------------------------
 .../impl/CloudControllerServiceImpl.java        | 56 ++++++++++----------
 1 file changed, 29 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/cbde779f/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
index 6a1303a..d25ab52 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
@@ -645,41 +645,43 @@ public class CloudControllerServiceImpl implements CloudControllerService {
                 throw new InvalidMemberException(msg);
             }
 
-            // check if status == active, if true, then this is a termination on member faulty
-            TopologyHolder.acquireWriteLock();
-            Topology topology = TopologyHolder.getTopology();
-            org.apache.stratos.messaging.domain.topology.Service service = topology
-                    .getService(memberContext.getCartridgeType());
-
-            if (service != null) {
-                Cluster cluster = service.getCluster(memberContext.getClusterId());
-                if (cluster != null) {
-                    Member member = cluster.getMember(memberId);
-                    if (member != null) {
-
-                        // check if ready to shutdown member is expired and send
-                        // member terminated if it is.
-                        if (isMemberExpired(member, memberContext.getObsoleteInitTime(),
-                                memberContext.getObsoleteExpiryTime())) {
-                            if (log.isInfoEnabled()) {
-                                log.info(String.format(
-                                        "Member pending termination in ReadyToShutdown state exceeded expiry time. "
-                                                + "This member has to be manually deleted: %s",
-                                        memberContext.getMemberId()));
-                            }
+            try {
+                // check if status == active, if true, then this is a termination on member faulty
+                TopologyHolder.acquireWriteLock();
+                Topology topology = TopologyHolder.getTopology();
+                org.apache.stratos.messaging.domain.topology.Service service = topology
+                        .getService(memberContext.getCartridgeType());
+
+                if (service != null) {
+                    Cluster cluster = service.getCluster(memberContext.getClusterId());
+                    if (cluster != null) {
+                        Member member = cluster.getMember(memberId);
+                        if (member != null) {
+
+                            // check if ready to shutdown member is expired and send
+                            // member terminated if it is.
+                            if (isMemberExpired(member, memberContext.getObsoleteInitTime(),
+                                    memberContext.getObsoleteExpiryTime())) {
+                                if (log.isInfoEnabled()) {
+                                    log.info(String.format(
+                                            "Member pending termination in ReadyToShutdown state exceeded expiry time. "
+                                                    + "This member has to be manually deleted: %s",
+                                            memberContext.getMemberId()));
+                                }
 
-                            CloudControllerServiceUtil.executeMemberTerminationPostProcess(memberContext);
-                            return false;
+                                CloudControllerServiceUtil.executeMemberTerminationPostProcess(memberContext);
+                                return false;
+                            }
                         }
                     }
                 }
+                executorService.execute(new InstanceTerminator(memberContext));
+            } finally {
+                TopologyHolder.releaseWriteLock();
             }
-            executorService.execute(new InstanceTerminator(memberContext));
         } catch (Exception e) {
             String message = "Could not terminate instance: [member-id] " + memberId;
             throw new CloudControllerException(message, e);
-        } finally {
-            TopologyHolder.releaseWriteLock();
         }
         return true;
     }


[16/21] stratos git commit: Update the AS registry manager

Posted by is...@apache.org.
Update the AS registry manager


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/18d9714b
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/18d9714b
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/18d9714b

Branch: refs/heads/stratos-4.1.x
Commit: 18d9714bc4c43023d414f84cf569544f367d6ea6
Parents: d6c6502
Author: gayangunarathne <ga...@wso2.com>
Authored: Sun Dec 6 10:30:37 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:33 2015 +0530

----------------------------------------------------------------------
 .../apache/stratos/autoscaler/registry/RegistryManager.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/18d9714b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java
index 925c4ff..343b76a 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java
@@ -85,7 +85,7 @@ public class RegistryManager {
         return instance;
     }
 
-    private Object retrieve(String resourcePath) {
+    private synchronized Object retrieve(String resourcePath) {
         try {
             Resource resource = registryService.get(resourcePath);
             return resource.getContent();
@@ -99,7 +99,7 @@ public class RegistryManager {
         }
     }
 
-    private void delete(String resourcePath) {
+    private synchronized void delete(String resourcePath) {
         try {
             registryService.beginTransaction();
             registryService.delete(resourcePath);
@@ -138,7 +138,7 @@ public class RegistryManager {
      * @param dataObj      object to be persisted.
      * @param resourcePath resource path to be persisted.
      */
-    private void persist(Object dataObj, String resourcePath) throws AutoScalerException {
+    private synchronized void persist(Object dataObj, String resourcePath) throws AutoScalerException {
 
         try {
             registryService.beginTransaction();


[18/21] stratos git commit: Changing cep and das distibution name

Posted by is...@apache.org.
Changing cep and das distibution name


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f554d301
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f554d301
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f554d301

Branch: refs/heads/stratos-4.1.x
Commit: f554d301e246c92028b84aa69150a2c3483b9bc4
Parents: f36e9d3
Author: Thanuja <th...@wso2.com>
Authored: Sun Dec 6 14:14:09 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:33 2015 +0530

----------------------------------------------------------------------
 extensions/cep/modules/distribution/pom.xml | 6 +++---
 extensions/das/modules/distribution/pom.xml | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f554d301/extensions/cep/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/pom.xml b/extensions/cep/modules/distribution/pom.xml
index 5c4364e..b1266f9 100644
--- a/extensions/cep/modules/distribution/pom.xml
+++ b/extensions/cep/modules/distribution/pom.xml
@@ -27,10 +27,10 @@
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
-    <artifactId>apache-stratos-cep-artifacts</artifactId>
+    <artifactId>apache-stratos-cep-extension</artifactId>
     <packaging>pom</packaging>
-    <name>Apache Stratos - CEP Artifacts</name>
-    <description>Apache Stratos CEP artifacts</description>
+    <name>Apache Stratos - CEP Extension</name>
+    <description>Apache Stratos CEP Extension</description>
 
     <profiles>
         <profile>

http://git-wip-us.apache.org/repos/asf/stratos/blob/f554d301/extensions/das/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/das/modules/distribution/pom.xml b/extensions/das/modules/distribution/pom.xml
index cea5a28..43e6b8a 100644
--- a/extensions/das/modules/distribution/pom.xml
+++ b/extensions/das/modules/distribution/pom.xml
@@ -27,10 +27,10 @@
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
-    <artifactId>apache-stratos-das-artifacts</artifactId>
+    <artifactId>apache-stratos-das-extension</artifactId>
     <packaging>pom</packaging>
-    <name>Apache Stratos - DAS Artifacts</name>
-    <description>Apache Stratos DAS Artifacts</description>
+    <name>Apache Stratos - DAS Extension</name>
+    <description>Apache Stratos DAS Extension</description>
 
     <profiles>
         <profile>


[21/21] stratos git commit: changing logic of enabling initial artifact update

Posted by is...@apache.org.
changing logic of enabling initial artifact update


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/647cb07a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/647cb07a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/647cb07a

Branch: refs/heads/stratos-4.1.x
Commit: 647cb07a2c31453b25716a9c0c7de4972ab7a7a8
Parents: 44562ba
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Wed Dec 9 22:35:53 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 22:35:53 2015 +0530

----------------------------------------------------------------------
 .../src/main/python/cartridge.agent/cartridge.agent/agent.conf     | 2 +-
 .../cartridge.agent/plugins/DefaultArtifactCheckout.py             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/647cb07a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
index 6875d25..06e3a40 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.conf
@@ -45,4 +45,4 @@ APPLICATION_PATH                      =APPLICATION-PATH
 metadata.service.url                  =METADATA-SERVICE-URL
 super.tenant.repository.path          =/repository/deployment/server/
 tenant.repository.path                =/repository/tenants/
-enable.initial.artifact.backup        =ENABLE_INITIAL_ARTIFACT_UPDATE
+enable.initial.artifact.backup        =ENABLE_INITIAL_ARTIFACT_BACKUP

http://git-wip-us.apache.org/repos/asf/stratos/blob/647cb07a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
index f9883aa..1645030 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
@@ -95,7 +95,7 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
             self.log.info("Executing git clone: [tenant-id] %s [repo-url] %s, [repo path] %s",
                           git_repo.tenant_id, git_repo.repo_url, git_repo.local_repo_path)
 
-            if not Config.backup_initial_artifacts is None and Config.backup_initial_artifacts:
+            if Config.backup_initial_artifacts:
                 self.check_and_backup_initial_artifacts(git_repo.local_repo_path)
             else:
                 self.log.info("Default artifact backup disabled")


[09/21] stratos git commit: Adding MetadataServiceTestCase as a failed test

Posted by is...@apache.org.
Adding MetadataServiceTestCase as a failed test


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/338b2608
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/338b2608
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/338b2608

Branch: refs/heads/stratos-4.1.x
Commit: 338b2608af5bcb96b51411ff7ddc51154af31d4f
Parents: 3c7eeb3
Author: gayangunarathne <ga...@wso2.com>
Authored: Wed Dec 2 14:05:35 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:32 2015 +0530

----------------------------------------------------------------------
 .../integration/tests/application/MetadataServiceTestCase.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/338b2608/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/MetadataServiceTestCase.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/MetadataServiceTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/MetadataServiceTestCase.java
index 5ba3634..2f58695 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/MetadataServiceTestCase.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/MetadataServiceTestCase.java
@@ -49,7 +49,7 @@ import static org.testng.AssertJUnit.assertTrue;
  * Deploy a sample application on mock IaaS and load test metadata service with high load of concurrent read/write
  * operations from multiple clients
  */
-@Test(groups = { "application", "metadata" })
+@Test(groups = { "application", "metadata", "failed" })
 public class MetadataServiceTestCase extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(MetadataServiceTestCase.class);
     private static final String RESOURCES_PATH = "/metadata-service-test";


[10/21] stratos git commit: PCA - Validate agent.conf entries when loading Config, refactor handler methods for mb events, fix util methods, fix exception initialization

Posted by is...@apache.org.
PCA - Validate agent.conf entries when loading Config, refactor handler methods for mb events, fix util methods, fix exception initialization


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/de9ffd26
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/de9ffd26
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/de9ffd26

Branch: refs/heads/stratos-4.1.x
Commit: de9ffd26d8b78c1796ddf6ac0dea0a0bcecccc08
Parents: af0c9a1
Author: Chamila de Alwis <ch...@apache.org>
Authored: Tue Dec 1 17:35:25 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:32 2015 +0530

----------------------------------------------------------------------
 .../cartridge.agent/cartridge.agent/agent.py    | 144 +++++++++++--------
 .../cartridge.agent/cartridge.agent/config.py   |  83 ++++++++++-
 .../cartridge.agent/exception.py                |  46 +++---
 .../cartridge.agent/healthstats.py              |  34 +----
 .../cartridge.agent/logpublisher.py             |   2 +-
 .../modules/artifactmgt/git/agentgithandler.py  |   4 +-
 .../modules/event/application/signup/events.py  |   3 -
 .../modules/event/instance/notifier/events.py   |   2 +-
 .../modules/event/tenant/events.py              |   2 +-
 .../modules/util/cartridgeagentutils.py         |  73 ++++++----
 .../cartridge.agent/publisher.py                |   4 +-
 11 files changed, 249 insertions(+), 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.py
index 6b81dff..7f95f26 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/agent.py
@@ -30,12 +30,10 @@ from subscriber import EventSubscriber
 class CartridgeAgent(object):
     def __init__(self):
         Config.initialize_config()
-        self.__tenant_context_initialized = False
-        self.__log_publish_manager = None
         self.__terminated = False
         self.__log = LogFactory().get_log(__name__)
 
-        mb_urls = Config.mb_urls
+        mb_urls = Config.mb_urls.split(",")
         mb_uname = Config.mb_username
         mb_pwd = Config.mb_password
 
@@ -87,8 +85,8 @@ class CartridgeAgent(object):
         # Execute start servers extension
         try:
             event_handler.start_server_extension()
-        except Exception as e:
-            self.__log.exception("Error processing start servers event: %s" % e)
+        except Exception as ex:
+            self.__log.exception("Error processing start servers event: %s" % ex)
 
         # check if artifact management is required before publishing instance activated event
         repo_url = Config.repo_url
@@ -107,21 +105,22 @@ class CartridgeAgent(object):
             event_handler.volume_mount_extension(persistence_mapping_payload)
 
         # start log publishing thread
+        log_publish_manager = None
         if DataPublisherConfiguration.get_instance().enabled:
             log_file_paths = Config.log_file_paths
             if log_file_paths is None:
                 self.__log.exception("No valid log file paths found, no logs will be published")
             else:
                 self.__log.debug("Starting Log Publisher Manager: [Log file paths] %s" % ", ".join(log_file_paths))
-                self.__log_publish_manager = LogPublisherManager(log_file_paths)
-                self.__log_publish_manager.start()
+                log_publish_manager = LogPublisherManager(log_file_paths)
+                log_publish_manager.start()
 
         # run until terminated
         while not self.__terminated:
             time.sleep(5)
 
         if DataPublisherConfiguration.get_instance().enabled:
-            self.__log_publish_manager.terminate_all_publishers()
+            log_publish_manager.terminate_all_publishers()
 
     def terminate(self):
         """
@@ -134,9 +133,10 @@ class CartridgeAgent(object):
     def register_instance_topic_listeners(self):
         self.__log.debug("Starting instance notifier event message receiver thread")
 
-        self.__inst_topic_subscriber.register_handler("ArtifactUpdatedEvent", self.on_artifact_updated)
-        self.__inst_topic_subscriber.register_handler("InstanceCleanupMemberEvent", self.on_instance_cleanup_member)
-        self.__inst_topic_subscriber.register_handler("InstanceCleanupClusterEvent", self.on_instance_cleanup_cluster)
+        self.__inst_topic_subscriber.register_handler("ArtifactUpdatedEvent", Handlers.on_artifact_updated)
+        self.__inst_topic_subscriber.register_handler("InstanceCleanupMemberEvent", Handlers.on_instance_cleanup_member)
+        self.__inst_topic_subscriber.register_handler(
+            "InstanceCleanupClusterEvent", Handlers.on_instance_cleanup_cluster)
 
         self.__inst_topic_subscriber.start()
         self.__log.info("Instance notifier event message receiver thread started")
@@ -148,13 +148,13 @@ class CartridgeAgent(object):
     def register_topology_event_listeners(self):
         self.__log.debug("Starting topology event message receiver thread")
 
-        self.__topology_event_subscriber.register_handler("MemberActivatedEvent", self.on_member_activated)
-        self.__topology_event_subscriber.register_handler("MemberTerminatedEvent", self.on_member_terminated)
-        self.__topology_event_subscriber.register_handler("MemberSuspendedEvent", self.on_member_suspended)
-        self.__topology_event_subscriber.register_handler("CompleteTopologyEvent", self.on_complete_topology)
-        self.__topology_event_subscriber.register_handler("MemberStartedEvent", self.on_member_started)
-        self.__topology_event_subscriber.register_handler("MemberCreatedEvent", self.on_member_created)
-        self.__topology_event_subscriber.register_handler("MemberInitializedEvent", self.on_member_initialized)
+        self.__topology_event_subscriber.register_handler("MemberActivatedEvent", Handlers.on_member_activated)
+        self.__topology_event_subscriber.register_handler("MemberTerminatedEvent", Handlers.on_member_terminated)
+        self.__topology_event_subscriber.register_handler("MemberSuspendedEvent", Handlers.on_member_suspended)
+        self.__topology_event_subscriber.register_handler("CompleteTopologyEvent", Handlers.on_complete_topology)
+        self.__topology_event_subscriber.register_handler("MemberStartedEvent", Handlers.on_member_started)
+        self.__topology_event_subscriber.register_handler("MemberCreatedEvent", Handlers.on_member_created)
+        self.__topology_event_subscriber.register_handler("MemberInitializedEvent", Handlers.on_member_initialized)
 
         self.__topology_event_subscriber.start()
         self.__log.info("Cartridge agent topology receiver thread started")
@@ -166,11 +166,11 @@ class CartridgeAgent(object):
     def register_tenant_event_listeners(self):
         self.__log.debug("Starting tenant event message receiver thread")
         self.__tenant_topic_subscriber.register_handler("DomainMappingAddedEvent",
-                                                        self.on_domain_mapping_added)
+                                                        Handlers.on_domain_mapping_added)
         self.__tenant_topic_subscriber.register_handler("DomainsMappingRemovedEvent",
-                                                        self.on_domain_mapping_removed)
-        self.__tenant_topic_subscriber.register_handler("CompleteTenantEvent", self.on_complete_tenant)
-        self.__tenant_topic_subscriber.register_handler("TenantSubscribedEvent", self.on_tenant_subscribed)
+                                                        Handlers.on_domain_mapping_removed)
+        self.__tenant_topic_subscriber.register_handler("CompleteTenantEvent", Handlers.on_complete_tenant)
+        self.__tenant_topic_subscriber.register_handler("TenantSubscribedEvent", Handlers.on_tenant_subscribed)
 
         self.__tenant_topic_subscriber.start()
         self.__log.info("Tenant event message receiver thread started")
@@ -182,7 +182,7 @@ class CartridgeAgent(object):
     def register_application_signup_event_listeners(self):
         self.__log.debug("Starting application signup event message receiver thread")
         self.__app_topic_subscriber.register_handler("ApplicationSignUpRemovedEvent",
-                                                     self.on_application_signup_removed)
+                                                     Handlers.on_application_signup_removed)
 
         self.__app_topic_subscriber.start()
         self.__log.info("Application signup event message receiver thread started")
@@ -191,18 +191,36 @@ class CartridgeAgent(object):
         while not self.__app_topic_subscriber.is_subscribed():
             time.sleep(1)
 
-    def on_artifact_updated(self, msg):
+    def wait_for_complete_topology(self):
+        while not TopologyContext.topology.initialized:
+            self.__log.info("Waiting for complete topology event...")
+            time.sleep(5)
+        self.__log.info("Complete topology event received")
+
+
+class Handlers(object):
+    """
+    Handler methods for message broker events
+    """
+
+    __log = LogFactory().get_log(__name__)
+    __tenant_context_initialized = False
+
+    @staticmethod
+    def on_artifact_updated(msg):
         event_obj = ArtifactUpdatedEvent.create_from_json(msg.payload)
         event_handler.on_artifact_updated_event(event_obj)
 
-    def on_instance_cleanup_member(self, msg):
+    @staticmethod
+    def on_instance_cleanup_member(msg):
         member_in_payload = Config.member_id
         event_obj = InstanceCleanupMemberEvent.create_from_json(msg.payload)
         member_in_event = event_obj.member_id
         if member_in_payload == member_in_event:
             event_handler.on_instance_cleanup_member_event()
 
-    def on_instance_cleanup_cluster(self, msg):
+    @staticmethod
+    def on_instance_cleanup_cluster(msg):
         event_obj = InstanceCleanupClusterEvent.create_from_json(msg.payload)
         cluster_in_payload = Config.cluster_id
         cluster_in_event = event_obj.cluster_id
@@ -212,11 +230,13 @@ class CartridgeAgent(object):
         if cluster_in_event == cluster_in_payload and instance_in_payload == instance_in_event:
             event_handler.on_instance_cleanup_cluster_event()
 
-    def on_member_created(self, msg):
-        self.__log.debug("Member created event received: %r" % msg.payload)
+    @staticmethod
+    def on_member_created(msg):
+        Handlers.__log.debug("Member created event received: %r" % msg.payload)
 
-    def on_member_initialized(self, msg):
-        self.__log.debug("Member initialized event received: %r" % msg.payload)
+    @staticmethod
+    def on_member_initialized(msg):
+        Handlers.__log.debug("Member initialized event received: %r" % msg.payload)
         event_obj = MemberInitializedEvent.create_from_json(msg.payload)
 
         if not TopologyContext.topology.initialized:
@@ -224,84 +244,88 @@ class CartridgeAgent(object):
 
         event_handler.on_member_initialized_event(event_obj)
 
-    def on_member_activated(self, msg):
-        self.__log.debug("Member activated event received: %r" % msg.payload)
+    @staticmethod
+    def on_member_activated(msg):
+        Handlers.__log.debug("Member activated event received: %r" % msg.payload)
         if not TopologyContext.topology.initialized:
             return
 
         event_obj = MemberActivatedEvent.create_from_json(msg.payload)
         event_handler.on_member_activated_event(event_obj)
 
-    def on_member_terminated(self, msg):
-        self.__log.debug("Member terminated event received: %r" % msg.payload)
+    @staticmethod
+    def on_member_terminated(msg):
+        Handlers.__log.debug("Member terminated event received: %r" % msg.payload)
         if not TopologyContext.topology.initialized:
             return
 
         event_obj = MemberTerminatedEvent.create_from_json(msg.payload)
         event_handler.on_member_terminated_event(event_obj)
 
-    def on_member_suspended(self, msg):
-        self.__log.debug("Member suspended event received: %r" % msg.payload)
+    @staticmethod
+    def on_member_suspended(msg):
+        Handlers.__log.debug("Member suspended event received: %r" % msg.payload)
         if not TopologyContext.topology.initialized:
             return
 
         event_obj = MemberSuspendedEvent.create_from_json(msg.payload)
         event_handler.on_member_suspended_event(event_obj)
 
-    def on_complete_topology(self, msg):
+    @staticmethod
+    def on_complete_topology(msg):
         event_obj = CompleteTopologyEvent.create_from_json(msg.payload)
         TopologyContext.update(event_obj.topology)
         if not TopologyContext.topology.initialized:
-            self.__log.info("Topology initialized from complete topology event")
+            Handlers.__log.info("Topology initialized from complete topology event")
             TopologyContext.topology.initialized = True
             event_handler.on_complete_topology_event(event_obj)
 
-        self.__log.debug("Topology context updated with [topology] %r" % event_obj.topology.json_str)
+        Handlers.__log.debug("Topology context updated with [topology] %r" % event_obj.topology.json_str)
 
-    def on_member_started(self, msg):
-        self.__log.debug("Member started event received: %r" % msg.payload)
+    @staticmethod
+    def on_member_started(msg):
+        Handlers.__log.debug("Member started event received: %r" % msg.payload)
         if not TopologyContext.topology.initialized:
             return
 
         event_obj = MemberStartedEvent.create_from_json(msg.payload)
         event_handler.on_member_started_event(event_obj)
 
-    def on_domain_mapping_added(self, msg):
-        self.__log.debug("Subscription domain added event received : %r" % msg.payload)
+    @staticmethod
+    def on_domain_mapping_added(msg):
+        Handlers.__log.debug("Subscription domain added event received : %r" % msg.payload)
         event_obj = DomainMappingAddedEvent.create_from_json(msg.payload)
         event_handler.on_domain_mapping_added_event(event_obj)
 
-    def on_domain_mapping_removed(self, msg):
-        self.__log.debug("Subscription domain removed event received : %r" % msg.payload)
+    @staticmethod
+    def on_domain_mapping_removed(msg):
+        Handlers.__log.debug("Subscription domain removed event received : %r" % msg.payload)
         event_obj = DomainMappingRemovedEvent.create_from_json(msg.payload)
         event_handler.on_domain_mapping_removed_event(event_obj)
 
-    def on_complete_tenant(self, msg):
+    @staticmethod
+    def on_complete_tenant(msg):
         event_obj = CompleteTenantEvent.create_from_json(msg.payload)
         TenantContext.update(event_obj.tenants)
-        if not self.__tenant_context_initialized:
-            self.__log.info("Tenant context initialized from complete tenant event")
-            self.__tenant_context_initialized = True
+        if not Handlers.__tenant_context_initialized:
+            Handlers.__log.info("Tenant context initialized from complete tenant event")
+            Handlers.__tenant_context_initialized = True
             event_handler.on_complete_tenant_event(event_obj)
 
-        self.__log.debug("Tenant context updated with [tenant list] %r" % event_obj.tenant_list_json)
+        Handlers.__log.debug("Tenant context updated with [tenant list] %r" % event_obj.tenant_list_json)
 
-    def on_tenant_subscribed(self, msg):
-        self.__log.debug("Tenant subscribed event received: %r" % msg.payload)
+    @staticmethod
+    def on_tenant_subscribed(msg):
+        Handlers.__log.debug("Tenant subscribed event received: %r" % msg.payload)
         event_obj = TenantSubscribedEvent.create_from_json(msg.payload)
         event_handler.on_tenant_subscribed_event(event_obj)
 
-    def on_application_signup_removed(self, msg):
-        self.__log.debug("Application signup removed event received: %r" % msg.payload)
+    @staticmethod
+    def on_application_signup_removed(msg):
+        Handlers.__log.debug("Application signup removed event received: %r" % msg.payload)
         event_obj = ApplicationSignUpRemovedEvent.create_from_json(msg.payload)
         event_handler.on_application_signup_removed_event(event_obj)
 
-    def wait_for_complete_topology(self):
-        while not TopologyContext.topology.initialized:
-            self.__log.info("Waiting for complete topology event...")
-            time.sleep(5)
-        self.__log.info("Complete topology event received")
-
 
 if __name__ == "__main__":
     log = LogFactory().get_log(__name__)

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
index baea8e8..40cf26d 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
@@ -22,7 +22,7 @@ import sys
 from yapsy.PluginManager import PluginManager
 
 from modules.util.log import LogFactory
-from exception import ParameterNotFoundException
+from exception import ParameterNotFoundException, InvalidConfigValueException
 import constants
 from plugins.contracts import ICartridgeAgentPlugin, IArtifactCommitPlugin, IArtifactCheckoutPlugin, \
     IHealthStatReaderPlugin
@@ -150,6 +150,18 @@ class Config:
     """ :type : str """
     mb_publisher_timeout = None
     """ :type : int """
+    cep_username = None
+    """ :type : str """
+    cep_password = None
+    """ :type : str """
+    cep_urls = []
+    """ :type : list """
+    artifact_clone_retry_count = None
+    """ :type : str """
+    artifact_clone_retry_interval = None
+    """ :type : str """
+    port_check_timeout = None
+    """ :type : str """
 
     @staticmethod
     def read_conf_file():
@@ -354,8 +366,29 @@ class Config:
 
             Config.mb_username = Config.read_property(constants.MB_USERNAME, False)
             Config.mb_password = Config.read_property(constants.MB_PASSWORD, False)
-            Config.mb_urls = Config.read_property(constants.MB_URLS).split(",")
+            Config.mb_urls = Config.read_property(constants.MB_URLS)
             Config.mb_publisher_timeout = int(Config.read_property(constants.MB_PUBLISHER_TIMEOUT))
+
+            Config.cep_username = Config.read_property(constants.CEP_SERVER_ADMIN_USERNAME)
+            Config.cep_password = Config.read_property(constants.CEP_SERVER_ADMIN_PASSWORD)
+            Config.cep_urls = Config.read_property(constants.CEP_RECEIVER_URLS)
+
+            try:
+                Config.artifact_clone_retry_count = Config.read_property(constants.ARTIFACT_CLONE_RETRIES)
+            except ParameterNotFoundException:
+                Config.artifact_clone_retry_count = "5"
+
+            try:
+                Config.artifact_clone_retry_interval = Config.read_property(constants.ARTIFACT_CLONE_INTERVAL)
+            except ParameterNotFoundException:
+                Config.artifact_clone_retry_interval = "10"
+
+            try:
+                Config.port_check_timeout = Config.read_property(constants.PORT_CHECK_TIMEOUT)
+            except ParameterNotFoundException:
+                Config.port_check_timeout = "600000"
+
+            Config.validate_config()
         except ParameterNotFoundException as ex:
             raise RuntimeError(ex)
 
@@ -384,6 +417,52 @@ class Config:
         Config.extension_executor = Config.initialize_extensions()
 
     @staticmethod
+    def validate_config():
+        try:
+            Config.validate_url_list(Config.mb_urls, constants.MB_URLS)
+            Config.validate_int(Config.mb_publisher_timeout, constants.MB_PUBLISHER_TIMEOUT)
+            Config.validate_url_list(Config.cep_urls, constants.CEP_RECEIVER_URLS)
+            Config.validate_int(Config.artifact_update_interval, constants.ARTIFACT_UPDATE_INTERVAL)
+            Config.validate_int(Config.artifact_clone_retry_count, constants.ARTIFACT_CLONE_RETRIES)
+            Config.validate_int(Config.artifact_clone_retry_interval, constants.ARTIFACT_CLONE_INTERVAL)
+            Config.validate_int(Config.port_check_timeout, constants.PORT_CHECK_TIMEOUT)
+        except ValueError as err:
+            raise InvalidConfigValueException("Invalid configuration for Cartridge Agent", err)
+
+    @staticmethod
+    def validate_url_list(urls, field_name):
+        """
+        host1:port1,host2:port2
+
+        :param urls:
+        :param field_name:
+        :return:
+        """
+        url_list = str(urls).split(",")
+        if len(url_list) < 1:
+            raise ValueError("Invalid value [field] \"%s\"" % field_name)
+
+        for single_url in url_list:
+            try:
+                url_ip, url_port = single_url.split(":")
+            except ValueError:
+                raise ValueError("Invalid host or port number value for [field] %s", field_name)
+
+    @staticmethod
+    def validate_int(int_value, field_name):
+        """
+        valid integer value
+
+        :param int_value:
+        :param field_name:
+        :return:
+        """
+        try:
+            int(int_value)
+        except ValueError:
+            raise ValueError("Invalid int value for [field] %s " % field_name)
+
+    @staticmethod
     def initialize_plugins():
         """ Find, load, activate and group plugins for Python CA
         :return: a tuple of (PluginManager, plugins, artifact management plugins)

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/exception.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/exception.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/exception.py
index 1586c4d..345efee 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/exception.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/exception.py
@@ -21,17 +21,8 @@ class CartridgeAgentException(Exception):
     Exception super class to be used by specific exceptions thrown in the cartridge agent
     """
 
-    def __init__(self, message):
-        super(CartridgeAgentException, self).__init__(message)
-        self.__message = message
-
-    def get_message(self):
-        """
-        The message provided when the exception is raised
-        :return: message
-        :rtype: str
-        """
-        return self.__message
+    def __init__(self, *args, **kwargs):
+        Exception.__init__(self, *args, **kwargs)
 
 
 class DataPublisherException(CartridgeAgentException):
@@ -39,8 +30,8 @@ class DataPublisherException(CartridgeAgentException):
     Exception to be used during log publishing operations
     """
 
-    def __init__(self, message):
-        super(DataPublisherException, self).__init__(message)
+    def __init__(self, *args, **kwargs):
+        CartridgeAgentException.__init__(self, *args, **kwargs)
 
 
 class PluginExecutionException(CartridgeAgentException):
@@ -48,8 +39,8 @@ class PluginExecutionException(CartridgeAgentException):
     Exception raised when a runtime error is met while executing an plugin script
     """
 
-    def __init__(self, message):
-        super(PluginExecutionException, self).__init__(message)
+    def __init__(self, *args, **kwargs):
+        CartridgeAgentException.__init__(self, *args, **kwargs)
 
 
 class GitRepositorySynchronizationException(CartridgeAgentException):
@@ -57,8 +48,8 @@ class GitRepositorySynchronizationException(CartridgeAgentException):
     Exception raised during a git repository related task
     """
 
-    def __init__(self, message):
-        super(GitRepositorySynchronizationException, self).__init__(message)
+    def __init__(self, *args, **kwargs):
+        CartridgeAgentException.__init__(self, *args, **kwargs)
 
 
 class ParameterNotFoundException(CartridgeAgentException):
@@ -67,8 +58,8 @@ class ParameterNotFoundException(CartridgeAgentException):
     of the cartridge agent
     """
 
-    def __init__(self, message):
-        super(ParameterNotFoundException, self).__init__(message)
+    def __init__(self, *args, **kwargs):
+        CartridgeAgentException.__init__(self, *args, **kwargs)
 
 
 class ThriftReceiverOfflineException(CartridgeAgentException):
@@ -76,8 +67,8 @@ class ThriftReceiverOfflineException(CartridgeAgentException):
     Exception raised when the connection to the Thrift receiver is dropped when publishing events
     """
 
-    def __init__(self, message):
-        super(ThriftReceiverOfflineException, self).__init__(message)
+    def __init__(self, *args, **kwargs):
+        CartridgeAgentException.__init__(self, *args, **kwargs)
 
 
 class CEPPublisherException(CartridgeAgentException):
@@ -85,5 +76,14 @@ class CEPPublisherException(CartridgeAgentException):
     Exception to be used during CEP publishing operations
     """
 
-    def __init__(self, message):
-        super(CEPPublisherException, self).__init__(message)
+    def __init__(self, *args, **kwargs):
+        CartridgeAgentException.__init__(self, *args, **kwargs)
+
+
+class InvalidConfigValueException(CartridgeAgentException):
+    """
+    Exception to be used when validating agent configuration
+    """
+
+    def __init__(self, *args, **kwargs):
+        CartridgeAgentException.__init__(self, *args, **kwargs)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
index 71f2894..2005537 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
@@ -62,7 +62,7 @@ class HealthStatisticsPublisherManager(Thread):
 
                 self.log.debug("Publishing load average: %r" % cartridge_stats.load_avg)
                 self.publisher.publish_load_average(cartridge_stats.load_avg)
-            except Exception as e:
+            except Exception:
                 self.log.exception(
                     "Couldn't publish health statistics to CEP. Thrift Receiver offline. Reconnecting...")
                 self.publisher = HealthStatisticsPublisher()
@@ -76,33 +76,17 @@ class HealthStatisticsPublisher:
     """
     log = LogFactory().get_log(__name__)
 
-    @staticmethod
-    def read_config(conf_key):
-        """
-        Read a given key from the cartridge agent configuration
-        :param conf_key: The key to look for in the CA config
-        :return: The value for the key from the CA config
-        :raise: RuntimeError if the given key is not found in the CA config
-        """
-        conf_value = Config.read_property(conf_key, False)
-
-        if conf_value is None or conf_value.strip() == "":
-            raise RuntimeError("System property not found: " + conf_key)
-
-        return conf_value
-
     def __init__(self):
 
         self.publishers = []
         self.deactive_publishers = []
-        self.cep_admin_username = HealthStatisticsPublisher.read_config(constants.CEP_SERVER_ADMIN_USERNAME)
-        self.cep_admin_password = HealthStatisticsPublisher.read_config(constants.CEP_SERVER_ADMIN_PASSWORD)
+        self.cep_admin_username = Config.cep_username
+        self.cep_admin_password = Config.cep_password
         self.stream_definition = HealthStatisticsPublisher.create_stream_definition()
         HealthStatisticsPublisher.log.debug("Stream definition created: %r" % str(self.stream_definition))
 
         # 1.1.1.1:1883,2.2.2.2:1883
-        cep_urls = HealthStatisticsPublisher.read_config(constants.CEP_RECEIVER_URLS)
-        cep_urls = cep_urls.split(',')
+        cep_urls = Config.cep_urls.split(',')
         for cep_url in cep_urls:
 
             cep_active = self.is_cep_active(cep_url)
@@ -207,14 +191,10 @@ class HealthStatisticsPublisher:
         return true if active
         :param cep_url:
         """
-        ports = []
         cep_ip = cep_url.split(':')[0]
         cep_port = cep_url.split(':')[1]
-        ports.append(cep_port)
 
-        cep_active = cartridgeagentutils.check_ports_active(
-            cep_ip,
-            ports)
+        cep_active = cartridgeagentutils.check_port_active(cep_ip, cep_port)
 
         return cep_active
 
@@ -229,8 +209,8 @@ class HealthStatisticsPublisher:
             except Exception as ex:
                 raise ThriftReceiverOfflineException(ex)
 
-        deactive_ceps = self.deactive_publishers
-        for cep_url in deactive_ceps:
+        inactive_ceps = self.deactive_publishers
+        for cep_url in inactive_ceps:
             cep_active = self.is_cep_active(cep_url)
             if cep_active:
                 self.add_publishers(cep_url)

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/logpublisher.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/logpublisher.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/logpublisher.py
index e7ab1c7..b9f5d63 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/logpublisher.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/logpublisher.py
@@ -145,7 +145,7 @@ class LogPublisherManager(Thread):
         ports_active = cartridgeagentutils.wait_until_ports_active(
             DataPublisherConfiguration.get_instance().monitoring_server_ip,
             self.ports,
-            int(Config.read_property("port.check.timeout", critical=False)))
+            int(Config.port_check_timeout))
 
         if not ports_active:
             self.log.debug("Monitoring server is not active")

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
index 743bcd6..14b76f3 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
@@ -173,8 +173,8 @@ class AgentGitHandler:
         """
         git_clone_successful = False
         # Read properties from agent.conf
-        max_retry_attempts = int(Config.read_property(constants.ARTIFACT_CLONE_RETRIES, 5))
-        retry_interval = int(Config.read_property(constants.ARTIFACT_CLONE_INTERVAL, 10))
+        max_retry_attempts = int(Config.artifact_clone_retry_count)
+        retry_interval = int(Config.artifact_clone_retry_interval)
         retry_attempts = 0
 
         # Iterate until git clone is successful or reaches max retry attempts

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/application/signup/events.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/application/signup/events.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/application/signup/events.py
index f44dd04..13bb680 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/application/signup/events.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/application/signup/events.py
@@ -27,7 +27,6 @@ class ApplicationSignUpAddedEvent:
         self.clusterIds = None
         """ :type : list[str]  """
 
-
     @staticmethod
     def create_from_json(json_str):
         json_obj = json.loads(json_str)
@@ -49,7 +48,6 @@ class ApplicationSignUpRemovedEvent:
         self.clusterIds = None
         """ :type : list[str]  """
 
-
     @staticmethod
     def create_from_json(json_str):
         json_obj = json.loads(json_str)
@@ -59,4 +57,3 @@ class ApplicationSignUpRemovedEvent:
         app_signup_removed.tenantId = json_obj["tenantId"] if "tenantId" in json_obj else None
 
         return app_signup_removed
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/instance/notifier/events.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/instance/notifier/events.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/instance/notifier/events.py
index 41dc133..d19cd0c 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/instance/notifier/events.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/instance/notifier/events.py
@@ -79,4 +79,4 @@ class InstanceCleanupMemberEvent:
         json_obj = json.loads(json_str)
         m_id = json_obj["memberId"] if "memberId" in json_obj else None
 
-        return InstanceCleanupMemberEvent(m_id)
\ No newline at end of file
+        return InstanceCleanupMemberEvent(m_id)

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/tenant/events.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/tenant/events.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/tenant/events.py
index 2e287bd..8a49bc2 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/tenant/events.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/tenant/events.py
@@ -84,4 +84,4 @@ class TenantUnsubscribedEvent:
         instance.service_name = json_obj["serviceName"] if "serviceName" in json_obj else None
         instance.cluster_ids = json_obj["clusterIds"] if "clusterIds" in json_obj else None
 
-        return instance
\ No newline at end of file
+        return instance

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
index 016692d..7b2d0ed 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
@@ -26,12 +26,18 @@ import os
 
 from log import LogFactory
 
+BS = 16
+
 log = LogFactory().get_log(__name__)
 
-unpad = lambda s: s[0:-ord(s[-1])]
-current_milli_time = lambda: int(round(time.time() * 1000))
-BS = 16
-pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
+
+def unpad(s): return s[0:-ord(s[-1])]
+
+
+def current_milli_time(): return int(round(time.time() * 1000))
+
+
+def pad(s): return s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
 
 
 def decrypt_password(pass_str, secret):
@@ -79,11 +85,26 @@ def wait_until_ports_active(ip_address, ports, ports_check_timeout=600000):
 
     log.debug("Port check timeout: %s" % ports_check_timeout)
 
-    active = False
+    ports_left = ports
     start_time = current_milli_time()
-    while not active:
+
+    # check ports until all are active or timeout exceeds
+    while True:
         log.info("Waiting for ports to be active: [ip] %s [ports] %s" % (ip_address, ports))
-        active = check_ports_active(ip_address, ports)
+
+        # check each port for activity
+        for checking_port in list(ports_left):
+            port_active = check_port_active(ip_address, checking_port)
+            if port_active:
+                log.debug("Port %s on host %s active" % (checking_port, ip_address))
+                ports_left.remove(checking_port)
+
+        # if no ports are left to check for activity, return
+        if len(ports_left) == 0:
+            log.info("Ports activated: [ip] %r [ports] %r" % (ip_address, ports))
+            return True
+
+        # active = check_ports_active(ip_address, ports)
         end_time = current_milli_time()
         duration = end_time - start_time
 
@@ -94,33 +115,33 @@ def wait_until_ports_active(ip_address, ports, ports_check_timeout=600000):
 
         time.sleep(5)
 
-    log.info("Ports activated: [ip] %r [ports] %r" % (ip_address, ports))
-    return True
-
 
-def check_ports_active(ip_address, ports):
+def check_port_active(ip_address, port):
     """
-    Checks the given list of port addresses for active state
+    Checks the given port on the given host for activity
     :param str ip_address: Ip address of the member to be checked
-    :param list[str] ports: The list of ports to be checked
+    :param str port: The port to be checked
     :return: True if the ports are active, False if at least one is not active
     :rtype: bool
     """
-    if len(ports) < 1:
-        raise RuntimeError("No ports found")
+    if port is None:
+        raise RuntimeError("Cannot check invalid port for activity")
 
-    for port in ports:
-        s = socket.socket()
-        s.settimeout(5)
-        try:
-            s.connect((ip_address, int(port)))
-            log.debug("Port %s is active" % port)
-            s.close()
-        except socket.error:
-            log.debug("Port %s is not active" % port)
-            return False
+    try:
+        port_int = int(port)
+    except ValueError:
+        raise RuntimeError("Cannot check invalid port for activity %s" % port)
 
-    return True
+    s = socket.socket()
+    s.settimeout(5)
+    try:
+        s.connect((ip_address, port_int))
+        log.debug("Port %s is active" % port)
+        s.close()
+        return True
+    except socket.error:
+        log.debug("Port %s is not active" % port)
+        return False
 
 
 class Utils(object):

http://git-wip-us.apache.org/repos/asf/stratos/blob/de9ffd26/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py
index 5b6190e..229c354 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py
@@ -71,7 +71,7 @@ def publish_instance_activated_event():
         ports_active = cartridgeagentutils.wait_until_ports_active(
             listen_address,
             configuration_ports,
-            int(Config.read_property("port.check.timeout", critical=False)))
+            int(Config.port_check_timeout))
 
         if ports_active:
             log.info("Publishing instance activated event...")
@@ -226,7 +226,7 @@ class EventPublisher(object):
         while int(time.time()) - self.__start_time < (Config.mb_publisher_timeout * 1000):
             retry_interval = retry_iterator.get_next_retry_interval()
 
-            for mb_url in Config.mb_urls:
+            for mb_url in Config.mb_urls.split(","):
                 mb_ip, mb_port = mb_url.split(":")
 
                 # start a thread to execute publish event


[12/21] stratos git commit: fixing STRATOS-1638

Posted by is...@apache.org.
fixing STRATOS-1638


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/638f2f2b
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/638f2f2b
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/638f2f2b

Branch: refs/heads/stratos-4.1.x
Commit: 638f2f2b7b885ca4251f1f30e8b3db4057c1aa0c
Parents: 338b260
Author: rajkumar <rr...@gmail.com>
Authored: Wed Dec 2 19:17:21 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:32 2015 +0530

----------------------------------------------------------------------
 .../cep/modules/distribution/src/assembly/bin.xml   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/638f2f2b/extensions/cep/modules/distribution/src/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/src/assembly/bin.xml b/extensions/cep/modules/distribution/src/assembly/bin.xml
index ee6c14b..28d912e 100755
--- a/extensions/cep/modules/distribution/src/assembly/bin.xml
+++ b/extensions/cep/modules/distribution/src/assembly/bin.xml
@@ -60,7 +60,23 @@
         <dependencySet>
             <outputDirectory>${project.artifactId}-${project.version}/lib</outputDirectory>
             <includes>
+                <include>org.apache.activemq:activemq-client:jar</include>
+                <include>org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar</include>
+                <include>org.fusesource.hawtbuf:hawtbuf:jar</include>
+                <include>org.apache.commons:commons-lang3:jar</include>
+                <include>org.apache.stratos:org.apache.stratos.messaging:jar</include>
+                <include>org.apache.stratos:org.apache.stratos.common:jar</include>
+            </includes>
+        </dependencySet>
+        <dependencySet>
+            <outputDirectory>${project.artifactId}-${project.version}/wso2cep-3.0.0/lib</outputDirectory>
+            <includes>
                 <include>org.apache.stratos:org.apache.stratos.cep300.extension:jar</include>
+            </includes>
+        </dependencySet>
+        <dependencySet>
+            <outputDirectory>${project.artifactId}-${project.version}/wso2cep-3.1.0/lib</outputDirectory>
+            <includes>
                 <include>org.apache.stratos:org.apache.stratos.cep310.extension:jar</include>
             </includes>
         </dependencySet>


[05/21] stratos git commit: adding comments

Posted by is...@apache.org.
adding comments


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/7fc829e1
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/7fc829e1
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/7fc829e1

Branch: refs/heads/stratos-4.1.x
Commit: 7fc829e1aa02de84fdb65220090e804a245aae83
Parents: 11a35ed
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Tue Dec 1 17:07:23 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Tue Dec 1 17:07:23 2015 +0530

----------------------------------------------------------------------
 .../modules/artifactmgt/git/agentgithandler.py  | 21 ++++++++++----------
 .../plugins/DefaultArtifactCheckout.py          |  7 +++++++
 2 files changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/7fc829e1/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
index 224ca31..743bcd6 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
@@ -214,15 +214,9 @@ class AgentGitHandler:
     @staticmethod
     def clear_repo(tenant_id):
         tenant_id = str(tenant_id)
-        AgentGitHandler.log.info ('########################## in clear_repo method...' + tenant_id)
         if tenant_id in AgentGitHandler.__git_repositories:
             del AgentGitHandler.__git_repositories[tenant_id]
-            AgentGitHandler.log.info('########################## cached repo object deleted for tenant ' +
-                  tenant_id)
-        if tenant_id in AgentGitHandler.__git_repositories:
-            AgentGitHandler.log.info('########################## cached repo object still exists for tenant ' + tenant_id)
-        else:
-            AgentGitHandler.log.info('########################## no cached obj found for ' + tenant_id)
+            AgentGitHandler.log.debug('Cached repo object deleted for tenant ' + tenant_id)
 
     @staticmethod
     def create_git_repo(repo_info):
@@ -338,13 +332,18 @@ class AgentGitHandler:
         return True
 
     @staticmethod
-    def restore_default_artifacts(default_dir):
+    def restore_default_artifacts(initial_artifact_dir):
+        """
+        Restores the initial artifacts from the previously taken backup, if the backup exists
+
+        :param initial_artifact_dir: path to local artifact directory
+        """
         try:
-            Utils.move_directory(Utils.strip_trailing_slash(default_dir) + constants.BACKUP_DIR_SUFFIX, default_dir)
-            AgentGitHandler.log.info('Restored contents from backup location ' +Utils.strip_trailing_slash(default_dir)
+            Utils.move_directory(Utils.strip_trailing_slash(initial_artifact_dir) + constants.BACKUP_DIR_SUFFIX, initial_artifact_dir)
+            AgentGitHandler.log.info('Restored contents from backup location ' + Utils.strip_trailing_slash(initial_artifact_dir)
                                      + constants.BACKUP_DIR_SUFFIX)
         except OSError as e:
-            AgentGitHandler.log.error('Contents of ' + default_dir + ' not restored. Error: %s' % e)
+            AgentGitHandler.log.error('Contents of ' + initial_artifact_dir + ' not restored. Error: %s' % e)
 
     @staticmethod
     def execute_git_command(command, repo_path):

http://git-wip-us.apache.org/repos/asf/stratos/blob/7fc829e1/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
index 413090e..1b7baa0 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/plugins/DefaultArtifactCheckout.py
@@ -110,6 +110,13 @@ class DefaultArtifactCheckout(IArtifactCheckoutPlugin):
                 AgentGitHandler.add_repo(git_repo)
 
     def check_and_backup_initial_artifacts(self, initial_artifact_dir):
+        """
+        verifies if there are any default artifacts by checking the 'initial_artifact_dir' and
+        whether its empty, and takes a backup to a directory  initial_artifact_dir_backup in the
+        same location
+
+        :param initial_artifact_dir: path to local artifact directory
+        """
         # copy default artifacts (if any) to a a temp location
         # if directory name is dir, the backup directory name would be dir_backup
         if self.initial_artifacts_exists(initial_artifact_dir):


[13/21] stratos git commit: UPdate the readme file with currect links

Posted by is...@apache.org.
UPdate the readme file with currect links


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/73fbeb6d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/73fbeb6d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/73fbeb6d

Branch: refs/heads/stratos-4.1.x
Commit: 73fbeb6d490d5d9c5ffbfc9504e05b2554ef7d14
Parents: 18d9714
Author: gayangunarathne <ga...@wso2.com>
Authored: Sun Dec 6 13:20:05 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:33 2015 +0530

----------------------------------------------------------------------
 README.md                         | 22 +++++++++++-----------
 tools/stratos-installer/README.md |  2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/73fbeb6d/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index d6c6f93..a98eaa6 100644
--- a/README.md
+++ b/README.md
@@ -46,14 +46,14 @@ auto-scaling policies with multiple factors,i.e., requests in flight, memory con
 considered when scaling up or down. The Auto-scaler also supports scaling for non-HTTP transport.
 <br />
 For detailed information on how multi-factored auto-scaling takes place in Stratos,
-see [Autoscaler](https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Autoscaler).
+see [Autoscaler](https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Autoscaler).
 
 * Smart policies                                        <br />
 The Auto-scaler in Stratos uses two smart policies when making auto-scaling decisions: auto-scaling policy and deployment policy.
 The instances will be automatically spawned based on the smart policies that are applied to the application.
 <br />
 For more information on auto-scaling and deployment policy scaling policies, see [Smart Policies]
-(https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Smart+Policies).
+(https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Smart+Policies).
 
 * Multiple IaaS support                                 <br />
 Apache Stratos is tested on the following IaaS providers: AWS EC2 and OpenStack. However, it is very easy to extend
@@ -68,7 +68,7 @@ be off-loaded to another cloud.
 It is possible for DevOps to define partitions in a network partition, to control IaaS resources. Thereby,
 Apache Stratos can control resources per cloud, region, and zone. Controlling of IaaS resources provide a high
 availability and solves disaster recovery concerns. For more information, see [Cloud Partitioning]
-(https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Cloud+Partitioning).
+(https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Cloud+Partitioning).
 
 * Loosely coupled communication                         <br />
 Stratos uses the Advanced Message Queuing Protocol (AMQP) messaging technology for communication among all its components.
@@ -87,7 +87,7 @@ A cartridge is a package of code that includes a Virtual Machine (VM) image plus
 be plugged into Stratos to offer a new PaaS service. Stratos supports single tenant and multi-tenant cartridges.
 If needed, tenants can easily add their own cartridges to Stratos.
 <br />
-For more information on how Stratos uses cartridges, see [Cartridge](https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Cartridge).
+For more information on how Stratos uses cartridges, see [Cartridge](https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Cartridge).
 
 * Cartridge automation using Puppet                     <br />
 Cartridges can be easily configured with the use of an orchestration layer such as Puppet.
@@ -96,7 +96,7 @@ Cartridges can be easily configured with the use of an orchestration layer such
 Stratos supports third-party load balancers (LBs), i.e, HAProxy, NGINX. Thereby, if required, users can use their own
 LB with Stratos.
 <br />
-For more information, see [Load Balancers](https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Load+Balancers).
+For more information, see [Load Balancers](https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Load+Balancers).
 
 * Artifact distribution coordination                    <br />
 The Artifact Distribution Coordinator is responsible for the distribution of artifacts. Artifacts can be uploaded
@@ -106,25 +106,25 @@ repositories based deployment synchronization. Users are able to use their own G
 a service instance.
 <br />
 For more information, see [Artifact Distribution Coordinator]
-(https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Artifact+Distribution+Coordinator).
+(https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Artifact+Distribution+Coordinator).
 
 * Stratos Manager Console                               <br />
 Administrators and tenants can use the Stratos Manager console, which is a web-based UI management console in Stratos,
 to interact with Stratos.
 <br />
-For more information, see [Stratos Manager](https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Stratos+Manager).
+For more information, see [Stratos Manager](https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Stratos+Manager).
 
 * Stratos REST API                                      <br />
 DevOps can use REST APIs to carry out various administering functions (e.g., adding a tenant, adding a cartridge, etc.).
 <br />
 For more information, see the [Stratos API Reference Guide]
-(https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Stratos+API+Reference).
+(https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Stratos+API+Reference).
 
 * Interactive CLI Tool                                  <br />
 Command Line Interface (CLI) tool provides users an interface to interact with Stratos and manage your applications.
 <br />
-For more information, see the [CLI Tool](https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+CLI+Tool) and the
-[CLI Guide](https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+CLI+Guide).
+For more information, see the [CLI Tool](https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+CLI+Tool) and the
+[CLI Guide](https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+CLI+Guide).
 
 * Monitoring and metering                               <br />
 Apache Stratos provides centralized monitoring and metering. The level of resource utilization in Stratos is measured using metering.
@@ -134,7 +134,7 @@ If required, the DevOps can enable a persistent volume for cartridges. If persis
 automatically attaches a volume when a new cartridge instance is created.
 <br />
 For more information, see [Persistence Volume Mapping]
-(https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Persistence+Volume+Mapping).
+(https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Persistence+Volume+Mapping).
 
 * Gracefully shutdown instances                         <br />
 Before terminating an instance, when scaling down, the Auto-scaler will allow all the existing requests to the instance

http://git-wip-us.apache.org/repos/asf/stratos/blob/73fbeb6d/tools/stratos-installer/README.md
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/README.md b/tools/stratos-installer/README.md
index 38fb229..d1392ea 100644
--- a/tools/stratos-installer/README.md
+++ b/tools/stratos-installer/README.md
@@ -5,4 +5,4 @@ Apache Stratos Installer
 Stratos-Installer is a tool to install Stratos in Single JVM as well as in distributed setup.
 
 Please refer the following Stratos Wiki page for detailed installation guide:
-https://cwiki.apache.org/confluence/display/STRATOS/4.1.5+Installation+Guide
+https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Installation+Guide


[19/21] stratos git commit: Update the thrift config of the lb extensions

Posted by is...@apache.org.
Update the thrift config of the lb extensions


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d6c6502d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d6c6502d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d6c6502d

Branch: refs/heads/stratos-4.1.x
Commit: d6c6502df2af1118bb0b4df9ee672a99f0e2c1e9
Parents: f24de56
Author: gayangunarathne <ga...@wso2.com>
Authored: Sun Dec 6 01:44:36 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:33 2015 +0530

----------------------------------------------------------------------
 .../src/main/conf/thrift-client-config.xml      | 24 ++++++++++++++++----
 .../src/main/conf/thrift-client-config.xml      | 24 ++++++++++++++++----
 .../src/main/conf/thrift-client-config.xml      | 24 ++++++++++++++++----
 .../src/main/conf/thrift-client-config.xml      | 24 +++++++++++++++-----
 4 files changed, 75 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d6c6502d/extensions/load-balancer/modules/aws-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/aws-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/modules/aws-extension/src/main/conf/thrift-client-config.xml
index 5cacada..2e95c57 100644
--- a/extensions/load-balancer/modules/aws-extension/src/main/conf/thrift-client-config.xml
+++ b/extensions/load-balancer/modules/aws-extension/src/main/conf/thrift-client-config.xml
@@ -20,8 +20,22 @@
 
 <!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
 <thriftClientConfiguration>
-    <username>admin</username>
-    <password>admin</password>
-    <ip>localhost</ip>
-    <port>7611</port>
-</thriftClientConfiguration>
\ No newline at end of file
+    <config>
+        <cep>
+            <node id="node-01">
+                <statsPublisherEnabled>true</statsPublisherEnabled>
+                <username>admin</username>
+                <password>admin</password>
+                <ip>localhost</ip>
+                <port>7611</port>
+            </node>
+            <!--<node id="node-02">
+                 <statsPublisherEnabled>true</statsPublisherEnabled>
+                 <username>admin</username>
+                 <password>admin</password>
+                 <ip>10.10.1.1</ip>
+                 <port>7714</port>
+            </node>-->
+        </cep>
+    </config>
+</thriftClientConfiguration>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d6c6502d/extensions/load-balancer/modules/haproxy-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/modules/haproxy-extension/src/main/conf/thrift-client-config.xml
index 5cacada..2e95c57 100644
--- a/extensions/load-balancer/modules/haproxy-extension/src/main/conf/thrift-client-config.xml
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/conf/thrift-client-config.xml
@@ -20,8 +20,22 @@
 
 <!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
 <thriftClientConfiguration>
-    <username>admin</username>
-    <password>admin</password>
-    <ip>localhost</ip>
-    <port>7611</port>
-</thriftClientConfiguration>
\ No newline at end of file
+    <config>
+        <cep>
+            <node id="node-01">
+                <statsPublisherEnabled>true</statsPublisherEnabled>
+                <username>admin</username>
+                <password>admin</password>
+                <ip>localhost</ip>
+                <port>7611</port>
+            </node>
+            <!--<node id="node-02">
+                 <statsPublisherEnabled>true</statsPublisherEnabled>
+                 <username>admin</username>
+                 <password>admin</password>
+                 <ip>10.10.1.1</ip>
+                 <port>7714</port>
+            </node>-->
+        </cep>
+    </config>
+</thriftClientConfiguration>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d6c6502d/extensions/load-balancer/modules/lvs-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/modules/lvs-extension/src/main/conf/thrift-client-config.xml
index 86a5fc6..1dffaa3 100644
--- a/extensions/load-balancer/modules/lvs-extension/src/main/conf/thrift-client-config.xml
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/conf/thrift-client-config.xml
@@ -18,8 +18,22 @@
   -->
 
 <thriftClientConfiguration>
-    <username>admin</username>
-    <password>admin</password>
-    <ip>localhost</ip>
-    <port>7611</port>
-</thriftClientConfiguration>
\ No newline at end of file
+    <config>
+        <cep>
+            <node id="node-01">
+                <statsPublisherEnabled>true</statsPublisherEnabled>
+                <username>admin</username>
+                <password>admin</password>
+                <ip>localhost</ip>
+                <port>7611</port>
+            </node>
+            <!--<node id="node-02">
+                 <statsPublisherEnabled>true</statsPublisherEnabled>
+                 <username>admin</username>
+                 <password>admin</password>
+                 <ip>10.10.1.1</ip>
+                 <port>7714</port>
+            </node>-->
+        </cep>
+     </config>
+</thriftClientConfiguration>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d6c6502d/extensions/load-balancer/modules/nginx-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/modules/nginx-extension/src/main/conf/thrift-client-config.xml
index 5cacada..e2de82e 100644
--- a/extensions/load-balancer/modules/nginx-extension/src/main/conf/thrift-client-config.xml
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/conf/thrift-client-config.xml
@@ -19,9 +19,21 @@
   -->
 
 <!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
-<thriftClientConfiguration>
-    <username>admin</username>
-    <password>admin</password>
-    <ip>localhost</ip>
-    <port>7611</port>
-</thriftClientConfiguration>
\ No newline at end of file
+<config>
+    <cep>
+        <node id="node-01">
+            <statsPublisherEnabled>true</statsPublisherEnabled>
+            <username>admin</username>
+            <password>admin</password>
+            <ip>localhost</ip>
+            <port>7611</port>
+        </node>
+        <!--<node id="node-02">
+             <statsPublisherEnabled>true</statsPublisherEnabled>
+             <username>admin</username>
+             <password>admin</password>
+             <ip>10.10.1.1</ip>
+             <port>7714</port>
+        </node>-->
+    </cep>
+</config>
\ No newline at end of file


[08/21] stratos git commit: Updating releases in doap_Stratos.rdf

Posted by is...@apache.org.
Updating releases in doap_Stratos.rdf


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f24de56a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f24de56a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f24de56a

Branch: refs/heads/stratos-4.1.x
Commit: f24de56a970ae111cdf51e0702da574def1e8b38
Parents: 638f2f2
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sat Dec 5 20:59:34 2015 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Dec 9 18:41:32 2015 +0530

----------------------------------------------------------------------
 doap_Stratos.rdf | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f24de56a/doap_Stratos.rdf
----------------------------------------------------------------------
diff --git a/doap_Stratos.rdf b/doap_Stratos.rdf
index bf2c620..e5dfac5 100644
--- a/doap_Stratos.rdf
+++ b/doap_Stratos.rdf
@@ -48,6 +48,34 @@
          <revision>4.0.0</revision>
        </Version>
     </release>
+    <release>
+       <Version>
+         <name>Apache Stgratos 4.1.1</name>
+         <created>2014-07-13</created>
+         <revision>4.1.1</revision>
+       </Version>
+    </release>
+    <release>
+       <Version>
+         <name>Apache Stgratos 4.1.2</name>
+         <created>2014-09-02</created>
+         <revision>4.1.2</revision>
+       </Version>
+    </release>
+    <release>
+       <Version>
+         <name>Apache Stgratos 4.1.3</name>
+         <created>2014-09-23</created>
+         <revision>4.1.3</revision>
+       </Version>
+    </release>
+    <release>
+       <Version>
+         <name>Apache Stgratos 4.1.4</name>
+         <created>2014-10-22</created>
+         <revision>4.1.4</revision>
+       </Version>
+    </release>
     <repository>
       <SVNRepository>
         <location rdf:resource="https://git-wip-us.apache.org/repos/asf/stratos.git"/>