stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [4/4] stratos git commit: Updating object conversion: autoscaler.partition -> cloud.controller.partition
Date Mon, 22 Dec 2014 07:42:02 GMT
Updating object conversion: autoscaler.partition -> cloud.controller.partition


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

Branch: refs/heads/master
Commit: c7feb35fac9fc4774b8befd211c54e97086c9f67
Parents: 0626501
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Mon Dec 22 13:11:36 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Mon Dec 22 13:11:52 2014 +0530

----------------------------------------------------------------------
 .../client/CloudControllerClient.java           |  19 +-
 .../concurrent/PartitionValidatorCallable.java  |   1 -
 .../impl/CloudControllerServiceUtil.java        |  14 +-
 .../util/CloudControllerConstants.java          |   2 +-
 .../main/resources/CloudControllerService.wsdl  | 964 +++++++++----------
 5 files changed, 502 insertions(+), 498 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/c7feb35f/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java
index 8bcbde6..caac260 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java
@@ -116,20 +116,25 @@ public class CloudControllerClient {
                 new org.apache.stratos.cloud.controller.stub.domain.Partition[partitions.length];
 
         for(int i = 0; i < partitions.length; i++) {
-            partitions1[i] = convertTOCCPartition(partitions[i]);
+            partitions1[i] = convertASPartitionTOCCPartition(partitions[i]);
         }
         return partitions1;
     }
 
-    private org.apache.stratos.cloud.controller.stub.domain.Partition convertTOCCPartition(org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.Partition
partition) {
-        org.apache.stratos.cloud.controller.stub.domain.Partition partition1 = new
+    private org.apache.stratos.cloud.controller.stub.domain.Partition
+        convertASPartitionTOCCPartition(org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.Partition
partition) {
+
+        org.apache.stratos.cloud.controller.stub.domain.Partition ccPartition = new
                 org.apache.stratos.cloud.controller.stub.domain.Partition();
 
-        partition1.setId(partition.getId());
-        partition1.setProvider(partition.getProvider());
-        partition1.setProperties(AutoscalerUtil.toStubProperties(partition.getProperties()));
+        ccPartition.setId(partition.getId());
+        ccPartition.setProvider(partition.getProvider());
+        ccPartition.setDescription(partition.getDescription());
+        ccPartition.setKubernetesClusterId(partition.getKubernetesClusterId());
+        ccPartition.setIsPublic(partition.getIsPublic());
+        ccPartition.setProperties(AutoscalerUtil.toStubProperties(partition.getProperties()));
 
-        return partition1;
+        return ccPartition;
     }
 
     /*

http://git-wip-us.apache.org/repos/asf/stratos/blob/c7feb35f/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/concurrent/PartitionValidatorCallable.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/concurrent/PartitionValidatorCallable.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/concurrent/PartitionValidatorCallable.java
index cdb10cb..7d4b7ea 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/concurrent/PartitionValidatorCallable.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/concurrent/PartitionValidatorCallable.java
@@ -57,5 +57,4 @@ public class PartitionValidatorCallable implements Callable<IaasProvider>
{
 
         return updatedIaasProvider;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/c7feb35f/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
index 3b703d1..23db8db 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
@@ -93,7 +93,13 @@ public class CloudControllerServiceUtil {
         String provider = partition.getProvider();
         Properties partitionProperties = CloudControllerUtil.toJavaUtilProperties(partition.getProperties());
 
-        if (iaasProvider != null) {
+        if (CloudControllerConstants.KUBERNETES_PARTITION_PROVIDER.equals(provider)) {
+            // if this is a kubernetes based Partition
+            KubernetesPartitionValidator validator = new KubernetesPartitionValidator();
+            validator.validate(partition, partitionProperties);
+            return iaasProvider;
+
+        } else if (iaasProvider != null) {
             // if this is a IaaS based partition
             Iaas iaas = iaasProvider.getIaas();
             PartitionValidator validator = iaas.getPartitionValidator();
@@ -101,12 +107,6 @@ public class CloudControllerServiceUtil {
             iaasProvider = validator.validate(partition, partitionProperties);
             return iaasProvider;
 
-        } else if (CloudControllerConstants.DOCKER_PARTITION_PROVIDER.equals(provider)) {
-            // if this is a docker based Partition
-            KubernetesPartitionValidator validator = new KubernetesPartitionValidator();
-            validator.validate(partition, partitionProperties);
-            return null;
-
         } else {
             String msg = "Invalid partition found: [partition-id] " + partition.getId();
             log.error(msg);

http://git-wip-us.apache.org/repos/asf/stratos/blob/c7feb35f/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java
index f15e450..43e9b30 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java
@@ -295,5 +295,5 @@ public final class CloudControllerConstants {
     public static final int PORT_RANGE_MAX = 65535;
     public static final int PORT_RANGE_MIN = 1;
     
-    public static final String DOCKER_PARTITION_PROVIDER = "docker";
+    public static final String KUBERNETES_PARTITION_PROVIDER = "kubernetes";
 }


Mime
View raw message