').attr({'id':cartridgeCounter+'-'+parentName+'-'+item[prop].type, 'data-type':'cartridge',
+ 'data-calias':item[prop]['subscribableInfo']['alias']} )
+ .text(item[prop].type)
+ .addClass('input-false')
+ .addClass('stepnode')
+ .attr('data-toggle', 'tooltip')
+ .attr('title',item[prop].type )
+ .appendTo('#whiteboard');
+ $(divCartridge).append('
');
+ jsPlumb.addEndpoint($(divCartridge), {
+ anchor: "TopCenter"
+ }, generatedCartridgeEndpointOptions);
+
+ //add connection options
+ jsPlumb.connect({
+ source:$(currentParent),
+ target:$(divCartridge),
+ paintStyle:{strokeStyle:"blue", lineWidth:1 },
+ Connector : [ "Bezier", { curviness:63 } ],
+ anchors:["BottomCenter", "TopCenter"],
+ endpoint:"Dot"
+ });
+
+ DragEl($(divCartridge));
+ }
+ }
+
+ function genJsplumbGroups(item, currentParent, parentName) {
+ for (var prop in item) {
+ var divGroup = $('
').attr({'id':cartridgeCounter+'-'+parentName+'-'+item[prop]['name'],'data-type':'group','data-ctype':item[prop]['name'] })
+ .text(item[prop]['name'])
+ .addClass('stepnode')
+ .attr('data-toggle', 'tooltip')
+ .attr('title',item[prop]['name'] )
+ .addClass('input-false')
+ .appendTo('#whiteboard');
+ //$(divGroup).append('
');
+ jsPlumb.addEndpoint($(divGroup), {
+ anchor:"BottomCenter"
+ }, bottomConnectorOptions);
+
+ jsPlumb.addEndpoint($(divGroup), {
+ anchor: "TopCenter"
+ }, generatedGroupOptions);
+
+ //add connection options
+ jsPlumb.connect({
+ source:$(currentParent),
+ target:$(divGroup),
+ paintStyle:{strokeStyle:"blue", lineWidth:1 },
+ Connector : [ "Bezier", { curviness:63 } ],
+ anchors:["BottomCenter", "TopCenter"],
+ endpoint:"Dot"
+ });
+
+ DragEl($(divGroup));
+
+ if(item[prop].hasOwnProperty('cartridges')) {
+ genJsplumbCartridge(item[prop].cartridges, divGroup, parentName+'-'+item[prop]['name'] );
+ }
+ if(item[prop].hasOwnProperty('groups')) {
+ genJsplumbGroups(item[prop].groups, divGroup, parentName+'-'+item[prop]['name'])
+ }
+ }
+ }
+
+
+
+}
+
+
+jsPlumb.bind("ready", function() {
+ addJsplumbGroup(applicationJSON, cartridgeCounter);
+ //reposition after group add
+ dagrePosition();
+});
+
+
+var signupBlockTemplate = {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "root",
+ "type": "object",
+ "title": " ",
+ "options": {
+ "disable_properties": true,
+ "disable_collapse": true
+ },
+ "properties": {
+ "alias": {
+ "id": "root/alias",
+ "title": "Cartridge Alias: ",
+ "type": "string"
+ },
+ "privateRepo": {
+ "id": "root/privateRepo",
+ "title": "Is private repository: ",
+ "type": "boolean"
+ },
+ "repoUrl": {
+ "id": "root/repoUrl",
+ "title": "Repository URL: ",
+ "type": "string"
+ },
+ "repoUsername": {
+ "id": "root/repoUsername",
+ "title": "Repository User Name: ",
+ "type": "string"
+ },
+ "repoPassword": {
+ "id": "root/repoPassword",
+ "title": "Repository Password: ",
+ "type": "string"
+ }
+ }
+};
+
+var signupBlockDefault = {
+ "alias": "php",
+ "privateRepo": false,
+ "repoUrl": "https://github.com/imesh/stratos-php-applications.git",
+ "repoUsername": "",
+ "repoPassword": ""
+};
+
+
+// Document ready events
+$(document).ready(function(){
+ //handled Ajax base session expire issue
+ $(document).ajaxError(function (e, xhr, settings) {
+ window.location.href = '../';
+ });
+
+ //*******************Adding JSON editor *************//
+ JSONEditor.defaults.theme = 'bootstrap3';
+ JSONEditor.defaults.iconlib = 'fontawesome4';
+ JSONEditor.defaults.show_errors = "always";
+ var editor,blockId;
+
+ $('#whiteboard').on('click', '.stepnode', function(){
+ $('.signup-details').show();
+ $('.signup-default').hide();
+ $('.stepnode').removeClass("highlightme");
+ $(this).addClass('highlightme');
+ tabData($(this));
+ });
+
+ function tabData(node){
+
+ blockId = node.attr('id');
+ var blockType = node.attr('data-type');
+ var startval;
+ var calias = node.attr('data-calias');
+
+ if(blockType == 'cartridge'){
+ startval = signupBlockDefault;
+ startval['alias'] = calias;
+ }
+
+ if(node.attr('data-generated')) {
+ startval = JSON.parse(decodeURIComponent(node.attr('data-generated')));
+ }
+ $('#signup-details').html('');
+
+ switch (blockType){
+ case 'cartridge':
+ generateHtmlBlock(signupBlockTemplate, startval);
+ break;
+ }
+ }
+
+ function generateHtmlBlock(schema, startval){
+ // Initialize the editor
+ editor = new JSONEditor(document.getElementById('signup-details'), {
+ ajax: false,
+ disable_edit_json: true,
+ schema: schema,
+ format: "grid",
+ startval: startval
+ });
+
+ if(editor.getEditor('root.alias')){
+ editor.getEditor('root.alias').disable();
+ }
+
+ }
+
+
+ //get component JSON data
+ $('#component-info-update').on('click', function(){
+ $('#'+blockId).attr('data-generated', encodeURIComponent(JSON.stringify(editor.getValue())));
+ $('#'+blockId).removeClass('input-false');
+ $('#'+blockId).find('div>i').removeClass('fa-exclamation-circle').addClass('fa-check-circle-o').css('color','#2ecc71');
+ });
+
+
+ $('#signup').on('click', function(){
+ var btn = $(this);
+ var appid = btn.attr('data-appid');
+ var signupJSON = {"artifactRepositories":[]};
+ //generate raw data tree from connections
+ $.each(jsPlumb.getConnections(), function (idx, connection) {
+ var dataGen = $('#'+connection.targetId).attr('data-generated');
+ if(dataGen!=undefined){
+ var jsonContent = JSON.parse(decodeURIComponent(dataGen));
+ signupJSON['artifactRepositories'].push(jsonContent);
+ }
+
+ });
+
+ var formtype = 'signupapplication';
+ btn.html("
Adding...");
+ $.ajax({
+ type: "POST",
+ url: caramel.context + "/controllers/applications/application_requests.jag",
+ dataType: 'json',
+ data: { "formPayload": JSON.stringify(signupJSON), "formtype": formtype, "applicationId": appid },
+ success: function (data) {
+ if (data.status == 'error') {
+ var n = noty({text: data.message, layout: 'bottomRight', type: 'error'});
+ } else if (data.status == 'warning') {
+ var n = noty({text: data.message, layout: 'bottomRight', type: 'warning'});
+ } else {
+ var n = noty({text: data.message, layout: 'bottomRight', type: 'success'});
+ window.setTimeout(function(){
+ window.location.href = '../';
+ }, 1500);
+ }
+ }
+ })
+ .always(function () {
+ btn.html('Add Signup');
+ });
+
+ });
+
+
+
+});
\ No newline at end of file
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
index 0c72fb93d4..d5b433cbb1 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
@@ -123,6 +123,14 @@
id="details_list_{{applicationId}}"
data-url="{{url ""}}/applications/{{applicationId}}/" > View
+ {{#if multiTenant}}
+ {{#unless signUpsExist}}
+
Signup
+
+ {{/unless}}
+ {{/if}}
@@ -132,7 +140,14 @@
id="details_{{applicationId}}"
data-url="{{url ""}}/applications/{{applicationId}}/" > View
-
+ {{#if multiTenant}}
+ {{#unless signUpsExist}}
+ Signup
+
+ {{/unless}}
+ {{/if}}
{{else}}
@@ -327,6 +342,10 @@
window.location = $(this).attr("data-url");
});
+ $('.general-table').on('click', '.hover-signup', function (event) {
+ window.location = $(this).attr("data-url");
+ });
+
{{/if}}
$('#deploy').click(function () {
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_signup.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_signup.hbs
new file mode 100644
index 0000000000..6374190f3b
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_signup.hbs
@@ -0,0 +1,64 @@
+
+
+
+
+
+
Application - {{applicationAlias}}
+
+
+
+
+
+
+
+
+
+
+ Add Signup
+ Cancel
+
+
+
+
+
+
+
+
Click on icon to add subscriptions
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/users_form.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/users_form.hbs
index 7472ccfdca..5d8ec66e2a 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/users_form.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/users_form.hbs
@@ -207,11 +207,9 @@
$('input[type=password]').after('
');
$('.hide-pass').click(function(){
if($(this).find('i').hasClass("fa-eye-slash")){
- console.log('hit me w22')
$('input[data-schemaformat=password]').attr('type', 'password');
$(this).find('i').removeClass( "fa-eye-slash" );
}else{
- console.log('hit me')
$(this).find('i').addClass( "fa-eye-slash" );
$('input[data-schemaformat=password]').attr('type', 'text');
}
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
index 80d9dadf4e..e5efbce610 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
@@ -292,6 +292,66 @@ var render = function (theme, data, meta, require) {
});
break;
+ case "applicationSignup":
+ theme('index', {
+ page_meta: [
+ {
+ partial: 'index_title',
+ context: {
+ page_title: 'Apache Stratos - Application Managment',
+ page_description: 'Apache Stratos - Application Managment'
+ }
+ }
+ ],
+ header: [
+ {
+ partial: 'index_header',
+ context: {
+ }
+ }
+ ],
+ sub_header: [
+ {
+ partial: 'index_sub_header',
+ context: {
+ breadcrumbPathLevelOne: data.breadcrumbPathLevelOne,
+ breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo
+ }
+ }
+ ],
+ left_menu: [
+ {
+ partial: 'index_left_menu',
+ context: {
+ left_menu: data.left_menu
+ }
+ }
+ ],
+ right_menu_help: [
+ {
+ partial: 'index_right_menu_help',
+ context: {
+
+ }
+ }
+ ],
+ content: [
+ {
+ partial: 'applications_signup',
+ context: {
+ applicationName: data.applicationName,
+ applicationAlias: data.applicationAlias,
+ formContext: data.breadcrumbPathLevelTwo,
+ appName: data.appName,
+ applicationJSON: data.applicationJSON,
+ formTitle: data.formTitle
+ }
+ }
+
+ ]
+ });
+ break;
+
default:
theme('index', {
page_meta: [
diff --git a/components/org.apache.stratos.manager.styles/pom.xml b/components/org.apache.stratos.manager.styles/pom.xml
index c8b1e5073e..6e67a4e151 100644
--- a/components/org.apache.stratos.manager.styles/pom.xml
+++ b/components/org.apache.stratos.manager.styles/pom.xml
@@ -19,29 +19,23 @@
-->
+ 4.0.0
org.apache.stratos
stratos-components-parent
- 4.1.1
+ 4.1.2-SNAPSHOT
../pom.xml
- 4.0.0
org.apache.stratos.manager.styles
bundle
Apache Stratos - Cloud Manager UI styles
- http://apache.org
-
- maven-eclipse-plugin
- 2.6
-
org.apache.felix
maven-bundle-plugin
-
true
@@ -74,56 +68,45 @@
-
org.wso2.carbon
org.wso2.carbon.ui
- ${wso2carbon.version}
+ ${carbon.kernel.version}
-
org.apache.felix
org.apache.felix.framework
1.0.3
-
org.apache.felix
org.apache.felix.main
1.0.3
-
org.apache.felix
org.osgi.compendium
1.0.0
-
org.eclipse.equinox
org.eclipse.equinox.http.servlet
2.2.2
-
org.eclipse.equinox
org.eclipse.equinox.http.helper
1.0.0
-
org.eclipse.equinox
org.eclipse.equinox.jsp.jasper
1.0.1.R33x_v20070816
-
org.eclipse.equinox
javax.servlet.jsp
2.0.0.v200706191603
-
- 4.2.0
-
-
+
\ No newline at end of file
diff --git a/components/org.apache.stratos.manager/pom.xml b/components/org.apache.stratos.manager/pom.xml
index aa357a4249..0b56f8a8cd 100644
--- a/components/org.apache.stratos.manager/pom.xml
+++ b/components/org.apache.stratos.manager/pom.xml
@@ -17,38 +17,34 @@
specific language governing permissions and limitations
under the License.
-->
-
-
+ 4.0.0
org.apache.stratos
stratos-components-parent
- 4.1.1
+ 4.1.2-SNAPSHOT
- 4.0.0
org.apache.stratos.manager
bundle
Apache Stratos - Manager
Stratos Manager (SM)
- http://apache.org
org.wso2.carbon
org.wso2.carbon.ntask.core
- ${wso2carbon.version}
+ ${carbon.kernel.version}
org.wso2.carbon
org.wso2.carbon.utils
- ${wso2carbon.version}
+ ${carbon.kernel.version}
com.google.code.gson
gson
- 2.1
junit
@@ -86,7 +82,6 @@
org.apache.felix
maven-bundle-plugin
-
true
@@ -117,7 +112,6 @@
org.apache.axis2
axis2-java2wsdl-maven-plugin
- 1.6.1-wso2v10
org.apache.stratos.manager.services.impl.StratosManagerServiceImpl
target/generated-resources/wsdl/StratosManagerService.wsdl
@@ -133,4 +127,4 @@
-
+
\ No newline at end of file
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/components/ApplicationSignUpHandler.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/components/ApplicationSignUpHandler.java
index c52f367505..dec94fb2cd 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/components/ApplicationSignUpHandler.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/components/ApplicationSignUpHandler.java
@@ -94,7 +94,7 @@ public void addApplicationSignUp(ApplicationSignUp applicationSignUp) throws App
}
/**
- * Check application signup availability.
+ * Check application signup availability by tenant.
*
* @param applicationId
* @param tenantId
@@ -113,6 +113,34 @@ public boolean applicationSignUpExist(String applicationId, int tenantId) throws
}
}
+ /**
+ * Check application signup availability.
+ * @param applicationId
+ * @return
+ * @throws ApplicationSignUpException
+ */
+ public boolean applicationSignUpsExist(String applicationId) throws ApplicationSignUpException {
+ try {
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("Checking application signups: [application-id] %s", applicationId));
+ }
+
+ if (StringUtils.isBlank(applicationId)) {
+ throw new RuntimeException("Application id is null");
+ }
+
+ String[] resourcePaths = (String[]) RegistryManager.getInstance().read(APPLICATION_SIGNUP_RESOURCE_PATH);
+ if ((resourcePaths != null) && (resourcePaths.length > 0)) {
+ return true;
+ }
+ return false;
+ } catch (Exception e) {
+ String message = "Could not check application signup availability: [application-id] " + applicationId;
+ log.error(message, e);
+ throw new ApplicationSignUpException(message, e);
+ }
+ }
+
/**
* Remove application signup by application id, tenant id.
*
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/internal/StratosManagerServiceComponent.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/internal/StratosManagerServiceComponent.java
index 825b068273..5f7bd01840 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/internal/StratosManagerServiceComponent.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/internal/StratosManagerServiceComponent.java
@@ -79,9 +79,7 @@
* cardinality="1..1" policy="dynamic" bind="setComponentStartUpSynchronizer" unbind="unsetComponentStartUpSynchronizer"
*/
public class StratosManagerServiceComponent {
-
private static final Log log = LogFactory.getLog(StratosManagerServiceComponent.class);
-
private static final String THREAD_POOL_ID = "stratos.manager.thread.pool";
private static final String SCHEDULER_THREAD_POOL_ID = "stratos.manager.scheduler.thread.pool";
private static final String STRATOS_MANAGER_COORDINATOR_LOCK = "stratos.manager.coordinator.lock";
@@ -95,6 +93,9 @@ public class StratosManagerServiceComponent {
private ScheduledExecutorService scheduler;
protected void activate(final ComponentContext componentContext) throws Exception {
+ if (log.isDebugEnabled()) {
+ log.debug("Activating StratosManagerServiceComponent...");
+ }
try {
executorService = StratosThreadPool.getExecutorService(THREAD_POOL_ID, THREAD_POOL_SIZE);
scheduler = StratosThreadPool.getScheduledExecutorService(SCHEDULER_THREAD_POOL_ID,
@@ -148,7 +149,8 @@ public void run() {
// Initialize application event receiver
initializeApplicationEventReceiver();
- componentStartUpSynchronizer.waitForWebServiceActivation("StratosManagerService");
+ componentStartUpSynchronizer.waitForAxisServiceActivation(Component.StratosManager,
+ "StratosManagerService");
componentStartUpSynchronizer.setComponentStatus(Component.StratosManager, true);
if (log.isInfoEnabled()) {
log.info("Stratos manager component is activated");
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java
index b80aea7c80..4c4237a62d 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java
@@ -55,6 +55,24 @@ public interface StratosManagerService {
*/
public ApplicationSignUp getApplicationSignUp(String applicationId, int tenantId) throws ApplicationSignUpException;
+ /**
+ * Check application signup availability by tenant
+ * @param applicationId
+ * @param tenantId
+ * @return
+ * @throws ApplicationSignUpException
+ */
+ public boolean applicationSignUpExist(String applicationId, int tenantId) throws ApplicationSignUpException;
+
+ /**
+ * Check application signup availability
+ * @param applicationId
+ * @return
+ * @throws ApplicationSignUpException
+ */
+ public boolean applicationSignUpsExist(String applicationId) throws ApplicationSignUpException;
+
+
/**
* Get application signups available for an application.
*
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java
index f7c0858363..c164e1c636 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java
@@ -62,6 +62,16 @@ public ApplicationSignUp getApplicationSignUp(String applicationId, int tenantId
return signUpHandler.getApplicationSignUp(applicationId, tenantId);
}
+ @Override
+ public boolean applicationSignUpExist(String applicationId, int tenantId) throws ApplicationSignUpException {
+ return signUpHandler.applicationSignUpExist(applicationId, tenantId);
+ }
+
+ @Override
+ public boolean applicationSignUpsExist(String applicationId) throws ApplicationSignUpException {
+ return signUpHandler.applicationSignUpsExist(applicationId);
+ }
+
@Override
public ApplicationSignUp[] getApplicationSignUps(String applicationId) throws ApplicationSignUpException {
return signUpHandler.getApplicationSignUps(applicationId);
diff --git a/components/org.apache.stratos.messaging/pom.xml b/components/org.apache.stratos.messaging/pom.xml
index 22bb2af16c..3321efe41f 100644
--- a/components/org.apache.stratos.messaging/pom.xml
+++ b/components/org.apache.stratos.messaging/pom.xml
@@ -19,18 +19,16 @@
-->
-
+ 4.0.0
org.apache.stratos
stratos-components-parent
- 4.1.1
+ 4.1.2-SNAPSHOT
- 4.0.0
org.apache.stratos.messaging
bundle
Apache Stratos - Messaging
- http://apache.org
@@ -46,7 +44,6 @@
com.google.code.gson
gson
- 2.2.4
org.apache.commons
@@ -61,12 +58,12 @@
org.wso2.carbon
org.wso2.carbon.logging
- ${wso2carbon.version}
+ ${carbon.kernel.version}
org.wso2.carbon
org.wso2.carbon.utils
- ${wso2carbon.version}
+ ${carbon.kernel.version}
com.jamesmurty.utils
@@ -94,6 +91,10 @@
5.10.0
test
+
+ org.apache.felix
+ org.apache.felix.scr.annotations
+
@@ -105,7 +106,6 @@
org.apache.felix
maven-bundle-plugin
-
true
@@ -129,4 +129,4 @@
-
+
\ No newline at end of file
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/application/Applications.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/application/Applications.java
index 82ef5e2454..4d366f18e9 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/application/Applications.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/application/Applications.java
@@ -27,6 +27,9 @@
import java.util.HashMap;
import java.util.Map;
+/*
+ DO NOT make this a singleton
+ */
public class Applications implements Serializable {
private static Log log = LogFactory.getLog(Applications.class);
@@ -43,23 +46,23 @@ public synchronized void addApplication(Application application) {
this.applicationMap.put(application.getUniqueIdentifier(), application);
}
- public Application getApplication(String appId) {
+ public synchronized Application getApplication(String appId) {
return this.getApplications().get(appId);
}
- public boolean isInitialized() {
+ public synchronized boolean isInitialized() {
return initialized;
}
- public void setInitialized(boolean initialized) {
+ public synchronized void setInitialized(boolean initialized) {
this.initialized = initialized;
}
- public boolean applicationExists(String appId) {
+ public synchronized boolean applicationExists(String appId) {
return this.getApplications().containsKey(appId);
}
- public Map
getApplications() {
+ public synchronized Map getApplications() {
return applicationMap;
}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/KubernetesService.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/KubernetesService.java
index 9cee9d7c84..a00809bec0 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/KubernetesService.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/KubernetesService.java
@@ -35,7 +35,15 @@ public class KubernetesService implements Serializable {
private int port;
private int containerPort;
private String serviceType;
+ private String portName;
+ public String getPortName() {
+ return portName;
+ }
+
+ public void setPortName(String portName) {
+ this.portName = portName;
+ }
public String getServiceType() {
return serviceType;
}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Topology.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Topology.java
index 2f929bf06b..9f641ec838 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Topology.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Topology.java
@@ -53,12 +53,6 @@ public void addService(Service service) {
this.serviceMap.put(service.getServiceName(), service);
}
- public synchronized void addServices(Collection services) {
- for (Service service : services) {
- addService(service);
- }
- }
-
public void removeService(Service service) {
this.serviceMap.remove(service.getServiceName());
TopologyLockHierarchy.getInstance().removeTopologyLockForService(service.getServiceName());
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/CurveFinderOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/CurveFinderOfLoadAverageEvent.java
new file mode 100644
index 0000000000..55c947564c
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/CurveFinderOfLoadAverageEvent.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.messaging.event.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+public class CurveFinderOfLoadAverageEvent extends Event {
+ private final String networkPartitionId;
+ private final String clusterId;
+ private final String clusterInstanceId;
+ private final double value;
+ /**
+ * Curve finder co-efficients
+ */
+ private final double a;
+ private final double b;
+ private final double c;
+
+ public CurveFinderOfLoadAverageEvent(String networkPartitionId, String clusterId, String clusterInstanceId, double value, float a, float b, float c) {
+ this.networkPartitionId = networkPartitionId;
+ this.clusterId = clusterId;
+ this.clusterInstanceId = clusterInstanceId;
+ this.value = value;
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ }
+
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public String getNetworkPartitionId() {
+ return networkPartitionId;
+ }
+
+ public String getClusterInstanceId() {
+ return clusterInstanceId;
+ }
+
+ public double getValue() {
+ return value;
+ }
+
+ public double getA() {
+ return a;
+ }
+
+ public double getB() {
+ return b;
+ }
+
+ public double getC() {
+ return c;
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/CurveFinderOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/CurveFinderOfMemoryConsumptionEvent.java
new file mode 100644
index 0000000000..84e48061c6
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/CurveFinderOfMemoryConsumptionEvent.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.messaging.event.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+public class CurveFinderOfMemoryConsumptionEvent extends Event {
+ private final String networkPartitionId;
+ private final String clusterId;
+ private final String clusterInstanceId;
+ private final double value;
+ /**
+ * Curve finder co-efficients
+ */
+ private final double a;
+ private final double b;
+ private final double c;
+
+ public CurveFinderOfMemoryConsumptionEvent(String networkPartitionId, String clusterId, String clusterInstanceId, double value, float a, float b, float c) {
+ this.networkPartitionId = networkPartitionId;
+ this.clusterId = clusterId;
+ this.clusterInstanceId = clusterInstanceId;
+ this.value = value;
+ this.a = a;
+ this.b = b;
+ this.c = c;
+
+ }
+
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public String getNetworkPartitionId() {
+ return networkPartitionId;
+ }
+
+ public String getClusterInstanceId() {
+ return clusterInstanceId;
+ }
+
+ public double getValue() {
+ return value;
+ }
+
+ public double getA() {
+ return a;
+ }
+
+ public double getB() {
+ return b;
+ }
+
+ public double getC() {
+ return c;
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/CurveFinderOfRequestsInFlightEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/CurveFinderOfRequestsInFlightEvent.java
new file mode 100644
index 0000000000..4aaeae796d
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/CurveFinderOfRequestsInFlightEvent.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.stratos.messaging.event.health.stat;
+
+
+import org.apache.stratos.messaging.event.Event;
+
+public class CurveFinderOfRequestsInFlightEvent extends Event {
+ private final String clusterId;
+ private final String clusterInstanceId;
+ private final String networkPartitionId;
+ private final double value;
+ /**
+ * Curve finder co-efficients
+ */
+ private final double a;
+ private final double b;
+ private final double c;
+
+ public CurveFinderOfRequestsInFlightEvent(String clusterId, String clusterInstanceId, String networkPartitionId, double value, float a, float b, float c) {
+ this.clusterId = clusterId;
+ this.clusterInstanceId = clusterInstanceId;
+ this.networkPartitionId = networkPartitionId;
+ this.value = value;
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ }
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public String getNetworkPartitionId() {
+ return networkPartitionId;
+ }
+
+ public String getClusterInstanceId() {
+ return clusterInstanceId;
+ }
+
+ public double getValue() {
+ return value;
+ }
+
+ public double getA() {
+ return a;
+ }
+
+ public double getB() {
+ return b;
+ }
+
+ public double getC() {
+ return c;
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberCurveFinderOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberCurveFinderOfLoadAverageEvent.java
new file mode 100644
index 0000000000..24c508c681
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberCurveFinderOfLoadAverageEvent.java
@@ -0,0 +1,59 @@
+package org.apache.stratos.messaging.event.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Created by pranavan on 8/9/15.
+ */
+public class MemberCurveFinderOfLoadAverageEvent extends Event {
+ private final String clusterId;
+ private final String clusterInstanceId;
+ private final String memberId;
+ private final double value;
+ /**
+ * Curve finder co-efficients
+ */
+ private final double a;
+ private final double b;
+ private final double c;
+
+
+ public MemberCurveFinderOfLoadAverageEvent(String clusterId, String clusterInstanceId, String memberId, double value, double a, double b, double c) {
+ this.clusterId = clusterId;
+ this.clusterInstanceId = clusterInstanceId;
+ this.memberId = memberId;
+ this.value = value;
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ }
+
+
+ public String getMemberId() {
+ return memberId;
+ }
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public String getClusterInstanceId() {
+ return clusterInstanceId;
+ }
+
+ public double getValue() {
+ return value;
+ }
+
+ public double getA() {
+ return a;
+ }
+
+ public double getB() {
+ return b;
+ }
+
+ public double getC() {
+ return c;
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberCurveFinderOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberCurveFinderOfMemoryConsumptionEvent.java
new file mode 100644
index 0000000000..95ce51869b
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberCurveFinderOfMemoryConsumptionEvent.java
@@ -0,0 +1,66 @@
+package org.apache.stratos.messaging.event.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Created by pranavan on 8/9/15.
+ */
+public class MemberCurveFinderOfMemoryConsumptionEvent extends Event {
+ private final String memberId;
+ private final String clusterId;
+ private final String clusterInstanceId;
+ private final String networkPartitionId;
+ private final double value;
+ /**
+ * Curve finder co-efficients
+ */
+ private final double a;
+ private final double b;
+ private final double c;
+
+
+ public MemberCurveFinderOfMemoryConsumptionEvent(String memberId, String clusterId, String clusterInstanceId, String networkPartitionId, double value, double a, double
+ b, double c) {
+ this.memberId = memberId;
+ this.clusterId = clusterId;
+ this.clusterInstanceId = clusterInstanceId;
+ this.networkPartitionId = networkPartitionId;
+ this.value = value;
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ }
+
+
+ public String getMemberId() {
+ return memberId;
+ }
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public String getNetworkPartitionId() {
+ return networkPartitionId;
+ }
+
+ public String getClusterInstanceId() {
+ return clusterInstanceId;
+ }
+
+ public double getValue() {
+ return value;
+ }
+
+ public double getA() {
+ return a;
+ }
+
+ public double getB() {
+ return b;
+ }
+
+ public double getC() {
+ return c;
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/CurveFinderOfLoadAverageEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/CurveFinderOfLoadAverageEventListener.java
new file mode 100644
index 0000000000..1d99746337
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/CurveFinderOfLoadAverageEventListener.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.messaging.listener.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.listener.EventListener;
+
+/**
+ * Created by pranavan on 8/7/15.
+ */
+public class CurveFinderOfLoadAverageEventListener extends EventListener{
+
+ @Override
+ protected void onEvent(Event event) {
+
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/CurveFinderOfMemoryConsumptionEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/CurveFinderOfMemoryConsumptionEventListener.java
new file mode 100644
index 0000000000..6c50a24c96
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/CurveFinderOfMemoryConsumptionEventListener.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.messaging.listener.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.listener.EventListener;
+
+/**
+ * Created by pranavan on 8/7/15.
+ */
+public class CurveFinderOfMemoryConsumptionEventListener extends EventListener{
+ @Override
+ protected void onEvent(Event event) {
+
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/CurveFinderOfRequestsInfFlightEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/CurveFinderOfRequestsInfFlightEventListener.java
new file mode 100644
index 0000000000..d5f9a10e12
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/CurveFinderOfRequestsInfFlightEventListener.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.messaging.listener.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.listener.EventListener;
+
+/**
+ * Created by pranavan on 8/7/15.
+ */
+public class CurveFinderOfRequestsInfFlightEventListener extends EventListener {
+ @Override
+ protected void onEvent(Event event) {
+
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberCurveFinderOfLoadAverageEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberCurveFinderOfLoadAverageEventListener.java
new file mode 100644
index 0000000000..54fa7f697e
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberCurveFinderOfLoadAverageEventListener.java
@@ -0,0 +1,14 @@
+package org.apache.stratos.messaging.listener.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.listener.EventListener;
+
+/**
+ * Created by pranavan on 8/9/15.
+ */
+public class MemberCurveFinderOfLoadAverageEventListener extends EventListener {
+ @Override
+ protected void onEvent(Event event) {
+
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberCurveFinderOfMemoryConsumptionEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberCurveFinderOfMemoryConsumptionEventListener.java
new file mode 100644
index 0000000000..d9e40c02d2
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberCurveFinderOfMemoryConsumptionEventListener.java
@@ -0,0 +1,14 @@
+package org.apache.stratos.messaging.listener.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.listener.EventListener;
+
+/**
+ * Created by pranavan on 8/9/15.
+ */
+public class MemberCurveFinderOfMemoryConsumptionEventListener extends EventListener{
+ @Override
+ protected void onEvent(Event event) {
+
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/application/ApplicationInstanceCreatedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/application/ApplicationInstanceCreatedMessageProcessor.java
index 314a9150cd..e56d7bf4ea 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/application/ApplicationInstanceCreatedMessageProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/application/ApplicationInstanceCreatedMessageProcessor.java
@@ -40,18 +40,14 @@ public void setNext(MessageProcessor nextProcessor) {
@Override
public boolean process(String type, String message, Object object) {
-
Applications applications = (Applications) object;
-
if (ApplicationInstanceCreatedEvent.class.getName().equals(type)) {
-
if (!applications.isInitialized()) {
return false;
}
-
-
- ApplicationInstanceCreatedEvent event = (ApplicationInstanceCreatedEvent) MessagingUtil.jsonToObject(message,
- ApplicationInstanceCreatedEvent.class);
+ ApplicationInstanceCreatedEvent event =
+ (ApplicationInstanceCreatedEvent) MessagingUtil.jsonToObject(message,
+ ApplicationInstanceCreatedEvent.class);
if (event == null) {
log.error("Unable to convert the JSON message to ApplicationInstanceCreatedEvent");
return false;
@@ -60,17 +56,18 @@ public boolean process(String type, String message, Object object) {
ApplicationsUpdater.acquireWriteLockForApplications();
try {
return doProcess(event, applications);
-
- } finally {
+ }
+ finally {
ApplicationsUpdater.releaseWriteLockForApplications();
}
-
} else {
if (nextProcessor != null) {
// ask the next processor to take care of the message.
return nextProcessor.process(type, message, applications);
} else {
- throw new RuntimeException(String.format("Failed to process message using available message processors: [type] %s [body] %s", type, message));
+ throw new RuntimeException(String.format(
+ "Failed to process message using available message processors: [type] %s [body] %s", type,
+ message));
}
}
}
@@ -78,13 +75,18 @@ public boolean process(String type, String message, Object object) {
private boolean doProcess(ApplicationInstanceCreatedEvent event, Applications applications) {
// check if required properties are available
- if (event.getApplicationInstance() == null) {
- String errorMsg = "Application instance object of application instance created event is invalid";
+ if (event.getApplicationInstance() == null || event.getApplicationId() == null) {
+ String errorMsg = "Application instance object of ApplicationInstanceCreatedEvent is invalid. " +
+ "[ApplicationId] " + event.getApplicationId() + ", [ApplicationInstance] " +
+ event.getApplicationInstance();
+ log.error(errorMsg);
+ throw new RuntimeException(errorMsg);
+ }
+ if (applications == null) {
+ String errorMsg = "Error! Applications object is null";
log.error(errorMsg);
throw new RuntimeException(errorMsg);
-
}
-
ApplicationInstance applicationInstance = event.getApplicationInstance();
if (applicationInstance.getInstanceId() == null || applicationInstance.getInstanceId().isEmpty()) {
@@ -97,15 +99,13 @@ private boolean doProcess(ApplicationInstanceCreatedEvent event, Applications ap
// check if an Application instance with same name exists in applications instance
if (null != applications.getApplication(event.getApplicationId()).
getInstanceByNetworkPartitionId(applicationInstance.getNetworkPartitionId())) {
-
- log.warn("Application instance with id [ " + applicationInstance.getInstanceId() + " ] already exists");
-
+ log.warn("Application instance [AppInstanceId] " + applicationInstance.getInstanceId() + " already exists");
} else {
// add application instance to Application Topology
- applications.getApplication(event.getApplicationId()).addInstance(applicationInstance.getInstanceId(), applicationInstance);
+ applications.getApplication(event.getApplicationId())
+ .addInstance(applicationInstance.getInstanceId(), applicationInstance);
}
-
notifyEventListeners(event);
return true;
}
-}
+}
\ No newline at end of file
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/CurveFinderOfLoadAverageMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/CurveFinderOfLoadAverageMessageProcessor.java
new file mode 100644
index 0000000000..ab86ca0323
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/CurveFinderOfLoadAverageMessageProcessor.java
@@ -0,0 +1,44 @@
+package org.apache.stratos.messaging.message.processor.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.CurveFinderOfLoadAverageEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.MessagingUtil;
+
+/**
+ * Created by pranavan on 8/9/15.
+ */
+public class CurveFinderOfLoadAverageMessageProcessor extends MessageProcessor{
+ private static final Log log = LogFactory.getLog(CurveFinderOfLoadAverageMessageProcessor.class);
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (CurveFinderOfLoadAverageEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ CurveFinderOfLoadAverageEvent event = (CurveFinderOfLoadAverageEvent) MessagingUtil.jsonToObject
+ (message, CurveFinderOfLoadAverageEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("%s event processor notified listeners ... ", type));
+ }
+ return true;
+ } else {
+ if (nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ } else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/CurveFinderOfMemoryConsumptionMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/CurveFinderOfMemoryConsumptionMessageProcessor.java
new file mode 100644
index 0000000000..329e8b1933
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/CurveFinderOfMemoryConsumptionMessageProcessor.java
@@ -0,0 +1,44 @@
+package org.apache.stratos.messaging.message.processor.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.CurveFinderOfMemoryConsumptionEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.MessagingUtil;
+
+/**
+ * Created by pranavan on 8/9/15.
+ */
+public class CurveFinderOfMemoryConsumptionMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(CurveFinderOfLoadAverageMessageProcessor.class);
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (CurveFinderOfMemoryConsumptionEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ CurveFinderOfMemoryConsumptionEvent event = (CurveFinderOfMemoryConsumptionEvent) MessagingUtil.jsonToObject
+ (message, CurveFinderOfMemoryConsumptionEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("%s event processor notified listeners ... ", type));
+ }
+ return true;
+ } else {
+ if (nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ } else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/CurveFinderOfRequestsInFlightMesaageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/CurveFinderOfRequestsInFlightMesaageProcessor.java
new file mode 100644
index 0000000000..e7770b6d58
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/CurveFinderOfRequestsInFlightMesaageProcessor.java
@@ -0,0 +1,44 @@
+package org.apache.stratos.messaging.message.processor.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.CurveFinderOfRequestsInFlightEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.MessagingUtil;
+
+/**
+ * Created by pranavan on 8/9/15.
+ */
+public class CurveFinderOfRequestsInFlightMesaageProcessor extends MessageProcessor{
+ private static final Log log = LogFactory.getLog(CurveFinderOfRequestsInFlightMesaageProcessor.class);
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (CurveFinderOfRequestsInFlightEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ CurveFinderOfRequestsInFlightEvent event = (CurveFinderOfRequestsInFlightEvent) MessagingUtil.jsonToObject
+ (message, CurveFinderOfRequestsInFlightEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("%s event processor notified listeners ... ", type));
+ }
+ return true;
+ } else {
+ if (nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ } else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/HealthStatMessageProcessorChain.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/HealthStatMessageProcessorChain.java
index 70bde39786..c374d62e40 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/HealthStatMessageProcessorChain.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/HealthStatMessageProcessorChain.java
@@ -45,6 +45,11 @@ public class HealthStatMessageProcessorChain extends MessageProcessorChain {
private MemberSecondDerivativeOfLoadAverageMessageProcessor memberSecondDerivativeOfLoadAverageMessageProcessor;
private MemberSecondDerivativeOfMemoryConsumptionMessageProcessor memberSecondDerivativeOfMemoryConsumptionMessageProcessor;
private AverageRequestsServingCapabilityMessageProcessor averageRequestsServingCapabilityMessageProcessor;
+ private CurveFinderOfLoadAverageMessageProcessor curveFinderOfLoadAverageMessageProcessor;
+ private CurveFinderOfMemoryConsumptionMessageProcessor curveFinderOfMemoryConsumptionMessageProcessor;
+ private CurveFinderOfRequestsInFlightMesaageProcessor curveFinderOfRequestsInFlightMesaageProcessor;
+ private MemberCurveFinderOfLoadAverageMessageProcessor memberCurveFinderOfLoadAverageMessageProcessor;
+ private MemberCurveFinderOfMemoryConsumptionMessageProcessor memberCurveFinderOfMemoryConsumptionMessageProcessor;
private MemberFaultMessageProcessor memberFaultMessageProcessor;
@@ -88,6 +93,17 @@ protected void initialize() {
secondDerivativeOfMemoryConsumptionMessageProcessor = new SecondDerivativeOfMemoryConsumptionMessageProcessor();
add(secondDerivativeOfMemoryConsumptionMessageProcessor);
+ curveFinderOfLoadAverageMessageProcessor = new CurveFinderOfLoadAverageMessageProcessor();
+ add(curveFinderOfLoadAverageMessageProcessor);
+ curveFinderOfMemoryConsumptionMessageProcessor = new CurveFinderOfMemoryConsumptionMessageProcessor();
+ add(curveFinderOfMemoryConsumptionMessageProcessor);
+ curveFinderOfRequestsInFlightMesaageProcessor = new CurveFinderOfRequestsInFlightMesaageProcessor();
+ add(curveFinderOfRequestsInFlightMesaageProcessor);
+ memberCurveFinderOfLoadAverageMessageProcessor = new MemberCurveFinderOfLoadAverageMessageProcessor();
+ add(memberCurveFinderOfLoadAverageMessageProcessor);
+ memberCurveFinderOfMemoryConsumptionMessageProcessor = new MemberCurveFinderOfMemoryConsumptionMessageProcessor();
+ add(memberCurveFinderOfMemoryConsumptionMessageProcessor);
+
memberFaultMessageProcessor = new MemberFaultMessageProcessor();
add(memberFaultMessageProcessor);
}
@@ -129,7 +145,16 @@ public void addEventListener(EventListener eventListener) {
} else if (eventListener instanceof SecondDerivativeOfRequestsInFlightEventListener) {
secondDerivativeOfRequestsInFlightMessageProcessor.addEventListener(eventListener);
-
+ } else if(eventListener instanceof CurveFinderOfLoadAverageEventListener){
+ curveFinderOfLoadAverageMessageProcessor.addEventListener(eventListener);
+ } else if(eventListener instanceof CurveFinderOfMemoryConsumptionEventListener){
+ curveFinderOfMemoryConsumptionMessageProcessor.addEventListener(eventListener);
+ } else if(eventListener instanceof CurveFinderOfRequestsInfFlightEventListener){
+ curveFinderOfRequestsInFlightMesaageProcessor.addEventListener(eventListener);
+ } else if(eventListener instanceof MemberCurveFinderOfLoadAverageEventListener){
+ memberCurveFinderOfLoadAverageMessageProcessor.addEventListener(eventListener);
+ } else if(eventListener instanceof MemberCurveFinderOfMemoryConsumptionEventListener){
+ memberCurveFinderOfMemoryConsumptionMessageProcessor.addEventListener(eventListener);
} else {
throw new RuntimeException("Unknown event listener");
}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberCurveFinderOfLoadAverageMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberCurveFinderOfLoadAverageMessageProcessor.java
new file mode 100644
index 0000000000..e2b4b268ed
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberCurveFinderOfLoadAverageMessageProcessor.java
@@ -0,0 +1,44 @@
+package org.apache.stratos.messaging.message.processor.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.MemberCurveFinderOfLoadAverageEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.MessagingUtil;
+
+/**
+ * Created by pranavan on 8/9/15.
+ */
+public class MemberCurveFinderOfLoadAverageMessageProcessor extends MessageProcessor{
+ private static final Log log = LogFactory.getLog(MemberCurveFinderOfLoadAverageMessageProcessor.class);
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (MemberCurveFinderOfLoadAverageEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ MemberCurveFinderOfLoadAverageEvent event = (MemberCurveFinderOfLoadAverageEvent) MessagingUtil.jsonToObject
+ (message, MemberCurveFinderOfLoadAverageEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("%s event processor notified listeners ... ", type));
+ }
+ return true;
+ } else {
+ if (nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ } else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberCurveFinderOfMemoryConsumptionMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberCurveFinderOfMemoryConsumptionMessageProcessor.java
new file mode 100644
index 0000000000..5536e315ef
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberCurveFinderOfMemoryConsumptionMessageProcessor.java
@@ -0,0 +1,41 @@
+package org.apache.stratos.messaging.message.processor.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.MemberCurveFinderOfMemoryConsumptionEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.MessagingUtil;
+
+/**
+ * Created by pranavan on 8/9/15.
+ */
+public class MemberCurveFinderOfMemoryConsumptionMessageProcessor extends MessageProcessor{
+ private static final Log log = LogFactory.getLog(MemberCurveFinderOfMemoryConsumptionMessageProcessor.class);
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if(MemberCurveFinderOfMemoryConsumptionEvent.class.getName().equals(type)){
+
+ MemberCurveFinderOfMemoryConsumptionEvent event = (MemberCurveFinderOfMemoryConsumptionEvent) MessagingUtil.jsonToObject(message, MemberCurveFinderOfMemoryConsumptionEvent.class);
+ notifyEventListeners(event);
+
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("%s event processor notified listeners ... ", type));
+ }
+ return true;
+
+ } else {
+ if (nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ } else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
diff --git a/components/org.apache.stratos.metadata.client/pom.xml b/components/org.apache.stratos.metadata.client/pom.xml
index cdacc0251f..2b805b481c 100644
--- a/components/org.apache.stratos.metadata.client/pom.xml
+++ b/components/org.apache.stratos.metadata.client/pom.xml
@@ -18,17 +18,15 @@
-->
-
+ 4.0.0
org.apache.stratos
stratos-components-parent
- 4.1.1
+ 4.1.2-SNAPSHOT
org.apache.stratos.metadata.client
bundle
- 4.0.0
-
Apache Stratos - Metadata Client
@@ -41,12 +39,10 @@
commons-configuration
commons-configuration
1.9
-
com.google.code.gson
gson
- 2.2.4
@@ -59,7 +55,6 @@
org.apache.felix
maven-bundle-plugin
- 1.4.0
true
@@ -81,5 +76,4 @@
-
-
+
\ No newline at end of file
diff --git a/components/org.apache.stratos.metadata.service/pom.xml b/components/org.apache.stratos.metadata.service/pom.xml
index 88b323d7ef..1b6e2bb75c 100644
--- a/components/org.apache.stratos.metadata.service/pom.xml
+++ b/components/org.apache.stratos.metadata.service/pom.xml
@@ -18,13 +18,13 @@
-->
+ 4.0.0
org.apache.stratos
stratos-components-parent
- 4.1.1
+ 4.1.2-SNAPSHOT
- 4.0.0
org.apache.stratos.metadata.service
war
Apache Stratos - Metadata Service
@@ -53,31 +53,23 @@
-
+ org.apache.maven.plugins
maven-compiler-plugin
-
- 1.5
- 1.5
-
- 2.3.2
maven-war-plugin
- 2.2
-
src/main/webapp/${appName}
metadata
-
@@ -92,19 +84,19 @@
org.wso2.carbon
org.wso2.carbon.core
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
org.wso2.carbon
org.wso2.carbon.utils
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
org.wso2.carbon
org.wso2.carbon.identity.oauth.stub
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
@@ -146,13 +138,13 @@
org.wso2.carbon
org.wso2.carbon.ntask.core
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
org.wso2.carbon
org.wso2.carbon.registry.ws.stub
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
@@ -162,4 +154,4 @@
provided
-
+
\ No newline at end of file
diff --git a/components/org.apache.stratos.mock.iaas.api/pom.xml b/components/org.apache.stratos.mock.iaas.api/pom.xml
index df155eff50..b2ccbc125a 100644
--- a/components/org.apache.stratos.mock.iaas.api/pom.xml
+++ b/components/org.apache.stratos.mock.iaas.api/pom.xml
@@ -18,13 +18,13 @@
-->
+ 4.0.0
org.apache.stratos
stratos-components-parent
- 4.1.1
+ 4.1.2-SNAPSHOT
- 4.0.0
org.apache.stratos.mock.iaas.api
war
Apache Stratos - Mock IaaS API
@@ -44,16 +44,11 @@
+ org.apache.maven.plugins
maven-compiler-plugin
-
- 1.5
- 1.5
-
- 2.3.2
maven-war-plugin
- 2.2
@@ -78,19 +73,19 @@
org.wso2.carbon
org.wso2.carbon.core
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
org.wso2.carbon
org.wso2.carbon.utils
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
org.wso2.carbon
org.wso2.carbon.identity.oauth.stub
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
@@ -112,4 +107,4 @@
provided
-
+
\ No newline at end of file
diff --git a/components/org.apache.stratos.mock.iaas.client/pom.xml b/components/org.apache.stratos.mock.iaas.client/pom.xml
index c47236007c..0a1ea8d806 100644
--- a/components/org.apache.stratos.mock.iaas.client/pom.xml
+++ b/components/org.apache.stratos.mock.iaas.client/pom.xml
@@ -17,16 +17,14 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
-
+
+ 4.0.0
stratos-components-parent
org.apache.stratos
- 4.1.1
+ 4.1.2-SNAPSHOT
- 4.0.0
org.apache.stratos.mock.iaas.client
Apache Stratos - Mock IaaS API Client
@@ -51,15 +49,16 @@
com.google.code.gson
gson
- 2.2.4
commons-logging
commons-logging
+ 1.1.1
junit
junit
+ ${junit.version}
test
@@ -83,11 +82,10 @@
org.apache.felix
maven-bundle-plugin
-
true
- ${pom.artifactId}
+ ${project.artifactId}
${project.artifactId}
org.apache.stratos.mock.iaas.client.*,
diff --git a/components/org.apache.stratos.mock.iaas/pom.xml b/components/org.apache.stratos.mock.iaas/pom.xml
index f91daaf7d1..6707e0de79 100644
--- a/components/org.apache.stratos.mock.iaas/pom.xml
+++ b/components/org.apache.stratos.mock.iaas/pom.xml
@@ -17,15 +17,14 @@
# specific language governing permissions and limitations
# under the License.
-->
-
+
+ 4.0.0
stratos-components-parent
org.apache.stratos
- 4.1.1
+ 4.1.2-SNAPSHOT
- 4.0.0
org.apache.stratos.mock.iaas
Apache Stratos - Mock IaaS
@@ -35,17 +34,17 @@
org.wso2.carbon
org.wso2.carbon.core
- ${wso2carbon.version}
+ ${carbon.kernel.version}
org.wso2.carbon
org.wso2.carbon.logging
- ${wso2carbon.version}
+ ${carbon.kernel.version}
org.wso2.carbon
org.wso2.carbon.databridge.commons
- ${wso2carbon.version}
+ ${carbon.kernel.version}
org.apache.stratos
@@ -71,8 +70,8 @@
true
- ${pom.artifactId}
- ${pom.artifactId}
+ ${project.artifactId}
+ ${project.artifactId}
org.apache.stratos.mock.iaas.*,
org.apache.stratos.mock.iaas.domain.*,
diff --git a/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/internal/MockIaasServiceComponent.java b/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/internal/MockIaasServiceComponent.java
index d4d38793fb..bc384c6919 100644
--- a/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/internal/MockIaasServiceComponent.java
+++ b/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/internal/MockIaasServiceComponent.java
@@ -47,6 +47,9 @@ public class MockIaasServiceComponent {
private static final Log log = LogFactory.getLog(MockIaasServiceComponent.class);
protected void activate(final ComponentContext context) {
+ if (log.isDebugEnabled()) {
+ log.debug("Activating MockIaasServiceComponent...");
+ }
Runnable mockIaasActivator = new Runnable() {
@Override
public void run() {
diff --git a/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/services/impl/MockIaasServiceImpl.java b/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/services/impl/MockIaasServiceImpl.java
index 81cbfbe077..4d2ff127fe 100644
--- a/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/services/impl/MockIaasServiceImpl.java
+++ b/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/services/impl/MockIaasServiceImpl.java
@@ -102,7 +102,7 @@ public MockInstanceMetadata startInstance(MockInstanceContext mockInstanceContex
}
// Generate instance id
- String instanceId = UUID.randomUUID().toString();
+ String instanceId = mockInstanceContext.getMemberId();
mockInstanceContext.setInstanceId(instanceId);
MockInstance mockInstance = new MockInstance(mockInstanceContext);
diff --git a/components/org.apache.stratos.python.cartridge.agent/pom.xml b/components/org.apache.stratos.python.cartridge.agent/pom.xml
index d366264fd5..7debdf144b 100644
--- a/components/org.apache.stratos.python.cartridge.agent/pom.xml
+++ b/components/org.apache.stratos.python.cartridge.agent/pom.xml
@@ -19,13 +19,13 @@
+ 4.0.0
org.apache.stratos
stratos-components-parent
- 4.1.1
+ 4.1.2-SNAPSHOT
- 4.0.0
org.apache.stratos.python.cartridge.agent
jar
Apache Stratos - Python Cartridge Agent
@@ -77,7 +77,7 @@
org.wso2.carbon
org.wso2.carbon.logging
- ${wso2carbon.version}
+ ${carbon.kernel.version}
commons-lang.wso2
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 8ffea6b2dd..fdf3880b60 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
@@ -264,7 +264,7 @@ def initialize_config():
Config.application_id = Config.read_property(constants.APPLICATION_ID)
Config.service_name = Config.read_property(constants.SERVICE_NAME)
Config.cluster_id = Config.read_property(constants.CLUSTER_ID)
- Config.ports = Config.read_property(constants.PORTS).split("|")
+ Config.ports = Config.read_property(constants.PORTS).replace("'","").split("|")
Config.is_multiTenant = Config.read_property(constants.MULTITENANT)
Config.tenant_id = Config.read_property(constants.TENANT_ID)
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/entity.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/entity.py
index fd40511756..3bb03e74b9 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/entity.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/entity.py
@@ -223,6 +223,8 @@ def __init__(self, service_name="", cluster_id="", deployment_policy_name="", au
""" :type : str """
self.app_id = ""
""" :type : str """
+ self.kubernetesService_map = {}
+ """ :type : dict[str, KubernetesService] """
# Not relevant to cartridge agent
# self.instance_id_instance_context_map = {}
# """ :type : dict[str, ClusterInstance] """
@@ -242,6 +244,17 @@ def get_members(self):
"""
return self.member_map.values()
+ def get_kubernetesServices(self):
+ """
+ Provides the list of kubernetes Services in the cluster
+ :return: The list of KubernetesService object
+ :rtype: list[KubernetesService]
+ """
+ return self.kubernetesService_map.values()
+
+ def add_kubernetesService(self, kubernetesService):
+ self.kubernetesService_map[kubernetesService.id] = kubernetesService
+
def add_member(self, member):
self.member_map[member.member_id] = member
@@ -401,6 +414,33 @@ def add_ports(self, ports):
self.add_port(port)
+class KubernetesService:
+ """
+ Represents a kubernetes service on a particular cluster
+ """
+
+ def __init__(self, id, portalIP, protocol, port, containerPort, serviceType, portName):
+ self.id = id
+ """ :type : str """
+ self.portalIP = portalIP
+ """ :type : str """
+ self.protocol = protocol
+ """ :type : str """
+ self.port = port
+ """ :type : str """
+ self.containerPort = containerPort
+ """ :type : str """
+ self.serviceType = serviceType
+ """ :type : str """
+ self.portName = portName
+ """ :type : str """
+ self.publicIPs = []
+ """ :type : list[str] """
+
+ def add_public_ips(self, public_ip):
+ self.publicIPs.append(public_ip)
+
+
class Port:
"""
Represents a port on a particular member
@@ -472,7 +512,7 @@ class Tenant:
Object type representing the tenant details of a single tenant
"""
- def __init__(self, tenant_id, tenant_domain):
+ def __init__(self, tenant_id, tenant_domain):
self.tenant_id = tenant_id
""" :type : int """
self.tenant_domain = tenant_domain
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/topology/events.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/topology/events.py
index e11daabed4..48b4e2ec92 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/topology/events.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/topology/events.py
@@ -165,7 +165,7 @@ def create_from_json(json_str):
topology_str = json_obj["topology"] if "topology" in json_obj else None
if topology_str is not None:
topology_obj = Topology()
- topology_obj.initialized = True if str(topology_str["initialized"]).lower == "true" else False
+ topology_obj.initialized = True if str(topology_str["initialized"]).lower() == "true" else False
topology_obj.json_str = topology_str
# add service map
@@ -192,9 +192,9 @@ def create_from_json(json_str):
cl_deployment_policy_name, cl_autoscale_policy_name)
cluster_obj.hostnames = cluster_str["hostNames"]
cluster_obj.tenant_range = cluster_str["tenantRange"] if "tenantRange" in cluster_str else None
- cluster_obj.is_lb_cluster = True if str(cluster_str["isLbCluster"]).lower == "true" else False
- cluster_obj.is_kubernetes_cluster = True if str(cluster_str["isKubernetesCluster"]).lower == "true" \
- else False
+ cluster_obj.is_lb_cluster = True if str(cluster_str["isLbCluster"]).lower() == "true" else False
+ cluster_obj.is_kubernetes_cluster = True if str(cluster_str["isKubernetesCluster"]).lower() == \
+ "true" else False
# cluster_obj.status = cluster_str["status"] if "status" in cluster_str else None
cluster_obj.load_balancer_algorithm_name = cluster_str["loadBalanceAlgorithmName"] \
if "loadBalanceAlgorithmName" in cluster_str else None
@@ -220,7 +220,8 @@ def create_from_json(json_str):
member_obj.member_default_public_ip = member_str["defaultPublicIP"] \
if "defaultPublicIP" in member_str else None
member_obj.status = member_str["memberStateManager"]["stateStack"][-1]
- member_obj.member_private_ips = member_str["memberPrivateIPs"] if "memberPrivateIPs" in member_str \
+ member_obj.member_private_ips = member_str[
+ "memberPrivateIPs"] if "memberPrivateIPs" in member_str \
else None
member_obj.member_default_private_ip = member_str["defaultPrivateIP"] \
if "defaultPrivateIP" in member_str else None
@@ -235,6 +236,20 @@ def create_from_json(json_str):
mm_port_obj = Port(mm_port_str["protocol"], mm_port_str["value"], mm_port_proxy)
member_obj.add_port(mm_port_obj)
cluster_obj.add_member(member_obj)
+
+ for kubService_str in cluster_str["kubernetesServices"]:
+ kubService_id = kubService_str["id"]
+ kubService_portalIP = kubService_str["portalIP"]
+ kubService_protocol = kubService_str["protocol"]
+ kubService_port = kubService_str["port"]
+ kubService_containerPort = kubService_str["containerPort"]
+ kubService_serviceType = kubService_str["serviceType"]
+ kubService_portName = kubService_str["portName"]
+ kubService_obj = KubernetesService(kubService_id, kubService_portalIP, kubService_protocol,
+ kubService_port, kubService_containerPort,
+ kubService_serviceType, kubService_portName)
+ kubService_obj.publicIPs = kubService_str["publicIPs"]
+ cluster_obj.add_kubernetesService(kubService_obj)
service_obj.add_cluster(cluster_obj)
topology_obj.add_service(service_obj)
instance.topology = topology_obj
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java b/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
index ea62d977a1..620e11bdd9 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
+++ b/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
@@ -85,10 +85,10 @@ public class PythonCartridgeAgentTest {
private boolean eventReceiverInitiated = false;
private TopologyEventReceiver topologyEventReceiver;
private InstanceStatusEventReceiver instanceStatusEventReceiver;
- private int cepPort = 7711;
+ private int cepPort = 7712;
private BrokerService broker = new BrokerService();
private static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "tcp://localhost:61617";
- private static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "mqtt://localhost:1883";
+ private static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "mqtt://localhost:1884";
private static final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
public PythonCartridgeAgentTest(ArtifactUpdatedEvent artifactUpdatedEvent, Boolean expectedResult) {
@@ -161,7 +161,7 @@ protected void onEvent(Event event) {
log.info("Starting python cartridge agent...");
this.outputStream = executeCommand(
"python " + agentPath + "/agent.py > " + getResourcesFolderPath() + File.separator + ".." +
- File.separator + PYTHON_AGENT_DIR_NAME + File.separator + "cartridge-agent-ttttt.log");
+ File.separator + PYTHON_AGENT_DIR_NAME + File.separator + "cartridge-agent.log");
}
/**
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
index 86603a066c..04f4a0c79d 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
+++ b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
@@ -17,10 +17,10 @@
[agent]
mb.ip =localhost
-mb.port =1883
+mb.port =1884
listen.address =localhost
thrift.receiver.ip =localhost
-thrift.receiver.port =7711
+thrift.receiver.port =7712
thrift.server.admin.username =admin
thrift.server.admin.password =admin
cep.stats.publisher.enabled =true
diff --git a/components/org.apache.stratos.rest.endpoint/pom.xml b/components/org.apache.stratos.rest.endpoint/pom.xml
index e1b1e6fecf..f94389e4b9 100644
--- a/components/org.apache.stratos.rest.endpoint/pom.xml
+++ b/components/org.apache.stratos.rest.endpoint/pom.xml
@@ -18,13 +18,13 @@
-->
+ 4.0.0
org.apache.stratos
stratos-components-parent
- 4.1.1
+ 4.1.2-SNAPSHOT
- 4.0.0
org.apache.stratos.rest.endpoint
war
Apache Stratos - RESTful admin service module
@@ -56,16 +56,11 @@
+ org.apache.maven.plugins
maven-compiler-plugin
-
- 1.5
- 1.5
-
- 2.3.2
maven-war-plugin
- 2.2
@@ -90,19 +85,19 @@
org.wso2.carbon
org.wso2.carbon.core
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
org.wso2.carbon
org.wso2.carbon.utils
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
org.wso2.carbon
org.wso2.carbon.identity.oauth.stub
- ${wso2carbon.version}
+ ${carbon.kernel.version}
provided
@@ -148,4 +143,4 @@
provided
-
+
\ No newline at end of file
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 631e38c831..82d3d6690e 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -445,7 +445,8 @@ public Response removeCartridge(
.build();
} catch (CloudControllerServiceCartridgeNotFoundExceptionException e) {
return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
- ResponseMessageBean.ERROR, e.getFaultMessage().getCartridgeNotFoundException().getMessage())).build();
+ ResponseMessageBean.ERROR,
+ e.getFaultMessage().getCartridgeNotFoundException().getMessage())).build();
}
}
@@ -480,10 +481,12 @@ public Response addCartridgeGroup(
ResponseMessageBean.ERROR, e.getMessage())).build();
} catch (AutoscalerServiceInvalidServiceGroupExceptionException e) {
return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
- ResponseMessageBean.ERROR, e.getFaultMessage().getInvalidServiceGroupException().getMessage())).build();
+ ResponseMessageBean.ERROR,
+ e.getFaultMessage().getInvalidServiceGroupException().getMessage())).build();
} catch (CloudControllerServiceCartridgeNotFoundExceptionException e) {
return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
- ResponseMessageBean.ERROR, e.getFaultMessage().getCartridgeNotFoundException().getMessage())).build();
+ ResponseMessageBean.ERROR,
+ e.getFaultMessage().getCartridgeNotFoundException().getMessage())).build();
}
}
@@ -1252,7 +1255,8 @@ public Response undeployApplication(
}
StratosApiV41Utils.undeployApplication(applicationId, force);
return Response.accepted().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
- String.format("Application undeploy process started successfully: [application-id] %s", applicationId))).build();
+ String.format("Application undeploy process started successfully: [application-id] %s",
+ applicationId))).build();
}
/**
@@ -1305,7 +1309,8 @@ public Response removeApplication(
if (!applicationDefinition.getStatus().equalsIgnoreCase(StratosApiV41Utils.APPLICATION_STATUS_CREATED)) {
return Response.status(Response.Status.CONFLICT).entity(new ResponseMessageBean(ResponseMessageBean.ERROR,
String.format("Could not delete since application is not in CREATED state :" +
- " [application] %s [current-status] %S", applicationId, applicationDefinition.getStatus()))).build();
+ " [application] %s [current-status] %S", applicationId,
+ applicationDefinition.getStatus()))).build();
}
StratosApiV41Utils.removeApplication(applicationId);
@@ -1501,10 +1506,12 @@ public Response addTenant(
} catch (InvalidEmailException e) {
return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
- ResponseMessageBean.ERROR, String.format("Invalid email: [email] %s", tenantInfoBean.getEmail()))).build();
+ ResponseMessageBean.ERROR, String.format("Invalid email: [email] %s",
+ tenantInfoBean.getEmail()))).build();
} catch (InvalidDomainException e) {
return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
- ResponseMessageBean.ERROR, String.format("Invalid domain: [domain] %s", tenantInfoBean.getTenantDomain()))).build();
+ ResponseMessageBean.ERROR, String.format("Invalid domain: [domain] %s",
+ tenantInfoBean.getTenantDomain()))).build();
}
}
@@ -1527,16 +1534,19 @@ public Response updateTenant(
try {
StratosApiV41Utils.updateExistingTenant(tenantInfoBean);
return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
- String.format("Tenant updated successfully: [tenant] %s", tenantInfoBean.getTenantDomain()))).build();
+ String.format("Tenant updated successfully: [tenant] %s",
+ tenantInfoBean.getTenantDomain()))).build();
} catch (TenantNotFoundException ex) {
return Response.status(Response.Status.NOT_FOUND).entity(new ResponseMessageBean(
ResponseMessageBean.ERROR, "Tenant not found")).build();
} catch (InvalidEmailException e) {
return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
- ResponseMessageBean.ERROR, String.format("Invalid email [email] %s", tenantInfoBean.getEmail()))).build();
+ ResponseMessageBean.ERROR, String.format("Invalid email [email] %s",
+ tenantInfoBean.getEmail()))).build();
} catch (InvalidDomainException e) {
return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(
- ResponseMessageBean.ERROR, String.format("Invalid Domain [Domain] %s", tenantInfoBean.getTenantDomain()))).build();
+ ResponseMessageBean.ERROR, String.format("Invalid Domain [Domain] %s",
+ tenantInfoBean.getTenantDomain()))).build();
} catch (Exception e) {
String msg = "Error in updating tenant " + tenantInfoBean.getTenantDomain();
log.error(msg, e);
@@ -1643,13 +1653,15 @@ public Response getPartialSearchTenants(
@PathParam("tenantDomain") String tenantDomain) throws RestAPIException {
try {
- List tenantList = StratosApiV41Utils.searchPartialTenantsDomains(tenantDomain);
+ List tenantList =
+ StratosApiV41Utils.searchPartialTenantsDomains(tenantDomain);
if (tenantList == null || tenantList.isEmpty()) {
return Response.status(Response.Status.NOT_FOUND).entity(new ResponseMessageBean(
ResponseMessageBean.ERROR, "No tenants found")).build();
}
- return Response.ok().entity(tenantList.toArray(new org.apache.stratos.common.beans.TenantInfoBean[tenantList.size()])).build();
+ return Response.ok().entity(tenantList.toArray(
+ new org.apache.stratos.common.beans.TenantInfoBean[tenantList.size()])).build();
} catch (Exception e) {
String msg = "Error in getting information for tenant " + tenantDomain;
log.error(msg, e);
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index 716076de20..148a3e68de 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -56,17 +56,16 @@
import org.apache.stratos.common.client.AutoscalerServiceClient;
import org.apache.stratos.common.client.CloudControllerServiceClient;
import org.apache.stratos.common.client.StratosManagerServiceClient;
-import org.apache.stratos.common.exception.ApacheStratosException;
import org.apache.stratos.common.exception.InvalidEmailException;
import org.apache.stratos.common.util.ClaimsMgtUtil;
import org.apache.stratos.common.util.CommonUtil;
+import org.apache.stratos.kubernetes.client.KubernetesConstants;
import org.apache.stratos.manager.service.stub.StratosManagerServiceApplicationSignUpExceptionException;
import org.apache.stratos.manager.service.stub.StratosManagerServiceDomainMappingExceptionException;
import org.apache.stratos.manager.service.stub.domain.application.signup.ApplicationSignUp;
import org.apache.stratos.manager.service.stub.domain.application.signup.ArtifactRepository;
import org.apache.stratos.manager.service.stub.domain.application.signup.DomainMapping;
import org.apache.stratos.manager.user.management.StratosUserManagerUtils;
-import org.apache.stratos.manager.user.management.TenantUserRoleManager;
import org.apache.stratos.manager.user.management.exception.UserManagerException;
import org.apache.stratos.manager.utils.ApplicationManagementUtil;
import org.apache.stratos.messaging.domain.application.Application;
@@ -93,7 +92,6 @@
import org.wso2.carbon.user.core.tenant.Tenant;
import org.wso2.carbon.user.core.tenant.TenantManager;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
-import org.apache.stratos.kubernetes.client.KubernetesConstants;
import java.rmi.RemoteException;
import java.util.*;
@@ -102,13 +100,13 @@
public class StratosApiV41Utils {
+ private static final Log log = LogFactory.getLog(StratosApiV41Utils.class);
+
public static final String APPLICATION_STATUS_DEPLOYED = "Deployed";
public static final String APPLICATION_STATUS_CREATED = "Created";
public static final String APPLICATION_STATUS_UNDEPLOYING = "Undeploying";
public static final String KUBERNETES_IAAS_PROVIDER = "kubernetes";
- private static final Log log = LogFactory.getLog(StratosApiV41Utils.class);
-
/**
* Add New Cartridge
*
@@ -973,7 +971,6 @@ public static void addCartridgeGroup(CartridgeGroupBean serviceGroupDefinition)
List cartridgeTypes = new ArrayList();
String[] cartridgeNames = null;
List groupNames;
- String[] cartridgeGroupNames;
if (log.isDebugEnabled()) {
log.debug("Checking cartridges in cartridge group " + serviceGroupDefinition.getName());
@@ -1018,11 +1015,10 @@ public static void addCartridgeGroup(CartridgeGroupBean serviceGroupDefinition)
List groupDefinitions = serviceGroupDefinition.getGroups();
groupNames = new ArrayList();
- cartridgeGroupNames = new String[groupDefinitions.size()];
+
int i = 0;
for (CartridgeGroupBean groupList : groupDefinitions) {
groupNames.add(groupList.getName());
- cartridgeGroupNames[i] = groupList.getName();
i++;
}
@@ -1102,29 +1098,24 @@ public static void updateServiceGroup(CartridgeGroupBean cartridgeGroup) throws
List cartridgesToRemove = new ArrayList();
List cartridgesToAdd = new ArrayList();
- if (cartridgesBeforeUpdating != null) {
- if (!cartridgesBeforeUpdating.isEmpty()) {
- cartridgesToRemove.addAll(cartridgesBeforeUpdating);
- }
+
+ if (!cartridgesBeforeUpdating.isEmpty()) {
+ cartridgesToRemove.addAll(cartridgesBeforeUpdating);
}
- if (cartridgesAfterUpdating != null) {
- if (!cartridgesAfterUpdating.isEmpty()) {
- cartridgesToAdd.addAll(cartridgesAfterUpdating);
- }
+ if (!cartridgesAfterUpdating.isEmpty()) {
+ cartridgesToAdd.addAll(cartridgesAfterUpdating);
}
- if ((cartridgesBeforeUpdating != null) && (cartridgesAfterUpdating != null)) {
- if ((!cartridgesBeforeUpdating.isEmpty()) && (!cartridgesAfterUpdating.isEmpty())) {
- for (String before : cartridgesBeforeUpdating) {
- for (String after : cartridgesAfterUpdating) {
- if (before.toLowerCase().equals(after.toLowerCase())) {
- if (cartridgesToRemove.contains(after)) {
- cartridgesToRemove.remove(after);
- }
- if (cartridgesToAdd.contains(after)) {
- cartridgesToAdd.remove(after);
- }
+ if ((!cartridgesBeforeUpdating.isEmpty()) && (!cartridgesAfterUpdating.isEmpty())) {
+ for (String before : cartridgesBeforeUpdating) {
+ for (String after : cartridgesAfterUpdating) {
+ if (before.toLowerCase().equals(after.toLowerCase())) {
+ if (cartridgesToRemove.contains(after)) {
+ cartridgesToRemove.remove(after);
+ }
+ if (cartridgesToAdd.contains(after)) {
+ cartridgesToAdd.remove(after);
}
}
}
@@ -1862,6 +1853,11 @@ public static List getApplications() throws RestAPIException {
if (applicationContext != null) {
ApplicationBean applicationDefinition =
ObjectConverter.convertStubApplicationContextToApplicationDefinition(applicationContext);
+ if(applicationDefinition.isMultiTenant()) {
+ boolean hasSignUps = StratosManagerServiceClient.getInstance().
+ applicationSignUpsExist(applicationDefinition.getApplicationId());
+ applicationDefinition.setSignUpsExist(hasSignUps);
+ }
applicationDefinitions.add(applicationDefinition);
}
}
@@ -1871,6 +1867,10 @@ public static List getApplications() throws RestAPIException {
String message = "Could not read applications";
log.error(message, e);
throw new RestAPIException(message, e);
+ } catch (StratosManagerServiceApplicationSignUpExceptionException e) {
+ String message = "Could not read applications";
+ log.error(message, e);
+ throw new RestAPIException(message, e);
}
}
@@ -1941,10 +1941,6 @@ public static ApplicationInfoBean getApplicationRuntime(String applicationId)
if (application.getInstanceContextCount() > 0
|| (applicationContext != null &&
applicationContext.getStatus().equals("Deployed"))) {
-
- if (application == null) {
- return null;
- }
applicationBean = ObjectConverter.convertApplicationToApplicationInstanceBean(application);
for (ApplicationInstanceBean instanceBean : applicationBean.getApplicationInstances()) {
addClustersInstancesToApplicationInstanceBean(instanceBean, application);
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
index 798882ecb2..ac32305d06 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
@@ -288,7 +288,8 @@ private static org.apache.stratos.cloud.controller.stub.Properties convertProper
org.apache.stratos.cloud.controller.stub.Properties stubProperties
= new org.apache.stratos.cloud.controller.stub.Properties();
org.apache.stratos.cloud.controller.stub.Property[] stubPropertiesArray =
- stubPropertiesList.toArray(new org.apache.stratos.cloud.controller.stub.Property[stubPropertiesList.size()]);
+ stubPropertiesList.toArray(
+ new org.apache.stratos.cloud.controller.stub.Property[stubPropertiesList.size()]);
stubProperties.setProperties(stubPropertiesArray);
return stubProperties;
@@ -457,7 +458,8 @@ public static NetworkPartitionBean convertCCStubNetworkPartitionToNetworkPartiti
networkPartition.setProvider(stubNetworkPartition.getProvider());
if (stubNetworkPartition.getPartitions() != null) {
List partitionList = new ArrayList();
- for (org.apache.stratos.cloud.controller.stub.domain.Partition stubPartition : stubNetworkPartition.getPartitions()) {
+ for (org.apache.stratos.cloud.controller.stub.domain.Partition stubPartition :
+ stubNetworkPartition.getPartitions()) {
if (stubPartition != null) {
partitionList.add(convertCCStubPartitionToPartition(stubPartition));
}
@@ -484,7 +486,8 @@ public static NetworkPartitionBean convertCCStubNetworkPartitionToNetworkPartiti
return networkPartition;
}
- public static ApplicationPolicyBean convertASStubApplicationPolicyToApplicationPolicy(ApplicationPolicy applicationPolicy) {
+ public static ApplicationPolicyBean convertASStubApplicationPolicyToApplicationPolicy(
+ ApplicationPolicy applicationPolicy) {
if (applicationPolicy == null) {
return null;
@@ -498,7 +501,8 @@ public static ApplicationPolicyBean convertASStubApplicationPolicyToApplicationP
if (applicationPolicy.getProperties() != null) {
List propertyBeanList
= new ArrayList();
- for (org.apache.stratos.autoscaler.stub.Property stubProperty : applicationPolicy.getProperties().getProperties()) {
+ for (org.apache.stratos.autoscaler.stub.Property stubProperty :
+ applicationPolicy.getProperties().getProperties()) {
if (stubProperty != null) {
org.apache.stratos.common.beans.PropertyBean propertyBean
= new org.apache.stratos.common.beans.PropertyBean();
@@ -555,7 +559,8 @@ private static org.apache.stratos.autoscaler.stub.Properties getASPropertiesFrom
return properties;
}
- private static PartitionBean convertCCStubPartitionToPartition(org.apache.stratos.cloud.controller.stub.domain.Partition stubPartition) {
+ private static PartitionBean convertCCStubPartitionToPartition(
+ org.apache.stratos.cloud.controller.stub.domain.Partition stubPartition) {
if (stubPartition == null) {
return null;
@@ -793,7 +798,8 @@ public static PartitionBean[] populatePartitionPojos(org.apache.stratos.cloud.co
return partitionBeans;
}
- public static PartitionBean populatePartitionPojo(org.apache.stratos.cloud.controller.stub.domain.Partition partition) {
+ public static PartitionBean populatePartitionPojo(
+ org.apache.stratos.cloud.controller.stub.domain.Partition partition) {
PartitionBean partitionBeans = new PartitionBean();
if (partition == null) {
@@ -860,7 +866,8 @@ public static AutoscalePolicyBean convertStubAutoscalePolicyToAutoscalePolicy(
autoscalePolicyBean.setDisplayName(autoscalePolicy.getDisplayName());
autoscalePolicyBean.setDescription(autoscalePolicy.getDescription());
if (autoscalePolicy.getLoadThresholds() != null) {
- autoscalePolicyBean.setLoadThresholds(convertStubLoadThresholdsToLoadThresholds(autoscalePolicy.getLoadThresholds()));
+ autoscalePolicyBean.setLoadThresholds(convertStubLoadThresholdsToLoadThresholds(
+ autoscalePolicy.getLoadThresholds()));
}
return autoscalePolicyBean;
@@ -1011,7 +1018,8 @@ public static KubernetesClusterBean convertStubKubernetesClusterToKubernetesClus
kubernetesClusterBean.setClusterId(kubernetesCluster.getClusterId());
kubernetesClusterBean.setDescription(kubernetesCluster.getDescription());
kubernetesClusterBean.setPortRange(convertStubPortRangeToPortRange(kubernetesCluster.getPortRange()));
- kubernetesClusterBean.setKubernetesHosts(convertStubKubernetesHostsToKubernetesHosts(kubernetesCluster.getKubernetesHosts()));
+ kubernetesClusterBean.setKubernetesHosts(convertStubKubernetesHostsToKubernetesHosts(
+ kubernetesCluster.getKubernetesHosts()));
kubernetesClusterBean.setKubernetesMaster(convertStubKubernetesMasterToKubernetesMaster(
kubernetesCluster.getKubernetesMaster()));
kubernetesClusterBean.setProperty(convertCCStubPropertiesToPropertyBeans(kubernetesCluster.getProperties()));
@@ -1038,7 +1046,8 @@ public static List convertStubKubernetesHostsToKubernetesHos
return null;
}
List kubernetesHostList = new ArrayList();
- for (org.apache.stratos.cloud.controller.stub.domain.kubernetes.KubernetesHost kubernetesHost : kubernetesHosts) {
+ for (org.apache.stratos.cloud.controller.stub.domain.kubernetes.KubernetesHost kubernetesHost :
+ kubernetesHosts) {
kubernetesHostList.add(convertStubKubernetesHostToKubernetesHost(kubernetesHost));
}
return kubernetesHostList;
@@ -1119,12 +1128,14 @@ public static ApplicationContext convertApplicationDefinitionToStubApplicationCo
// top level dependency information
if (applicationDefinition.getComponents().getDependencies() != null) {
componentContext.setDependencyContext(
- convertDependencyDefinitionsToDependencyContexts(applicationDefinition.getComponents().getDependencies()));
+ convertDependencyDefinitionsToDependencyContexts(applicationDefinition.getComponents().
+ getDependencies()));
}
// top level cartridge context information
if (applicationDefinition.getComponents().getCartridges() != null) {
componentContext.setCartridgeContexts(
- convertCartridgeReferenceBeansToStubCartridgeContexts(applicationDefinition.getComponents().getCartridges()));
+ convertCartridgeReferenceBeansToStubCartridgeContexts(applicationDefinition.getComponents().
+ getCartridges()));
}
applicationContext.setComponents(componentContext);
}
@@ -1151,23 +1162,27 @@ public static ApplicationBean convertStubApplicationContextToApplicationDefiniti
// top level Groups
if (applicationContext.getComponents().getGroupContexts() != null) {
applicationDefinition.getComponents().setGroups(
- convertStubGroupContextsToGroupDefinitions(applicationContext.getComponents().getGroupContexts()));
+ convertStubGroupContextsToGroupDefinitions(applicationContext.getComponents().
+ getGroupContexts()));
}
// top level dependency information
if (applicationContext.getComponents().getDependencyContext() != null) {
applicationDefinition.getComponents().setDependencies(
- convertStubDependencyContextsToDependencyDefinitions(applicationContext.getComponents().getDependencyContext()));
+ convertStubDependencyContextsToDependencyDefinitions(applicationContext.getComponents().
+ getDependencyContext()));
}
// top level cartridge context information
if (applicationContext.getComponents().getCartridgeContexts() != null) {
applicationDefinition.getComponents().setCartridges(
- convertStubCartridgeContextsToCartridgeReferenceBeans(applicationContext.getComponents().getCartridgeContexts()));
+ convertStubCartridgeContextsToCartridgeReferenceBeans(applicationContext.getComponents().
+ getCartridgeContexts()));
}
}
return applicationDefinition;
}
- private static List convertStubGroupContextsToGroupDefinitions(GroupContext[] groupContexts) {
+ private static List convertStubGroupContextsToGroupDefinitions(
+ GroupContext[] groupContexts) {
List groupDefinitions = new ArrayList();
if (groupContexts != null) {
for (GroupContext groupContext : groupContexts) {
@@ -1177,7 +1192,8 @@ private static List convertStubGroupContextsToGroup
groupDefinition.setGroupMaxInstances(groupContext.getGroupMaxInstances());
groupDefinition.setGroupMinInstances(groupContext.getGroupMinInstances());
groupDefinition.setName(groupContext.getName());
- groupDefinition.setGroups(convertStubGroupContextsToGroupDefinitions(groupContext.getGroupContexts()));
+ groupDefinition.setGroups(convertStubGroupContextsToGroupDefinitions(
+ groupContext.getGroupContexts()));
groupDefinition.setCartridges(convertStubCartridgeContextsToCartridgeReferenceBeans(
groupContext.getCartridgeContexts()));
groupDefinitions.add(groupDefinition);
@@ -1187,7 +1203,8 @@ private static List convertStubGroupContextsToGroup
return groupDefinitions;
}
- private static DependencyBean convertStubDependencyContextsToDependencyDefinitions(DependencyContext dependencyContext) {
+ private static DependencyBean convertStubDependencyContextsToDependencyDefinitions(
+ DependencyContext dependencyContext) {
DependencyBean dependencyBean = new DependencyBean();
dependencyBean.setTerminationBehaviour(dependencyContext.getTerminationBehaviour());
@@ -1389,7 +1406,7 @@ private static SubscribableInfoContext convertSubscribableInfo(SubscribableInfo
infoContext.setDeploymentPolicy(subscribableInfo.getDeploymentPolicy());
infoContext.setMaxMembers(subscribableInfo.getMaxMembers());
infoContext.setMinMembers(subscribableInfo.getMinMembers());
- infoContext.setLvsVirtualIP(subscribableInfo.getLvsVirtualIP());
+ infoContext.setLvsVirtualIP(subscribableInfo.getLvsVirtualIP());
if (subscribableInfo.getArtifactRepository() != null) {
ArtifactRepositoryBean artifactRepository = subscribableInfo.getArtifactRepository();
@@ -1472,13 +1489,15 @@ private static DependencyContext convertDependencyDefinitionsToDependencyContext
dependencyContext.setStartupOrdersContexts(startupOrders.toArray(new String[startupOrders.size()]));
}
if (dependencyBean.getScalingDependents() != null) {
- List scalingDependents = convertScalingDependentsBeansToStringList(dependencyBean.getScalingDependents());
+ List scalingDependents = convertScalingDependentsBeansToStringList(
+ dependencyBean.getScalingDependents());
dependencyContext.setScalingDependents(scalingDependents.toArray(new String[scalingDependents.size()]));
}
return dependencyContext;
}
- private static List convertScalingDependentsBeansToStringList(List scalingDependentsBeans) {
+ private static List convertScalingDependentsBeansToStringList(
+ List scalingDependentsBeans) {
List scalingDependents = new ArrayList();
if (scalingDependentsBeans != null) {
for (ScalingDependentsBean scalingDependentsBean : scalingDependentsBeans) {
@@ -1519,7 +1538,8 @@ private static List convertScalingDependentsBeansToStringList(List scalingDependents = convertScalingDependentsBeansToStringList(dependencyBean.getScalingDependents());
+ List scalingDependents = convertScalingDependentsBeansToStringList(
+ dependencyBean.getScalingDependents());
dependencies.setScalingDependants(scalingDependents.toArray(new String[scalingDependents.size()]));
}
servicegroup.setDependencies(dependencies);
@@ -1920,7 +1941,8 @@ public static ApplicationSignUp convertApplicationSignUpBeanToStubApplicationSig
return applicationSignUp;
}
- public static ApplicationSignUpBean convertStubApplicationSignUpToApplicationSignUpBean(ApplicationSignUp applicationSignUp) {
+ public static ApplicationSignUpBean convertStubApplicationSignUpToApplicationSignUpBean(
+ ApplicationSignUp applicationSignUp) {
if (applicationSignUp == null) {
return null;
@@ -1971,7 +1993,8 @@ public static DomainMappingBean convertStubDomainMappingToDomainMappingBean(Doma
return domainMappingBean;
}
- public static DeploymentPolicyBean convertCCStubDeploymentPolicyToDeploymentPolicy(DeploymentPolicy deploymentPolicy) {
+ public static DeploymentPolicyBean convertCCStubDeploymentPolicyToDeploymentPolicy(
+ DeploymentPolicy deploymentPolicy) {
if (deploymentPolicy == null) {
return null;
@@ -1997,7 +2020,8 @@ public static ApplicationPolicy convertApplicationPolicyBeanToStubAppPolicy(
applicationPolicy.setNetworkPartitions(applicationPolicyBean.getNetworkPartitions());
if (applicationPolicyBean.getProperties() != null) {
if (!applicationPolicyBean.getProperties().isEmpty()) {
- applicationPolicy.setProperties(getASPropertiesFromCommonProperties(applicationPolicyBean.getProperties()));
+ applicationPolicy.setProperties(getASPropertiesFromCommonProperties(
+ applicationPolicyBean.getProperties()));
}
}
return applicationPolicy;
@@ -2038,7 +2062,8 @@ public static DeploymentPolicyBean[] convertASStubDeploymentPoliciesToDeployment
}
- private static DeploymentPolicyBean convertASStubDeploymentPolicyToDeploymentPolicy(DeploymentPolicy deploymentPolicy) {
+ private static DeploymentPolicyBean convertASStubDeploymentPolicyToDeploymentPolicy(
+ DeploymentPolicy deploymentPolicy) {
if (deploymentPolicy == null) {
return null;
diff --git a/components/org.apache.stratos.sso.redirector.ui/pom.xml b/components/org.apache.stratos.sso.redirector.ui/pom.xml
deleted file mode 100644
index fd04f53d53..0000000000
--- a/components/org.apache.stratos.sso.redirector.ui/pom.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
- org.apache.stratos
- stratos-components-parent
- 4.1.1
-
-
- 4.0.0
- org.apache.stratos.sso.redirector.ui
- bundle
- Apache Stratos - SSO redirector UI component
-
-
-
-
- org.apache.felix
- maven-scr-plugin
-
-
- org.apache.felix
- maven-bundle-plugin
-
- true
-
-
- ${project.artifactId}
- ${project.artifactId}
-
- org.apache.stratos.sso.redirector.ui.internal.*,
-
-
- javax.servlet;version="${imp.pkg.version.javax.servlet}",
- javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
- org.apache.lucene.*,
- *;resolution:=optional
-
- UIBundle
-
-
-
-
-
-
-
-
- org.wso2.carbon
- org.wso2.carbon.ui
- ${wso2carbon.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.identity.authenticator.saml2.sso.common
- ${wso2carbon.version}
-
-
-
-
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/java/org/apache/stratos/sso/redirector/ui/internal/RedirectorJSPFilter.java b/components/org.apache.stratos.sso.redirector.ui/src/main/java/org/apache/stratos/sso/redirector/ui/internal/RedirectorJSPFilter.java
deleted file mode 100644
index 1c7ef60d91..0000000000
--- a/components/org.apache.stratos.sso.redirector.ui/src/main/java/org/apache/stratos/sso/redirector/ui/internal/RedirectorJSPFilter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.stratos.sso.redirector.ui.internal;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-
-/**
- * This class acts as a servlet filter which forwads the requests coming for sso-acs/redirect_ajaxprocessor.jsp
- * to stratos-auth/redirect_ajaxprocessor.jsp
- */
-public class RedirectorJSPFilter implements Filter {
-
- public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
- FilterChain filterChain) throws IOException, ServletException {
- if (!(servletRequest instanceof HttpServletRequest)) {
- return;
- }
- String url = ((HttpServletRequest) servletRequest).getRequestURI();
- if(url.contains("//")){
- url = url.replace("//", "/");
- }
- url = url.replace("sso-acs/redirect_ajaxprocessor.jsp", "stratos-auth/redirect_ajaxprocessor.jsp");
- RequestDispatcher requestDispatcher =
- servletRequest.getRequestDispatcher(url);
- requestDispatcher.forward(servletRequest, servletResponse);
- }
-
- public void init(FilterConfig filterConfig) throws ServletException {
- // not required to implement
- }
-
- public void destroy() {
- // not required to implement
- }
-}
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/java/org/apache/stratos/sso/redirector/ui/internal/SSORedirectorServiceComponent.java b/components/org.apache.stratos.sso.redirector.ui/src/main/java/org/apache/stratos/sso/redirector/ui/internal/SSORedirectorServiceComponent.java
deleted file mode 100644
index 5f2521b1f3..0000000000
--- a/components/org.apache.stratos.sso.redirector.ui/src/main/java/org/apache/stratos/sso/redirector/ui/internal/SSORedirectorServiceComponent.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.stratos.sso.redirector.ui.internal;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.service.component.ComponentContext;
-
-import javax.servlet.Filter;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-/**
- * @scr.component name="org.apache.stratos.sso.redirector.ui"
- * immediate="true"
- */
-public class SSORedirectorServiceComponent {
- private static Log log = LogFactory.getLog(SSORedirectorServiceComponent.class);
-
- protected void activate(ComponentContext ctxt) {
-
- // register a servlet filter for SSO redirector page
- HttpServlet redirectJSPRedirectorServlet = new HttpServlet() {
- protected void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- }
- };
-
- Filter redirectPageFilter = new RedirectorJSPFilter();
- Dictionary redirectorPageFilterAttrs = new Hashtable(2);
- Dictionary redirectorPageFilterParams = new Hashtable(2);
- redirectorPageFilterParams.put("url-pattern", "/carbon/sso-acs/redirect_ajaxprocessor.jsp");
- redirectorPageFilterParams.put("associated-filter", redirectPageFilter);
- redirectorPageFilterParams.put("servlet-attributes", redirectorPageFilterAttrs);
- ctxt.getBundleContext().registerService(Servlet.class.getName(), redirectJSPRedirectorServlet,
- redirectorPageFilterParams);
- log.debug("Stratos SSO Redirector bundle is activated..");
- }
-
- protected void deactivate(ComponentContext ctxt) {
- log.debug("Stratos SSO Redirector bundle is deactivated..");
- }
-}
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/org/apache/stratos/sso/redirector/ui/i18n/Resources.properties b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/org/apache/stratos/sso/redirector/ui/i18n/Resources.properties
deleted file mode 100644
index 3c9dee1216..0000000000
--- a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/org/apache/stratos/sso/redirector/ui/i18n/Resources.properties
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-saml.sso.menu=SAML SSO
-saml.sso=SAML 2.0 based Single Sign-On
-enter.password.to.signin=Please enter your credentials to sign in to WSO2 Identity Server SAML SSO
-username=Username
-password=Password
-login=Sign In
-sso.configuration=SAML SSO Configuration
-sp.issuer=Issuer
-sp.assertionConsumerURL=Assertion Consumer URL
-sp.certAlias=Certificate Alias
-saml.sso.service.providers.not.found=No SAML SSO Service Providers are found.
-saml.sso.add.service.provider=Add new Service Provider
-saml.sso.add=Add
-sp.enter.valid.endpoint.address=Please enter a valid URL for AssertionConsumerURL
-sp.enter.valid.issuer=Please enter a valid issuer
-sp.enter.valid.claimID=ClaimID field cannot be left empty
-sp.added.successfully=Service Provider Added Successfully
-error.adding.sp=Could not add Service Provider. You might be entering a duplicate Service Provider
-remove.message1=You are about to remove the trusted service provider
-remove.message2=. Do you want to proceed?
-error.removing.sp=Problem in removing the service provider
-select.subject.type=Select the value to be appeared as the subject
-select.subject.type.username=Use current username as the subject
-select.subject.type.claimid=Use a custom claim as the subject
-subject.type.claimid=Claim ID
-subject.type.namidformat=NameID Format
-logout.url=Custom Logout URL
-validate.signature=Enable Signature Validation in Authentication Requests and Logout Requests
-saml.sso.generated.key=Generated Key for Signing SAML2 based single sign-on
-saml.sso.download.pub.key=Download the public key of the generated key pair
-saml.sso.add.sp.to.genkey=Add atleast one service provider to generate a key pair
-login.fail.message=Login failed! Please recheck the username and password and try again.
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/css/stratos-loginpage.css b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/css/stratos-loginpage.css
deleted file mode 100644
index 34d26049a4..0000000000
--- a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/css/stratos-loginpage.css
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-body {
-background-image:url(../images/st-login-body-bg.gif);
-background-position:left top;
-background-repeat:repeat-x;
-font-family:"Calibri",Arial,Helvetica,san-serif;
-font-size:0.8em;
-margin:0;
-padding:0;
-}
-p {
-}
-td {
-}
-a:link {
-text-decoration:none;
-}
-a:visited {
-}
-a:hover {
-}
-a:active {
-}
-a img {
-border:0 none;
-}
-div#middle {
-background-color:#FFFFFF;
-margin:auto;
-width:961px;
-}
-div#header {
-background-image:url(../images/st-login-header-bg.gif);
-background-position:left top;
-background-repeat:no-repeat;
-height:87px;
-padding-top:94px;
-text-align:center;
-}
-div#content {
-background-image:url(../images/st-login-content-bg.gif);
-background-position:left top;
-background-repeat:no-repeat;
-padding-left:60px;
-padding-right:60px;
-padding-top:20px;
-}
-div#intro {
-padding-bottom:10px;
-text-align:center;
-}
-div#register {
-float:left;
-padding-top:85px;
-text-align:center;
-width:420px;
-}
-div#sign-in {
-border-left:1px solid #0499CC;
-float:left;
-padding:20px 30px 30px 50px;
-text-align:left;
-width:340px;
-}
-div#sign-in h2 {
-border-bottom:1px solid #78BDE8;
-font-size:130%;
-margin-bottom:10px;
-margin-top:0;
-padding-bottom:10px;
-padding-top:0;
-}
-div#sign-in table tr td {
-padding-bottom:5px;
-padding-right:7px;
-}
-div#sign-in table {
-border-bottom:1px solid #78BDE8;
-margin-bottom:7px;
-}
-div#footer {
-background-image:url(../images/st-login-footer-bg.gif);
-background-position:left top;
-background-repeat:no-repeat;
-margin-top:5px;
-padding-bottom:7px;
-padding-top:25px;
-text-align:center;
-}
-div.clear {
-clear:both;
-}
-#loginForm td label{
- font-size:11px;
-}
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config-ok.png b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config-ok.png
deleted file mode 100644
index eab6259d48..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config-ok.png and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config.png b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config.png
deleted file mode 100644
index 994c861d90..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config.png and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-sso-config.png b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-sso-config.png
deleted file mode 100644
index 375e9ee1df..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-sso-config.png and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/delete.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/delete.gif
deleted file mode 100644
index 471f55c15f..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/delete.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/import.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/import.gif
deleted file mode 100644
index c9fb1df14b..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/import.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/loading.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/loading.gif
deleted file mode 100644
index 5b200ed4bb..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/loading.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/logo.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/logo.gif
deleted file mode 100644
index 837f813b75..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/logo.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/policy.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/policy.gif
deleted file mode 100644
index f9c58f5f82..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/policy.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/powered.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/powered.gif
deleted file mode 100644
index b8bc163f79..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/powered.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/register.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/register.gif
deleted file mode 100644
index f225e38f16..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/register.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/sso.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/sso.gif
deleted file mode 100644
index 7f2e74a8df..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/sso.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-body-bg.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-body-bg.gif
deleted file mode 100644
index dc2c240f92..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-body-bg.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-content-bg.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-content-bg.gif
deleted file mode 100644
index 9624125775..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-content-bg.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-footer-bg.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-footer-bg.gif
deleted file mode 100644
index dc317e5250..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-footer-bg.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-header-bg.gif b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-header-bg.gif
deleted file mode 100644
index bd228c9a52..0000000000
Binary files a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-header-bg.gif and /dev/null differ
diff --git a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/redirect_ajaxprocessor.jsp b/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/redirect_ajaxprocessor.jsp
deleted file mode 100644
index ac204c9f75..0000000000
--- a/components/org.apache.stratos.sso.redirector.ui/src/main/resources/web/stratos-auth/redirect_ajaxprocessor.jsp
+++ /dev/null
@@ -1,177 +0,0 @@
-<%--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- --%>
-<%@page import="org.opensaml.saml2.core.AuthnRequest" %>
-<%@page import="org.opensaml.saml2.core.LogoutRequest" %>
-<%@ page
- import="org.wso2.carbon.identity.authenticator.saml2.sso.common.SAML2SSOAuthenticatorConstants" %>
-<%@ page import="org.wso2.carbon.identity.authenticator.saml2.sso.common.SSOSessionManager" %>
-<%@ page
- import="org.wso2.carbon.identity.authenticator.saml2.sso.common.builders.AuthenticationRequestBuilder" %>
-<%@ page
- import="org.wso2.carbon.identity.authenticator.saml2.sso.common.builders.LogoutRequestBuilder" %>
-<%@ page
- import="org.wso2.carbon.identity.authenticator.saml2.sso.common.Util" %>
-<%@ page import="org.wso2.carbon.registry.core.utils.UUIDGenerator" %>
-<%@ page import="org.wso2.carbon.utils.multitenancy.MultitenantConstants" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-
-
- WSO2 Stratos Identity
-
-
-
-<%
- String encodedReq = null;
- String relayState = "";
- String domain = null;
- if (request.getParameter(SAML2SSOAuthenticatorConstants.LOG_OUT_REQ) != null) {
- LogoutRequestBuilder logoutRequestBuilder = new LogoutRequestBuilder();
- LogoutRequest logoutReq = logoutRequestBuilder.buildLogoutRequest((String) request.getAttribute(
- SAML2SSOAuthenticatorConstants.LOGGED_IN_USER), SAML2SSOAuthenticatorConstants.LOGOUT_USER);
- encodedReq = Util.encode(Util.marshall(logoutReq));
- relayState = UUIDGenerator.generateUUID();
- } else {
- AuthenticationRequestBuilder authnReqGenerator = new AuthenticationRequestBuilder();
- AuthnRequest authRequest = authnReqGenerator.buildAuthenticationRequest(null);
- encodedReq = Util.encode(Util.marshall(authRequest));
- relayState = UUIDGenerator.generateUUID();
- domain = (String) request.getAttribute(MultitenantConstants.TENANT_DOMAIN);
- }
- // add the relay state to Session Manager
- SSOSessionManager.addAuthnRequest(relayState);
-
-%>
-Loading WSO2 StratosLive...
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/components/org.apache.stratos.tenant.activity/pom.xml b/components/org.apache.stratos.tenant.activity/pom.xml
deleted file mode 100644
index e706592d3e..0000000000
--- a/components/org.apache.stratos.tenant.activity/pom.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
- org.apache.stratos
- stratos-components-parent
- 4.1.1
-
-
- 4.0.0
- org.apache.stratos.tenant.activity
- bundle
- Apache Stratos - TenantActivity
-
-
-
-
-
- org.apache.felix
- maven-scr-plugin
-
-
- org.codehaus.mojo
- build-helper-maven-plugin
-
-
- add-source
- generate-sources
-
- add-source
-
-
-
- target/generated-code/src
-
-
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
- 1.4.0
- true
-
-
- ${project.artifactId}
- ${project.artifactId}
-
- org.apache.stratos.tenant.activity.internal.*,
- org.apache.stratos.tenant.activity.services.*,
-
-
- org.apache.stratos.tenant.activity.api.*,
- org.apache.stratos.tenant.activity.util.*,
- org.apache.stratos.tenant.activity.beans.*,
- org.apache.stratos.tenant.activity.commands.*,
-
-
- !org.apache.stratos.tenanat.activity.stub.*,
- org.apache.stratos.common.*,
- org.wso2.carbon.cluster.mgt.core.*,
- !javax.xml.namespace,
- javax.xml.namespace; version=0.0.0,
- javax.servlet;version="${imp.pkg.version.javax.servlet}",
- javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
- org.apache.axiom.*; version="${axiom.wso2.version}",
- *;resolution:=optional
-
-
-
-
-
-
-
-
-
-
-
- org.apache.axis2.wso2
- axis2
- ${axis2.wso2.version}
-
-
-
-
- log4j
- log4j
-
-
- org.wso2.carbon
- org.wso2.carbon.registry.core
-
-
- commons-logging
- commons-logging
-
-
- org.wso2.carbon
- org.wso2.carbon.user.core
-
-
- org.wso2.carbon
- org.wso2.carbon.user.mgt
-
-
- org.apache.stratos
- org.apache.stratos.common
- ${project.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.cluster.mgt.core
- 4.2.0
-
-
-
diff --git a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/PaginatedTenantDataBean.java b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/PaginatedTenantDataBean.java
deleted file mode 100644
index c7ea51b1f2..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/PaginatedTenantDataBean.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.tenant.activity.beans;
-
-import org.wso2.carbon.utils.Pageable;
-
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Bean for paginated tenant information
- */
-public class PaginatedTenantDataBean implements Pageable, Serializable {
- private TenantDataBean[] tenantInfoBeans;
- private int numberOfPages;
-
- public TenantDataBean[] getTenantInfoBeans() {
- return tenantInfoBeans;
- }
-
- public void setTenantInfoBeans(TenantDataBean[] tenantInfoBeans) {
- if(tenantInfoBeans == null) {
- this.tenantInfoBeans = new TenantDataBean[0];
- } else {
- this.tenantInfoBeans = Arrays.copyOf(tenantInfoBeans, tenantInfoBeans.length);
- }
- }
-
- public int getNumberOfPages() {
- return numberOfPages;
- }
-
- public void setNumberOfPages(int numberOfPages) {
- this.numberOfPages = numberOfPages;
- }
-
- public void set(List items) {
- this.tenantInfoBeans = items.toArray(new TenantDataBean[items.size()]);
- }
-}
diff --git a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/TenantDataBean.java b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/TenantDataBean.java
deleted file mode 100644
index 422004414e..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/TenantDataBean.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package org.apache.stratos.tenant.activity.beans;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-import java.io.Serializable;
-
-/**
- * Represents a Tenant
- */
-@SuppressWarnings("unused")
-public class TenantDataBean implements Serializable {
-
- /**
- * The tenant Id
- */
- private int id;
-
- /**
- * The domain name of the tenant
- */
- private String domain;
-
- /**
- * The admin user name of the tenant
- */
- private String adminName;
-
- /**
- * The email address of the tenant
- */
- private String email;
-
- /**
- * Indicates whether this tenant is active or not
- */
- private boolean active;
-
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getAdminName() {
- return adminName;
- }
-
- public void setAdminName(String adminName) {
- this.adminName = adminName;
- }
-
- public String getDomain() {
- return domain;
- }
-
- public void setDomain(String domain) {
- this.domain = domain;
- }
-
- public boolean isActive() {
- return active;
- }
-
- public void setActive(boolean active) {
- this.active = active;
- }
-
-
-}
\ No newline at end of file
diff --git a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/commands/GetActiveTenantsInMemberRequest.java b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/commands/GetActiveTenantsInMemberRequest.java
deleted file mode 100644
index 394dd9a812..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/commands/GetActiveTenantsInMemberRequest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.tenant.activity.commands;
-
-import org.apache.axis2.clustering.ClusteringCommand;
-import org.apache.axis2.clustering.ClusteringMessage;
-import org.apache.axis2.clustering.ClusteringFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils;
-import org.apache.stratos.tenant.activity.beans.TenantDataBean;
-import org.wso2.carbon.user.api.Tenant;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This Cluster message is used to get active tenants in each node then
- * send response as other cluster command which holds active tenants
- */
-public class GetActiveTenantsInMemberRequest extends ClusteringMessage {
- private static final Log log = LogFactory.getLog(GetActiveTenantsInMemberRequest.class);
- private List tenants = new ArrayList();
-
- public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
- try {
- for (Tenant tenant : TenantAxisUtils.getActiveTenants(configurationContext)) {
- TenantDataBean tb = new TenantDataBean();
- tb.setDomain(tenant.getDomain());
- tenants.add(tb);
- }
- } catch (Exception e) {
- String msg = "Cannot get Active tenants";
- log.error(msg, e);
- throw new ClusteringFault(msg, e);
- }
- }
-
- public ClusteringCommand getResponse() {
- return new GetActiveTenantsInMemberResponse(tenants);
- }
-}
diff --git a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/commands/GetActiveTenantsInMemberResponse.java b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/commands/GetActiveTenantsInMemberResponse.java
deleted file mode 100644
index ec4dd490b1..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/commands/GetActiveTenantsInMemberResponse.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.tenant.activity.commands;
-
-import org.apache.axis2.clustering.ClusteringCommand;
-import org.apache.axis2.clustering.ClusteringFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.stratos.tenant.activity.beans.TenantDataBean;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * This clustering command is used send active tenants list if we send clustering message
- * GetActiveTenantsInMemberRequest then as a response we can get GetActiveTenantsInMemberResponse
- * which holds active tenants list
- */
-public class GetActiveTenantsInMemberResponse extends ClusteringCommand {
-
- private List tenants = new ArrayList();
-
- public GetActiveTenantsInMemberResponse(List tenantList) {
- tenants = tenantList;
- }
-
- public void addTenant(TenantDataBean tenant) {
- tenants.add(tenant);
- }
-
- public List getTenants() {
- return Collections.unmodifiableList(tenants);
- }
-
- @Override
- public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
- }
-}
diff --git a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/internal/TenantActivityServiceComponent.java b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/internal/TenantActivityServiceComponent.java
deleted file mode 100644
index 9485ef0496..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/internal/TenantActivityServiceComponent.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.tenant.activity.internal;
-
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.transport.local.LocalTransportReceiver;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.tenant.activity.util.Util;
-import org.osgi.service.component.ComponentContext;
-import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.utils.ConfigurationContextService;
-
-/**
- * @scr.component name="org.apache.stratos.tenant.activity" immediate="true"
- * @scr.reference name="registry.service"
- * interface="org.wso2.carbon.registry.core.service.RegistryService" cardinality="1..1"
- * policy="dynamic" bind="setRegistryService" unbind="unsetRegistryService"
- * @scr.reference name="user.realmservice.default"
- * interface="org.wso2.carbon.user.core.service.RealmService" cardinality="1..1"
- * policy="dynamic" bind="setRealmService" unbind="unsetRealmService"
- * @scr.reference name="config.context.service"
- * interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
- * policy="dynamic" bind="setConfigurationContextService" unbind="unsetConfigurationContextService"
- */
-public class TenantActivityServiceComponent {
- private static Log log = LogFactory.getLog(TenantActivityServiceComponent.class);
-
-
- protected void activate(ComponentContext context) {
- try {
- Util.registerRetrieverServices(context.getBundleContext());
- if(log.isDebugEnabled()){
- log.debug("******* Tenant Activity bundle is activated ******* ");
- }
- } catch (Exception e) {
- log.error("******* Error in activating Tenant Activity bundle ******* ", e);
- }
- }
-
- protected void deactivate(ComponentContext context) {
- if (log.isDebugEnabled()) {
- log.debug("******* Tenant Activity is deactivated ******* ");
- }
- }
-
- protected void setRegistryService(RegistryService registryService) {
- Util.setRegistryService(registryService);
- }
-
- protected void unsetRegistryService(RegistryService registryService) {
- Util.setRegistryService(null);
- }
-
- protected void setRealmService(RealmService realmService) {
- Util.setRealmService(realmService);
- }
-
- protected void unsetRealmService(RealmService realmService) {
- Util.setRealmService(null);
- }
-
- protected void setConfigurationContextService(ConfigurationContextService ccService) {
- ConfigurationContext serverCtx = ccService.getServerConfigContext();
- AxisConfiguration serverConfig = serverCtx.getAxisConfiguration();
- LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext(serverConfig);
- LocalTransportReceiver.CONFIG_CONTEXT.setServicePath("services");
- LocalTransportReceiver.CONFIG_CONTEXT.setContextRoot("local:/");
-
- Util.setConfigurationContextService(ccService);
- }
-
- protected void unsetConfigurationContextService(ConfigurationContextService ccService) {
- Util.setConfigurationContextService(null);
- }
-
-}
diff --git a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/services/TenantActivityService.java b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/services/TenantActivityService.java
deleted file mode 100644
index 2df63deb4e..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/services/TenantActivityService.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.stratos.tenant.activity.services;
-
-import org.apache.stratos.tenant.activity.util.Util;
-import org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils;
-import org.wso2.carbon.core.AbstractAdmin;
-import org.apache.stratos.tenant.activity.beans.PaginatedTenantDataBean;
-import org.apache.stratos.tenant.activity.beans.TenantDataBean;
-import org.apache.stratos.tenant.activity.util.TenantActivityUtil;
-import org.wso2.carbon.user.api.Tenant;
-import org.wso2.carbon.utils.DataPaginator;
-
-import java.util.*;
-
-/**
- * This service use to get active tenants related data.If its single node
- */
-public class TenantActivityService extends AbstractAdmin {
- List list = new ArrayList();
-
- public int getActiveTenantCount() throws Exception {
- return getAllActiveTenantList().size();
- }
-
- /**
- *
- * @return Active tenants list on service cluster
- * @throws Exception when error in retrieving active tenants list
- */
- private List getAllActiveTenantList() throws Exception {
- // ClusterMgtUtil cm = new ClusterMgtUtil();
- List list = new ArrayList();
- //This will add current node active tenants list to tenant list
- for (Tenant tenant : TenantAxisUtils.getActiveTenants(Util.getConfigurationContextService().getServerConfigContext())) {
- TenantDataBean tb = new TenantDataBean();
- tb.setDomain(tenant.getDomain());
- list.add(tb);
- }
- //if there are multiple nodes in clusters get active tenants from there as well
- for (TenantDataBean tenantDataBean : TenantActivityUtil.getActiveTenantsInCluster()) {
- if (TenantActivityUtil.indexOfTenantInList(list, tenantDataBean) < 0) {
- list.add(tenantDataBean);
- }
-
- }
- return list;
- }
-
- public PaginatedTenantDataBean retrievePaginatedActiveTenants(int pageNumber) throws Exception {
- List tenantList = getAllActiveTenantList();
- // Pagination
- PaginatedTenantDataBean paginatedTenantInfoBean = new PaginatedTenantDataBean();
- DataPaginator.doPaging(pageNumber, tenantList, paginatedTenantInfoBean);
- return paginatedTenantInfoBean;
- }
-
- public boolean isActiveTenantOnService(String domainName) throws Exception {
- boolean state = false;
- for (TenantDataBean tenant : getAllActiveTenantList()) {
- if (tenant.getDomain().equalsIgnoreCase(domainName)) {
- return true;
- }
- }
- return state;
- }
-}
\ No newline at end of file
diff --git a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/util/TenantActivityUtil.java b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/util/TenantActivityUtil.java
deleted file mode 100644
index ec8b389b47..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/util/TenantActivityUtil.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.tenant.activity.util;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.clustering.ClusteringAgent;
-import org.apache.axis2.clustering.ClusteringCommand;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.stratos.tenant.activity.commands.GetActiveTenantsInMemberRequest;
-import org.apache.stratos.tenant.activity.commands.GetActiveTenantsInMemberResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.tenant.activity.beans.TenantDataBean;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-public class TenantActivityUtil {
- private static final Log log = LogFactory.getLog(TenantActivityUtil.class);
-
- public static List getActiveTenantsInCluster() throws AxisFault {
- List tenants = new ArrayList();
- try {
- ClusteringAgent agent = getClusteringAgent();
- List list = agent.sendMessage(new GetActiveTenantsInMemberRequest(), true);
- if (log.isDebugEnabled()) {
- log.debug("sent cluster command to to get Active tenants on cluster");
- }
- for (ClusteringCommand command : list) {
- if (command instanceof GetActiveTenantsInMemberResponse) {
- GetActiveTenantsInMemberResponse response = (GetActiveTenantsInMemberResponse) command;
- for (TenantDataBean tenant : response.getTenants()) {
- tenants.add(tenant);
- }
- }
- }
-
- } catch (AxisFault f) {
- String msg = "Error in getting active tenant by cluster commands";
- log.error(msg, f);
- throw new AxisFault(msg);
- }
- return tenants;
- }
-
-
- private static ClusteringAgent getClusteringAgent() throws AxisFault {
-
- AxisConfiguration axisConfig =
- Util.getConfigurationContextService().getServerConfigContext().getAxisConfiguration();
- return axisConfig.getClusteringAgent();
- }
-
- public static int indexOfTenantInList(List list, TenantDataBean tenant) {
- for (int i = 0; i < list.size(); i++) {
- if (tenant.getDomain().equalsIgnoreCase(list.get(i).getDomain())) {
- return i;
- }
- }
- return -1;
- }
-}
\ No newline at end of file
diff --git a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/util/Util.java b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/util/Util.java
deleted file mode 100644
index 13a399e5e4..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/util/Util.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.tenant.activity.util;
-
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.framework.BundleContext;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.user.core.UserRealm;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.utils.ConfigurationContextService;
-
-/**
- * Util methods for usage.
- */
-public class Util {
-
- private static final Log log = LogFactory.getLog(Util.class);
-
- private static RegistryService registryService;
- private static RealmService realmService;
- private static ConfigurationContextService configurationContextService;
-
- public static synchronized void setRegistryService(RegistryService service) {
- registryService = service;
- }
-
- public static void setConfigurationContextService(
- ConfigurationContextService configurationContextService) {
- Util.configurationContextService = configurationContextService;
- }
-
- public static ConfigurationContextService getConfigurationContextService() {
- return configurationContextService;
- }
-
- public static synchronized void setRealmService(RealmService service) {
- realmService = service;
- }
-
- public static RealmService getRealmService() {
- return realmService;
- }
-
- public static RegistryService getRegistryService() {
- return registryService;
- }
-
- public static UserRealm getUserRealm(int tenantId) throws RegistryException {
- return registryService.getUserRealm(tenantId);
- }
-
- public static UserRegistry getSuperTenantGovernanceSystemRegistry() throws RegistryException {
- return registryService.getGovernanceSystemRegistry();
- }
-
- public static void registerRetrieverServices(BundleContext bundleContext) throws Exception {
- ConfigurationContextService configCtxSvc = Util.getConfigurationContextService();
-
-
- }
-
-}
diff --git a/components/org.apache.stratos.tenant.activity/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.tenant.activity/src/main/resources/META-INF/component.xml
deleted file mode 100644
index 29855c408a..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/resources/META-INF/component.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
- Monitor
- /permission/admin/monitor
-
-
- Tenant-Activity
- /permission/admin/monitor/tenantActivity
-
-
- Protected
- /permission/protected
-
-
- Monitor
- /permission/protected/monitor
-
-
-
diff --git a/components/org.apache.stratos.tenant.activity/src/main/resources/META-INF/services.xml b/components/org.apache.stratos.tenant.activity/src/main/resources/META-INF/services.xml
deleted file mode 100644
index a33bdc3402..0000000000
--- a/components/org.apache.stratos.tenant.activity/src/main/resources/META-INF/services.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
- https
-
-
- org.apache.stratos.tenant.activity.services.TenantActivityService
-
-
- true
- /permission/protected/monitor/tenantActivity
-
-
- true
- /permission/protected/monitor/tenantActivity
-
-
- true
- /permission/protected/monitor/tenantActivity
-
-
- true
- true
-
diff --git a/components/pom.xml b/components/pom.xml
index cfa7d23041..7369775c95 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -17,63 +17,38 @@
specific language governing permissions and limitations
under the License.
-->
-
-
+ 4.0.0
org.apache.stratos
stratos-parent
- 4.1.1
- ../pom.xml
+ 4.1.2-SNAPSHOT
- 4.0.0
stratos-components-parent
pom
Apache Stratos - Components
- http://apache.org
+ Apache Stratos - Aggregator pom for Components
-
org.apache.stratos.common
-
org.apache.stratos.messaging
-
org.apache.stratos.autoscaler
-
org.apache.stratos.cloud.controller
org.apache.stratos.kubernetes.client
-
org.apache.stratos.manager
- org.apache.stratos.deployment
-
org.apache.stratos.cli
-
org.apache.stratos.python.cartridge.agent
-
org.apache.stratos.cartridge.agent
-
org.apache.stratos.load.balancer.common
org.apache.stratos.load.balancer
org.apache.stratos.load.balancer.extension.api
-
- org.apache.stratos.tenant.activity
-
- org.apache.stratos.email.sender
-
-
- org.apache.stratos.sso.redirector.ui
-
- org.apache.stratos.logging.view.ui
-
org.apache.stratos.rest.endpoint
-
org.apache.stratos.manager.styles
org.apache.stratos.custom.handlers
org.apache.stratos.metadata.service
org.apache.stratos.metadata.client
-
org.apache.stratos.mock.iaas
org.apache.stratos.mock.iaas.api
org.apache.stratos.mock.iaas.client
@@ -84,7 +59,6 @@
org.codehaus.mojo
build-helper-maven-plugin
- 1.7
org.apache.maven.plugins
@@ -105,8 +79,6 @@
org.apache.maven.plugins
maven-surefire-plugin
-
- 2.13
@@ -118,172 +90,6 @@
-
-
-
- org.codehaus.sonar-plugins.java
- sonar-jacoco-listeners
- 1.2
- test
-
-
-
-
-
-
-
- org.eclipse.osgi
- org.eclipse.osgi
- ${version.equinox.osgi}
-
-
- org.eclipse.osgi
- org.eclipse.osgi.services
- ${version.equinox.osgi.services}
-
-
-
-
- org.wso2.carbon
- org.wso2.carbon.logging
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.core
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.core.services
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.application.deployer
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.feature.mgt.core
-
-
- org.wso2.carbon
- org.wso2.carbon.feature.mgt.services
-
-
-
-
- org.wso2.carbon
- org.wso2.carbon.server
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.server.admin.common
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.server.admin.ui
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.base
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.registry.core
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.user.core
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.user.mgt
- ${carbon.platform.version}
-
-
- org.wso2.carbon
- org.wso2.carbon.utils
- ${carbon.platform.version}
-
-
-
-
- org.apache.axis2.wso2
- axis2
- ${axis2.wso2.version}
-
-
-
-
-
- org.wso2.carbon
- org.wso2.carbon.registry.ws.client
- ${carbon.platform.version}
-
-
-
-
- log4j
- log4j
- ${version.log4j}
-
-
- commons-logging
- commons-logging
- ${version.commons.logging}
-
-
-
-
- org.wso2.carbon
- org.wso2.carbon.autoscaler.service.jvm.agentmgt.stub
- ${carbon.platform.version}
-
-
-
-
- junit
- junit
- ${junit.version}
- test
-
-
-
-
-
- UTF-8
- 4.2.0
- 4.11
- 2.1.1-wso2v4
- 12.0.0.wso2v1
- 4.2.0
- 3.3.100.v20120522-1822
- 3.8.1.v20120830-144521
- [1.2.11.wso2v4, 1.3.0)
- 7.0.34
- 1.6.1.wso2v10
- 1.6.1-wso2v10
- 1.2.17
- 1.1.1
- 1.1.0.wso2v1
- 3.0.wso2v1
- 3.0.1
- 2.0.0.wso2v1
- 1.2.11.wso2v4
- 1.6.1.wso2v5
- 1.2.11.wso2v3
- 2.0.4.wso2v4
- [2.6.0, 3.0.0)
- 1.6.1.wso2v9
-
\ No newline at end of file
diff --git a/dependencies/fabric8/kubernetes-api/pom.xml b/dependencies/fabric8/kubernetes-api/pom.xml
index bc967d0a7d..b12c3d3752 100644
--- a/dependencies/fabric8/kubernetes-api/pom.xml
+++ b/dependencies/fabric8/kubernetes-api/pom.xml
@@ -16,167 +16,164 @@
permissions and limitations under the License.
-->
-
- 4.0.0
+
+ 4.0.0
+
+ org.apache.stratos
+ stratos-dependencies-fabric8
+ 4.1.2-SNAPSHOT
+
-
- org.apache.stratos
- stratos-dependencies-fabric8
- 4.1.1
- ../pom.xml
-
+ kubernetes-api
+ 2.2.16
+ bundle
+ Fabric8 :: Kubernetes API
+
+ This is a wrapper bundle for Fabric8 Kubernetes API for exposing proper bundle import
+ & export statements and packaging apache cxf dependencies which cannot be imported into
+ carbon runtime as separate bundles at the moment.
+
- kubernetes-api
- 2.2.16-stratosv1
- bundle
+
+
+ io.fabric8
+ kubernetes-api
+ ${kubernetes.api.version}
+
+
+ io.fabric8
+ cxf-utils
+ ${kubernetes.api.version}
+
+
+ io.fabric8
+ kubernetes-model
+ 1.0.2
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-json-provider
+ 2.4.1
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+ 2.4.1
+
+
+ org.apache.cxf
+ cxf-rt-rs-client
+ 3.0.4
+
+
+ org.slf4j
+ slf4j-api
+ 1.7.12
+
+
+ org.yaml
+ snakeyaml
+ 1.5
+
+
+ org.json
+ json
+ 20140107
+
+
+ net.oauth.core
+ oauth
+ 20100527
+
+
+ dnsjava
+ dnsjava
+ 2.1.7
+
+
+ org.eclipse.jetty.websocket
+ websocket-client
+ 9.1.5.v20140505
+
+
+ org.eclipse.jetty
+ jetty-io
+ 9.1.5.v20140505
+
+
+ org.eclipse.jetty
+ jetty-util
+ 9.1.5.v20140505
+
+
+
+ org.assertj
+ assertj-core
+ 1.7.0
+ test
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.7.12
+ test
+
+
+
+ io.fabric8
+ kubernetes-codegen
+ ${kubernetes.api.version}
+ test
+
+
- Fabric8 :: Kubernetes API
-
- This is a wrapper bundle for Fabric8 Kubernetes API for exposing proper bundle import
- & export statements and packaging apache cxf dependencies which cannot be imported into
- carbon runtime as separate bundles at the moment.
-
-
-
-
- io.fabric8
- kubernetes-api
- ${kubernetes.api.version}
-
-
- io.fabric8
- cxf-utils
- ${kubernetes.api.version}
-
-
- io.fabric8
- kubernetes-model
- 1.0.2
-
-
- com.fasterxml.jackson.jaxrs
- jackson-jaxrs-json-provider
- 2.4.1
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-yaml
- 2.4.1
-
-
- org.apache.cxf
- cxf-rt-rs-client
- 3.0.4
-
-
- org.slf4j
- slf4j-api
- 1.7.12
-
-
- org.yaml
- snakeyaml
- 1.5
-
-
- org.json
- json
- 20140107
-
-
- net.oauth.core
- oauth
- 20100527
-
-
- dnsjava
- dnsjava
- 2.1.7
-
-
- org.eclipse.jetty.websocket
- websocket-client
- 9.1.5.v20140505
-
-
- org.eclipse.jetty
- jetty-io
- 9.1.5.v20140505
-
-
- org.eclipse.jetty
- jetty-util
- 9.1.5.v20140505
-
-
-
- org.assertj
- assertj-core
- 1.7.0
- test
-
-
- org.slf4j
- slf4j-log4j12
- 1.7.12
- test
-
-
-
- io.fabric8
- kubernetes-codegen
- ${kubernetes.api.version}
- test
-
-
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
- true
- 2.3.7
-
-
- ${project.groupId}.${project.artifactId}
-
- io.fabric8.kubernetes.api.*;version=${kubernetes.api.stratos.version},
- io.fabric8.kubernetes.api.model.*;version=${kubernetes.api.stratos.version},
- io.fabric8.kubernetes.internal.*,
-
-
- !javax.xml.bind.annotation.adapters,
- org.osgi.framework,
- *;resolution:=optional
-
- *
-
- jackson-annotations,jackson-core,jackson-databind,jackson-jaxrs-base,jackson-jaxrs-json-provider,
- jackson-module-jaxb-annotations,jackson-dataformat-yaml,javax.annotation-api,javax.ws.rs-api,
- jetty-io,jetty-util,json,oauth,xmlschema-core,fabric8-utils,cxf-utils,
- cxf-rt-rs-client,cxf-rt-transports-http,cxf-rt-frontend-jaxrs,cxf-core,dnsjava
-
- true
-
-
-
-
- org.codehaus.mojo
- exec-maven-plugin
- 1.2.1
-
-
-
- java
-
-
-
-
- io.fabric8.kubernetes.api.Example
- test
-
-
-
-
-
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+ false
+ true
+
+
+ ${project.groupId}.${project.artifactId}
+ ${project.artifactId}
+
+ io.fabric8.kubernetes.api.*;version=${kubernetes.api.version},
+ io.fabric8.kubernetes.api.model.*;version=${kubernetes.api.version},
+ io.fabric8.kubernetes.internal.*
+
+
+ !javax.xml.bind.annotation.adapters,
+ *;resolution:=optional
+
+ *
+
+ jackson-annotations,jackson-core,jackson-databind,jackson-jaxrs-base,jackson-jaxrs-json-provider,
+ jackson-module-jaxb-annotations,jackson-dataformat-yaml,javax.annotation-api,javax.ws.rs-api,
+ jetty-io,jetty-util,json,oauth,xmlschema-core,fabric8-utils,cxf-utils,
+ cxf-rt-rs-client,cxf-rt-transports-http,cxf-rt-frontend-jaxrs,cxf-core,dnsjava
+
+ true
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+
+
+ java
+
+
+
+
+ io.fabric8.kubernetes.api.Example
+ test
+
+
+
+
+
\ No newline at end of file
diff --git a/dependencies/fabric8/pom.xml b/dependencies/fabric8/pom.xml
index adef03f8a0..6e01c932ea 100644
--- a/dependencies/fabric8/pom.xml
+++ b/dependencies/fabric8/pom.xml
@@ -18,16 +18,15 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
-
+
+ 4.0.0
org.apache.stratos
stratos-dependents
- 4.1.1
- ../pom.xml
+ 4.1.2-SNAPSHOT
- 4.0.0
stratos-dependencies-fabric8
pom
Fabric8
@@ -36,19 +35,4 @@
kubernetes-api
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
- UTF-8
- 1.7
- 1.7
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/dependencies/guice-assistedinject/pom.xml b/dependencies/guice-assistedinject/pom.xml
new file mode 100644
index 0000000000..ac4c97bb2d
--- /dev/null
+++ b/dependencies/guice-assistedinject/pom.xml
@@ -0,0 +1,65 @@
+
+
+
+ 4.0.0
+
+ org.apache.stratos
+ stratos-dependents
+ 4.1.2-SNAPSHOT
+
+
+ guice-assistedinject
+ bundle
+ Guice Assistedinject
+ 3.0
+ This bundle will expose com.google.inject.assistedinject
+
+
+
+ com.google.inject.extensions
+ guice-assistedinject
+ ${guice.assistedinject.version}
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+ true
+
+
+ ${project.artifactId}
+ ${project.artifactId}
+ com.google.inject.assistedinject; version="${guice.assistedinject.version}"
+
+
+ !com.google.inject.assistedinject.*,
+ com.google.inject.*;version="${guice.imp.pkg.version}",
+ *;resolution:=optional
+
+ *
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependencies/guice-multibindings/pom.xml b/dependencies/guice-multibindings/pom.xml
new file mode 100644
index 0000000000..de1b391a98
--- /dev/null
+++ b/dependencies/guice-multibindings/pom.xml
@@ -0,0 +1,63 @@
+
+
+
+ 4.0.0
+
+ org.apache.stratos
+ stratos-dependents
+ 4.1.2-SNAPSHOT
+
+
+ guice-multibindings
+ bundle
+ Google Guice - Extensions - MultiBindings
+ 3.0
+ This bundle will expose com.google.inject.multibindings
+
+
+
+ com.google.inject.extensions
+ guice-multibindings
+ ${guice.multibindings.version}
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+ true
+
+
+ ${project.artifactId}
+ ${project.artifactId}
+ com.google.inject.multibindings; version="${guice.multibindings.version}"
+
+
+ *;resolution:=optional
+
+ *
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependencies/guice/pom.xml b/dependencies/guice/pom.xml
new file mode 100644
index 0000000000..341b2e3a0d
--- /dev/null
+++ b/dependencies/guice/pom.xml
@@ -0,0 +1,65 @@
+
+
+
+ 4.0.0
+
+ org.apache.stratos
+ stratos-dependents
+ 4.1.2-SNAPSHOT
+
+
+ guice
+ bundle
+ Guice
+ 3.0
+ This OSGi bundle wraps guice 3.0 jar files.
+
+
+
+ com.google.inject
+ guice
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+ true
+
+
+ ${project.artifactId}
+ ${project.artifactId}
+ com.google.inject*;version="${guice.version}";-split-package:=merge-first
+
+
+ javax.inject;version="${javax.inject.imp.pkg.version}",
+ org.aopalliance*;version="${aopalliance.imp.pkg.version}",
+ com.google.inject.internal.asm.util.*;resolution:=optional,
+ *;resolution:=optional
+
+ *
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/README.txt b/dependencies/jclouds/apis/gce/1.8.1-stratos/README.txt
deleted file mode 100644
index 0801104ebb..0000000000
--- a/dependencies/jclouds/apis/gce/1.8.1-stratos/README.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-======
-Stratos GCE provider 1.8.1
-======
-
-This code in Stratos is copied from Jclouds GCE [1]
-The jclouds GCE code has 2 directories oauth & google-compute-engine
-In Stratos, these two directories are mered into one.
-
-[1] https://github.com/jclouds/jclouds-labs-google/tree/jclouds-labs-google-1.8.1
-
-
-
-
-======
-jclouds Google Compute Engine Provider
-======
-
-
-Authenticating into the instances:
---------
-
-User:
-If no user is provided in GoogleComputeEngineTemplateOptions when launching an instance by default "jclouds" is used.
-
-Credential:
-
-GCE uses exclusively ssh keys to login into instances.
-In order for an instance to be sshable a public key must be installed. Public keys are installed if they are present in the project or instance's metatada.
-
-For an instance to be ssable one of the following must happen:
-1 - the project's metadata has an adequately built "sshKeys" entry and a corresponding private key is provided in GoogleComputeEngineTemplateOptions when createNodesInGroup is called.
-2 - an instance of GoogleComputeEngineTemplateOptions with an adequate public and private key is provided.
-
-NOTE: if methods 2 is chosen the global project keys will not be installed in the instance.
-
-Please refer to Google's documentation on how to form valid project wide ssh keys metadata entries.
-
-FAQ:
---------
-
-* Q. What is the identity for GCE?
-
-A. the identity is the developer email which can be obtained from the admin GUI. Its usually something in the form: @developer.gserviceaccount.com
-
-* Q. What is the credential for GCE
-
-A. the credential is a private key, in pem format. It can be extracted from the p12 keystore that is obtained when creating a "Service Account" (in the GUI: Google apis console > Api Access > Create another client ID > "Service Account"
-
-* Q. How to convert a p12 keystore into a pem format jclouds Google Compute Engine can handle:
-
-A.
-
-1. Convert the p12 file into pem format (it will ask for the keystore password, which is usually "notasecret"):
- openssl pkcs12 -in .p12 -out .pem -nodes
-
-2. Extract only the pk and remove passphrase
- openssl rsa -in .pem -out .pem
-
-The last file (.pem) should contain the pk that needs to be passed to `ContextBuilder.credential()` for the provider `google-compute-engine`.
-
-
-Running the live tests:
---------
-
-1. Place the following in your ~/.m2/settings.xml in a profile enabled when live:
-```
- YOUR_ACCOUNT_NUMBER@developer.gserviceaccount.com
- -----BEGIN RSA PRIVATE KEY-----
-MIICXgIBAAKBgQRRbRqVDtJLN1MO/xJoKqZuphDeBh5jIKueW3aNIiWs1XFcct+h
--- this text is literally from your .pem
-aH7xmpHSTbbXmQkuuv+z8EKijigprd/FoJpTX1f5/R+4wQ==
------END RSA PRIVATE KEY-----
-
-```
-
-2. mvn clean install -Plive
-
diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/pom.xml b/dependencies/jclouds/apis/gce/1.8.1-stratos/pom.xml
deleted file mode 100644
index c1a7b9d653..0000000000
--- a/dependencies/jclouds/apis/gce/1.8.1-stratos/pom.xml
+++ /dev/null
@@ -1,144 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.jclouds.labs
- jclouds-labs-google
- 1.8.1
-
-
-
- org.apache.stratos
- gce
- 1.8.1-stratosv1
- jclouds Google Compute Engine provider
- jclouds components to access GoogleCompute
- bundle
-
-
- 1.8.1
- Email associated with the Google API client_id
-
- Private key (PKCS12 file) associated with the Google API client_id
-
- v1
-
- imageId=debian-7-wheezy-v20131120,locationId=us-central1-a,minRam=2048
-
- org.jclouds.googlecomputeengine*;version="${project.version}"
-
- org.jclouds.compute.internal;version="${jclouds.version}",
- org.jclouds.rest.internal;version="${jclouds.version}",
- org.jclouds*;version="${jclouds.version}",
- *
-
-
-
-
-
- org.apache.jclouds
- jclouds-core
- ${jclouds.version}
-
-
- org.apache.jclouds
- jclouds-compute
- ${jclouds.version}
-
-
- org.apache.jclouds
- jclouds-compute
- ${jclouds.version}
- test-jar
- test
-
-
- org.apache.jclouds
- jclouds-core
- ${jclouds.version}
- test-jar
- test
-
-
- org.apache.jclouds.driver
- jclouds-slf4j
- ${jclouds.version}
- test
-
-
- org.apache.jclouds.driver
- jclouds-sshj
- ${jclouds.version}
- test
-
-
- ch.qos.logback
- logback-classic
- test
-
-
-
-
- live
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- default-test
-
- true
-
-
-
- integration
- integration-test
-
- test
-
-
-
- ${test.google-compute-engine.identity}
-
-
- ${test.google-compute-engine.credential}
-
-
- ${test.google-compute-engine.api-version}
-
-
- ${test.google-compute-engine.build-version}
-
- ${test.google-compute-engine.template}
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java
deleted file mode 100644
index 6440d91ca0..0000000000
--- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine;
-
-import java.io.Closeable;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-import org.jclouds.googlecomputeengine.features.AddressApi;
-import org.jclouds.googlecomputeengine.features.DiskApi;
-import org.jclouds.googlecomputeengine.features.FirewallApi;
-import org.jclouds.googlecomputeengine.features.GlobalOperationApi;
-import org.jclouds.googlecomputeengine.features.ImageApi;
-import org.jclouds.googlecomputeengine.features.InstanceApi;
-import org.jclouds.googlecomputeengine.features.MachineTypeApi;
-import org.jclouds.googlecomputeengine.features.NetworkApi;
-import org.jclouds.googlecomputeengine.features.ProjectApi;
-import org.jclouds.googlecomputeengine.features.RegionApi;
-import org.jclouds.googlecomputeengine.features.RegionOperationApi;
-import org.jclouds.googlecomputeengine.features.RouteApi;
-import org.jclouds.googlecomputeengine.features.SnapshotApi;
-import org.jclouds.googlecomputeengine.features.ZoneApi;
-import org.jclouds.googlecomputeengine.features.ZoneOperationApi;
-import org.jclouds.rest.annotations.Delegate;
-
-import com.google.common.annotations.Beta;
-
-
-/**
- * Provides access to GoogleCompute.
- *
- *
- * @see api doc
- */
-@Beta
-public interface GoogleComputeEngineApi extends Closeable {
-
- /**
- * Provides access to Address features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- AddressApi getAddressApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Disk features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- DiskApi getDiskApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Firewall features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- FirewallApi getFirewallApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Global Operation features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- GlobalOperationApi getGlobalOperationApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Image features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- ImageApi getImageApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Instance features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- InstanceApi getInstanceApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to MachineType features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- MachineTypeApi getMachineTypeApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Network features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- NetworkApi getNetworkApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Project features
- */
- @Delegate
- ProjectApi getProjectApi();
-
- /**
- * Provides access to Region features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- RegionApi getRegionApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Region Operation features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- RegionOperationApi getRegionOperationApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Route features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- RouteApi getRouteApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Snapshot features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- SnapshotApi getSnapshotApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Zone features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- ZoneApi getZoneApiForProject(@PathParam("project") String projectName);
-
- /**
- * Provides access to Zone Operation features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- ZoneOperationApi getZoneOperationApiForProject(@PathParam("project") String projectName);
-
-}
diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java
deleted file mode 100644
index 544a8511ce..0000000000
--- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine;
-
-import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
-import static org.jclouds.compute.config.ComputeServiceProperties.TEMPLATE;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_PROVIDER_NAME;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_INTERVAL;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_TIMEOUT;
-import static org.jclouds.oauth.v2.config.OAuthProperties.AUDIENCE;
-import static org.jclouds.oauth.v2.config.OAuthProperties.SIGNATURE_OR_MAC_ALGORITHM;
-import static org.jclouds.reflect.Reflection2.typeToken;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.googlecomputeengine.compute.config.GoogleComputeEngineServiceContextModule;
-import org.jclouds.googlecomputeengine.config.GoogleComputeEngineHttpApiModule;
-import org.jclouds.googlecomputeengine.config.GoogleComputeEngineParserModule;
-import org.jclouds.googlecomputeengine.config.OAuthModuleWithoutTypeAdapters;
-import org.jclouds.oauth.v2.config.OAuthAuthenticationModule;
-import org.jclouds.rest.internal.BaseHttpApiMetadata;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-/**
- * Implementation of {@link ApiMetadata} for GoogleCompute v1 API
- */
-public class GoogleComputeEngineApiMetadata extends BaseHttpApiMetadata {
-
- @Override
- public Builder toBuilder() {
- return new Builder().fromApiMetadata(this);
- }
-
- public GoogleComputeEngineApiMetadata() {
- this(new Builder());
- }
-
- protected GoogleComputeEngineApiMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = BaseHttpApiMetadata.defaultProperties();
- properties.put("oauth.endpoint", "https://accounts.google.com/o/oauth2/token");
- properties.put(AUDIENCE, "https://accounts.google.com/o/oauth2/token");
- properties.put(SIGNATURE_OR_MAC_ALGORITHM, "RS256");
- properties.put(PROPERTY_SESSION_INTERVAL, 3600);
- properties.setProperty(TEMPLATE, "osFamily=DEBIAN,osVersionMatches=7\\..*,locationId=us-central1-a,loginUser=jclouds");
- properties.put(OPERATION_COMPLETE_INTERVAL, 500);
- properties.put(OPERATION_COMPLETE_TIMEOUT, 600000);
- return properties;
- }
-
- public static class Builder extends BaseHttpApiMetadata.Builder {
-
- protected Builder() {
- id(GCE_PROVIDER_NAME)
- .name("Google Compute Engine Api")
- .identityName("Email associated with the Google API client_id")
- .credentialName("Private key literal associated with the Google API client_id")
- .documentation(URI.create("https://developers.google.com/compute/docs"))
- .version("v1")
- .defaultEndpoint("https://www.googleapis.com/compute/v1")
- .defaultProperties(GoogleComputeEngineApiMetadata.defaultProperties())
- .view(typeToken(ComputeServiceContext.class))
- .defaultModules(ImmutableSet.>builder()
- .add(GoogleComputeEngineHttpApiModule.class)
- .add(GoogleComputeEngineParserModule.class)
- .add(OAuthAuthenticationModule.class)
- .add(OAuthModuleWithoutTypeAdapters.class)
- .add(GoogleComputeEngineServiceContextModule.class)
- .build());
- }
-
- @Override
- public GoogleComputeEngineApiMetadata build() {
- return new GoogleComputeEngineApiMetadata(this);
- }
-
- @Override
- protected Builder self() {
- return this;
- }
- }
-}
diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java
deleted file mode 100644
index d20ff98793..0000000000
--- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine;
-
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LocationBuilder;
-import org.jclouds.domain.LocationScope;
-
-import com.google.common.annotations.Beta;
-
-public final class GoogleComputeEngineConstants {
-
- public static final String GCE_PROVIDER_NAME = "google-compute-engine";
-
- /**
- * The name of the project that keeps public resources.
- */
- public static final String GOOGLE_PROJECT = "google";
-
- public static final String CENTOS_PROJECT = "centos-cloud";
-
- public static final String DEBIAN_PROJECT = "debian-cloud";
-
- public static final String COMPUTE_SCOPE = "https://www.googleapis.com/auth/compute";
-
- public static final String COMPUTE_READONLY_SCOPE = "https://www.googleapis.com/auth/compute.readonly";
-
- public static final String STORAGE_READONLY_SCOPE = "https://www.googleapis.com/auth/devstorage.read_only";
-
- public static final String STORAGE_WRITEONLY_SCOPE = "https://www.googleapis.com/auth/devstorage.write_only";
-
-
- /**
- * The total time, in msecs, to wait for an operation to complete.
- */
- @Beta
- public static final String OPERATION_COMPLETE_TIMEOUT = "jclouds.google-compute-engine.operation-complete-timeout";
-
- /**
- * The interval, in msecs, between calls to check whether an operation has completed.
- */
- @Beta
- public static final String OPERATION_COMPLETE_INTERVAL = "jclouds.google-compute-engine.operation-complete-interval";
-
- public static final Location GOOGLE_PROVIDER_LOCATION = new LocationBuilder().scope(LocationScope.PROVIDER).id
- (GCE_PROVIDER_NAME).description(GCE_PROVIDER_NAME).build();
-
-
- /**
- * The key we look for in instance metadata for the URI for the image the instance was created from.
- */
- public static final String GCE_IMAGE_METADATA_KEY = "jclouds-image";
-
- /**
- * Metadata key to check for whether we should delete an instance's boot disk when we delete the instance.
- */
- public static final String GCE_DELETE_BOOT_DISK_METADATA_KEY = "jclouds-delete-boot-disk";
-
- /**
- * The suffix we append to auto-created boot disk names.
- */
- public static final String GCE_BOOT_DISK_SUFFIX = "boot-disk";
-
- private GoogleComputeEngineConstants() {
- throw new AssertionError("intentionally unimplemented");
- }
-}
diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineService.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineService.java
deleted file mode 100644
index 3c140eb2df..0000000000
--- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineService.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.compute;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_RUNNING;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_SUSPENDED;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_TERMINATED;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_INTERVAL;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_TIMEOUT;
-import static org.jclouds.util.Predicates2.retry;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Provider;
-
-import org.jclouds.Constants;
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.compute.callables.RunScriptOnNode;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.TemplateBuilder;
-import org.jclouds.compute.extensions.ImageExtension;
-import org.jclouds.compute.extensions.SecurityGroupExtension;
-import org.jclouds.compute.functions.GroupNamingConvention;
-import org.jclouds.compute.internal.BaseComputeService;
-import org.jclouds.compute.internal.PersistNodeCredentials;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.compute.strategy.CreateNodesInGroupThenAddToSet;
-import org.jclouds.compute.strategy.DestroyNodeStrategy;
-import org.jclouds.compute.strategy.GetImageStrategy;
-import org.jclouds.compute.strategy.GetNodeMetadataStrategy;
-import org.jclouds.compute.strategy.InitializeRunScriptOnNodeOrPlaceInBadMap;
-import org.jclouds.compute.strategy.ListNodesStrategy;
-import org.jclouds.compute.strategy.RebootNodeStrategy;
-import org.jclouds.compute.strategy.ResumeNodeStrategy;
-import org.jclouds.compute.strategy.SuspendNodeStrategy;
-import org.jclouds.domain.Credentials;
-import org.jclouds.domain.Location;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions;
-import org.jclouds.googlecomputeengine.config.UserProject;
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.domain.Network;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.features.FirewallApi;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.scriptbuilder.functions.InitAdminAccess;
-
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.collect.Sets;
-import com.google.common.util.concurrent.Atomics;
-import com.google.common.util.concurrent.ListeningExecutorService;
-
-public class GoogleComputeEngineService extends BaseComputeService {
-
- private final Function, Set> findOrphanedGroups;
- private final GroupNamingConvention.Factory namingConvention;
- private final GoogleComputeEngineApi api;
- private final Supplier project;
- private final Predicate> operationDonePredicate;
- private final long operationCompleteCheckInterval;
- private final long operationCompleteCheckTimeout;
-
- @Inject
- protected GoogleComputeEngineService(ComputeServiceContext context,
- Map credentialStore,
- @Memoized Supplier> images,
- @Memoized Supplier> hardwareProfiles,
- @Memoized Supplier> locations,
- ListNodesStrategy listNodesStrategy,
- GetImageStrategy getImageStrategy,
- GetNodeMetadataStrategy getNodeMetadataStrategy,
- CreateNodesInGroupThenAddToSet runNodesAndAddToSetStrategy,
- RebootNodeStrategy rebootNodeStrategy,
- DestroyNodeStrategy destroyNodeStrategy,
- ResumeNodeStrategy resumeNodeStrategy,
- SuspendNodeStrategy suspendNodeStrategy,
- Provider templateBuilderProvider,
- @Named("DEFAULT") Provider templateOptionsProvider,
- @Named(TIMEOUT_NODE_RUNNING) Predicate>
- nodeRunning,
- @Named(TIMEOUT_NODE_TERMINATED) Predicate>
- nodeTerminated,
- @Named(TIMEOUT_NODE_SUSPENDED)
- Predicate> nodeSuspended,
- InitializeRunScriptOnNodeOrPlaceInBadMap.Factory initScriptRunnerFactory,
- InitAdminAccess initAdminAccess,
- RunScriptOnNode.Factory runScriptOnNodeFactory,
- PersistNodeCredentials persistNodeCredentials,
- ComputeServiceConstants.Timeouts timeouts,
- @Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor,
- Optional imageExtension,
- Optional securityGroupExtension,
- Function, Set> findOrphanedGroups,
- GroupNamingConvention.Factory namingConvention,
- GoogleComputeEngineApi api,
- @UserProject Supplier project,
- @Named("global") Predicate> operationDonePredicate,
- @Named(OPERATION_COMPLETE_INTERVAL) Long operationCompleteCheckInterval,
- @Named(OPERATION_COMPLETE_TIMEOUT) Long operationCompleteCheckTimeout) {
-
- super(context, credentialStore, images, hardwareProfiles, locations, listNodesStrategy, getImageStrategy,
- getNodeMetadataStrategy, runNodesAndAddToSetStrategy, rebootNodeStrategy, destroyNodeStrategy,
- resumeNodeStrategy, suspendNodeStrategy, templateBuilderProvider, templateOptionsProvider, nodeRunning,
- nodeTerminated, nodeSuspended, initScriptRunnerFactory, initAdminAccess, runScriptOnNodeFactory,
- persistNodeCredentials, timeouts, userExecutor, imageExtension, securityGroupExtension);
- this.findOrphanedGroups = checkNotNull(findOrphanedGroups, "find orphaned groups function");
- this.namingConvention = checkNotNull(namingConvention, "naming convention factory");
- this.api = checkNotNull(api, "google compute api");
- this.project = checkNotNull(project, "user project name");
- this.operationDonePredicate = checkNotNull(operationDonePredicate, "operation completed predicate");
- this.operationCompleteCheckInterval = checkNotNull(operationCompleteCheckInterval,
- "operation completed check interval");
- this.operationCompleteCheckTimeout = checkNotNull(operationCompleteCheckTimeout,
- "operation completed check timeout");
- }
-
- @Override
- protected synchronized void cleanUpIncidentalResourcesOfDeadNodes(Set extends NodeMetadata> deadNodes) {
- Set orphanedGroups = findOrphanedGroups.apply(deadNodes);
- for (String orphanedGroup : orphanedGroups) {
- cleanUpNetworksAndFirewallsForGroup(orphanedGroup);
- }
- }
-
-
- protected void cleanUpNetworksAndFirewallsForGroup(final String groupName) {
- String resourceName = namingConvention.create().sharedNameForGroup(groupName);
- final Network network = api.getNetworkApiForProject(project.get()).get(resourceName);
- FirewallApi firewallApi = api.getFirewallApiForProject(project.get());
- Predicate firewallBelongsToNetwork = new Predicate() {
- @Override
- public boolean apply(Firewall input) {
- return input != null && input.getNetwork().equals(network.getSelfLink());
- }
- };
-
- Set> operations = Sets.newHashSet();
- for (Firewall firewall : firewallApi.list().concat().filter(firewallBelongsToNetwork)) {
- operations.add(new AtomicReference(firewallApi.delete(firewall.getName())));
- }
-
- for (AtomicReference operation : operations) {
- retry(operationDonePredicate, operationCompleteCheckTimeout, operationCompleteCheckInterval,
- MILLISECONDS).apply(operation);
-
- if (operation.get().getHttpError().isPresent()) {
- HttpResponse response = operation.get().getHttpError().get();
- logger.warn("delete orphaned firewall %s failed. Http Error Code: %d HttpError: %s",
- operation.get().getTargetId(), response.getStatusCode(), response.getMessage());
- }
- }
-
- AtomicReference operation = Atomics.newReference(api.getNetworkApiForProject(project.get()).delete(resourceName));
-
- retry(operationDonePredicate, operationCompleteCheckTimeout, operationCompleteCheckInterval,
- MILLISECONDS).apply(operation);
-
- if (operation.get().getHttpError().isPresent()) {
- HttpResponse response = operation.get().getHttpError().get();
- logger.warn("delete orphaned network failed. Http Error Code: " + response.getStatusCode() +
- " HttpError: " + response.getMessage());
- }
- }
-
-
- /**
- * returns template options, except of type {@link org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions}.
- */
- @Override
- public GoogleComputeEngineTemplateOptions templateOptions() {
- return GoogleComputeEngineTemplateOptions.class.cast(super.templateOptions());
- }
-}
diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
deleted file mode 100644
index 3a26d3420f..0000000000
--- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.compute;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.collect.Iterables.contains;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.tryFind;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.CENTOS_PROJECT;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.DEBIAN_PROJECT;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_BOOT_DISK_SUFFIX;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_DELETE_BOOT_DISK_METADATA_KEY;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_IMAGE_METADATA_KEY;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_INTERVAL;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_TIMEOUT;
-import static org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig.Type;
-import static org.jclouds.googlecomputeengine.predicates.InstancePredicates.isBootDisk;
-import static org.jclouds.util.Predicates2.retry;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.annotation.Resource;
-import javax.inject.Named;
-
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LoginCredentials;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.compute.functions.FirewallTagNamingConvention;
-import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions;
-import org.jclouds.googlecomputeengine.config.UserProject;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.Instance.AttachedDisk;
-import org.jclouds.googlecomputeengine.domain.Instance.PersistentAttachedDisk;
-import org.jclouds.googlecomputeengine.domain.InstanceInZone;
-import org.jclouds.googlecomputeengine.domain.InstanceTemplate;
-import org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk;
-import org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk.Mode;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.domain.MachineTypeInZone;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.SlashEncodedIds;
-import org.jclouds.googlecomputeengine.domain.Zone;
-import org.jclouds.googlecomputeengine.features.InstanceApi;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-import com.google.common.base.Objects;
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.primitives.Ints;
-import com.google.common.util.concurrent.Atomics;
-import com.google.common.util.concurrent.UncheckedTimeoutException;
-import com.google.inject.Inject;
-
-public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter {
-
- @Resource
- @Named(ComputeServiceConstants.COMPUTE_LOGGER)
- protected Logger logger = Logger.NULL;
-
- private final GoogleComputeEngineApi api;
- private final Supplier userProject;
- private final Supplier> zones;
- private final Function> metatadaFromTemplateOptions;
- private final Predicate> retryOperationDonePredicate;
- private final long operationCompleteCheckInterval;
- private final long operationCompleteCheckTimeout;
- private final FirewallTagNamingConvention.Factory firewallTagNamingConvention;
-
- @Inject
- public GoogleComputeEngineServiceAdapter(GoogleComputeEngineApi api,
- @UserProject Supplier userProject,
- Function> metatadaFromTemplateOptions,
- @Named("zone") Predicate> operationDonePredicate,
- @Named(OPERATION_COMPLETE_INTERVAL) Long operationCompleteCheckInterval,
- @Named(OPERATION_COMPLETE_TIMEOUT) Long operationCompleteCheckTimeout,
- @Memoized Supplier