You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by pr...@apache.org on 2014/01/07 13:48:12 UTC
[1/2] git commit: implemented stratos rest api mock services,
yet to complete some of the operations
Updated Branches:
refs/heads/master a6610f103 -> 0e03fe2f2
implemented stratos rest api mock services, yet to complete some of the operations
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/ea381500
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/ea381500
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/ea381500
Branch: refs/heads/master
Commit: ea38150092e7b848cbcd024ab003240f15c3f302
Parents: 53f5dc5
Author: Pradeep Fernando <pr...@gmail.com>
Authored: Tue Jan 7 18:17:28 2014 +0530
Committer: Pradeep Fernando <pr...@gmail.com>
Committed: Tue Jan 7 18:17:28 2014 +0530
----------------------------------------------------------------------
.../stratos/rest/endpoint/mock/MockContext.java | 20 +++++++++++++++
.../rest/endpoint/mock/StratosTestAdmin.java | 26 ++++++++++----------
.../webapp/stratos-test/WEB-INF/cxf-servlet.xml | 2 +-
3 files changed, 34 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ea381500/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/MockContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/MockContext.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/MockContext.java
new file mode 100644
index 0000000..ac0ec49
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/MockContext.java
@@ -0,0 +1,20 @@
+package org.apache.stratos.rest.endpoint.mock;/*
+* Copyright (c) 2005-2012, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+* WSO2 Inc. 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.
+*/
+
+public class MockContext {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ea381500/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosTestAdmin.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosTestAdmin.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosTestAdmin.java
index b76ca5a..836f541 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosTestAdmin.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosTestAdmin.java
@@ -20,15 +20,16 @@ package org.apache.stratos.rest.endpoint.mock;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.mgt.dto.Cartridge;
+import org.apache.stratos.adc.mgt.dto.SubscriptionInfo;
+import org.apache.stratos.adc.mgt.exception.ADCException;
import org.apache.stratos.rest.endpoint.annotation.AuthorizationAction;
import org.apache.stratos.rest.endpoint.annotation.SuperTenantService;
+import org.apache.stratos.rest.endpoint.bean.CartridgeInfoBean;
import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
+import javax.ws.rs.*;
@Path("/admin/")
public class StratosTestAdmin {
@@ -45,17 +46,17 @@ public class StratosTestAdmin {
public void deployCartridgeDefinition (CartridgeDefinitionBean cartridgeDefinitionBean)
throws RestAPIException {
log.info("Cartridge definition : " + cartridgeDefinitionBean.toString());
-
+ MockContext.getInstance().addCartirdgeDefinition(cartridgeDefinitionBean);
}
- /*@GET
+ @GET
@Path("/cartridge/tenanted/list")
@Produces("application/json")
@Consumes("application/json")
@AuthorizationAction("/permission/protected/manage/monitor/tenants")
public Cartridge[] getAvailableMultiTenantCartridges() throws ADCException {
-
+ return MockContext.getInstance().getAvailableMultiTenantCartridges();
}
@GET
@@ -64,8 +65,7 @@ public class StratosTestAdmin {
@Consumes("application/json")
@AuthorizationAction("/permission/protected/manage/monitor/tenants")
public Cartridge[] getAvailableSingleTenantCartridges() throws ADCException {
- List<Cartridge> cartridges = ServiceUtils.getAvailableCartridges(null, false, getConfigContext());
- return cartridges.isEmpty() ? new Cartridge[0] : cartridges.toArray(new Cartridge[cartridges.size()]);
+ return MockContext.getInstance().getAvailableSingleTenantCartridges();
}
@GET
@@ -74,7 +74,7 @@ public class StratosTestAdmin {
@Consumes("application/json")
@AuthorizationAction("/permission/protected/manage/monitor/tenants")
public Cartridge[] getSubscribedCartridges() throws ADCException {
-
+ return MockContext.getInstance().getSubscribedCartridges();
}
@POST
@@ -83,7 +83,7 @@ public class StratosTestAdmin {
@Consumes("application/json")
@AuthorizationAction("/permission/protected/manage/monitor/tenants")
public SubscriptionInfo subscribe(CartridgeInfoBean cartridgeInfoBean) {
-
+ return MockContext.getInstance().subscribeToCartridge(cartridgeInfoBean);
}
@@ -95,9 +95,9 @@ public class StratosTestAdmin {
@Consumes("application/json")
@AuthorizationAction("/permission/protected/manage/monitor/tenants")
public void unsubscribe(String alias){
-
+ MockContext.getInstance().unsubscribe(alias);
}
-
+ /*
@POST
@Path("/tenant")
@Consumes("application/json")
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ea381500/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/cxf-servlet.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/cxf-servlet.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/cxf-servlet.xml
index 3c80869..63adc2d 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/cxf-servlet.xml
+++ b/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/cxf-servlet.xml
@@ -31,6 +31,6 @@
</jaxrs:serviceBeans>
</jaxrs:server>
- <bean id="stratosRestEndpointTestBean" class="org.apache.stratos.rest.endpoint.services.StratosAdmin"/>
+ <bean id="stratosRestEndpointTestBean" class="org.apache.stratos.rest.endpoint.mock.StratosTestAdmin"/>
</beans>
[2/2] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-stratos
Posted by pr...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/0e03fe2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/0e03fe2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/0e03fe2f
Branch: refs/heads/master
Commit: 0e03fe2f224d62e2fdaa40a2b11f144fe0ed35b6
Parents: ea38150 a6610f1
Author: Pradeep Fernando <pr...@gmail.com>
Authored: Tue Jan 7 18:17:56 2014 +0530
Committer: Pradeep Fernando <pr...@gmail.com>
Committed: Tue Jan 7 18:17:56 2014 +0530
----------------------------------------------------------------------
.../java/org/apache/stratos/cli/RestClient.java | 10 +--
.../stratos/cli/beans/TenantInfoBean.java | 8 ---
.../stratos/cli/commands/AddTenantCommand.java | 12 ----
.../stratos/rest/endpoint/ServiceHolder.java | 3 +-
.../distribution/src/main/assembly/bin.xml | 38 +++++++++---
products/autoscaler/modules/p2-profile/pom.xml | 63 ++++++++++++++++++-
.../distribution/src/main/assembly/bin.xml | 41 +++++++++---
.../cloud-controller/modules/p2-profile/pom.xml | 63 ++++++++++++++++++-
.../load-balancer/modules/p2-profile/pom.xml | 65 ++++++++++++++++++--
.../modules/distribution/src/assembly/bin.xml | 38 +++++++++---
.../modules/p2-profile-gen/pom.xml | 63 ++++++++++++++++++-
tools/stratos-installer/conf/setup.conf | 4 +-
12 files changed, 341 insertions(+), 67 deletions(-)
----------------------------------------------------------------------