stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [1/2] stratos git commit: Removing maxInstanceLimit property from IaasProvider since it is not used
Date Mon, 22 Dec 2014 05:15:22 GMT
Repository: stratos
Updated Branches:
  refs/heads/master f9168e12f -> 3343cf743


Removing maxInstanceLimit property from IaasProvider since it is not used


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

Branch: refs/heads/master
Commit: 1c8c1270d89003a189bcd44cc1aa0e2150c22146
Parents: f9168e1
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Mon Dec 22 10:36:59 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Mon Dec 22 10:36:59 2014 +0530

----------------------------------------------------------------------
 .../stratos/cli/RestCommandLineService.java     |  6 +--
 .../cloud/controller/domain/IaasConfig.java     | 12 +----
 .../controller/domain/InstanceMetadata.java     |  7 ++-
 .../cartridge/definition/IaasProviderBean.java  | 11 +----
 .../util/converter/ObjectConverter.java         | 29 ++++++-----
 .../main/resources/conf/cloud-controller.xml    |  4 ++
 .../main/resources/CloudControllerService.wsdl  | 51 ++++++++++----------
 7 files changed, 55 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/1c8c1270/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index b91d505..23d6f24 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -326,12 +326,11 @@ public class RestCommandLineService {
             if(cartridge.getIaasProvider() != null) {
                 RowMapper<IaasProviderBean> cartridgeMapper = new RowMapper<IaasProviderBean>()
{
                     public String[] getData(IaasProviderBean row) {
-                        String[] data = new String[5];
+                        String[] data = new String[4];
                         data[0] = row.getProvider();
                         data[1] = row.getType();
                         data[2] = row.getName();
                         data[3] = row.getImageId();
-                        data[4] = String.valueOf(row.getMaxInstanceLimit());
                         return data;
                     }
                 };
@@ -342,8 +341,7 @@ public class RestCommandLineService {
                 System.out.println("-------------------------------------");
                 System.out.println("IaaS Providers: ");
                 System.out.println("-------------------------------------");
-                CliUtils.printTable(iaasProviders, cartridgeMapper, "Provider", "Type", "Name",
"Image ID",
-                        "Max Instance Limit");
+                CliUtils.printTable(iaasProviders, cartridgeMapper, "Provider", "Type", "Name",
"Image ID");
             }
             System.out.println("-------------------------------------");
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c8c1270/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/IaasConfig.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/IaasConfig.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/IaasConfig.java
index 6725f29..2efbec9 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/IaasConfig.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/IaasConfig.java
@@ -44,8 +44,6 @@ public class IaasConfig implements Serializable {
    
     private String imageId;
 
-    private int maxInstanceLimit;
-
     private Properties properties;
     
     private NetworkInterfaces networkInterfaces;
@@ -120,14 +118,6 @@ public class IaasConfig implements Serializable {
         this.imageId = imageId;
     }
 
-    public int getMaxInstanceLimit() {
-        return maxInstanceLimit;
-    }
-
-    public void setMaxInstanceLimit(int maxInstanceLimit) {
-        this.maxInstanceLimit = maxInstanceLimit;
-    }
-
     public Properties getProperties() {
         return properties;
     }
@@ -139,7 +129,7 @@ public class IaasConfig implements Serializable {
     public String toString () {
 
         return " [ Type: " + type + ", Name: " + name + ", Class Name: " + className + ",
Image Id: " + imageId +
-                ", Max Instance Limit: " + maxInstanceLimit + ", Provider: " + provider +
", Identity: " + identity +
+                ", Provider: " + provider + ", Identity: " + identity +
                 ", Credentials: " + credential + ", Properties: " + getIaasProperties() +
" ] ";
     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c8c1270/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/InstanceMetadata.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/InstanceMetadata.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/InstanceMetadata.java
index d67c019..4c0895b 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/InstanceMetadata.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/InstanceMetadata.java
@@ -19,10 +19,15 @@
 
 package org.apache.stratos.cloud.controller.domain;
 
+import java.io.Serializable;
+
 /**
  * Instance metadata.
  */
-public class InstanceMetadata {
+public class InstanceMetadata implements Serializable {
+
+    private static final long serialVersionUID = 2121193151475197625L;
+
     private String hostname;
     private String hypervisor;
     private int ram;

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c8c1270/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/IaasProviderBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/IaasProviderBean.java
b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/IaasProviderBean.java
index 44ee6d0..e4f3583 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/IaasProviderBean.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/IaasProviderBean.java
@@ -29,7 +29,6 @@ public class IaasProviderBean {
     private String name;
     private String className;
     private String imageId;
-    private int maxInstanceLimit;
     private String provider;
     private String identity;
     private String credential;
@@ -72,14 +71,6 @@ public class IaasProviderBean {
         this.imageId = imageId;
     }
 
-    public int getMaxInstanceLimit() {
-        return maxInstanceLimit;
-    }
-
-    public void setMaxInstanceLimit(int maxInstanceLimit) {
-        this.maxInstanceLimit = maxInstanceLimit;
-    }
-
     public String getProvider() {
         return provider;
     }
@@ -142,7 +133,7 @@ public class IaasProviderBean {
 
     public String toString () {
         return " [ Type: " + getType() + ", Name: " + getName() + ", Class Name: " + getClassName()
+ ", Image Id: " + getImageId() +
-                ", Max Instance Limit: " + getMaxInstanceLimit() + ", Provider: " + getProvider()
+ ", Identity: " + getIdentity() +
+                ", Provider: " + getProvider() + ", Identity: " + getIdentity() +
                 ", Credentials: " + getCredential() + ", Properties: " + getIaasPropertiesString()
+ ", Network Interfaces: " +
                 getNetworkInterfacesString() + " ] ";
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c8c1270/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
----------------------------------------------------------------------
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 9cc4207..e4e756b 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
@@ -153,7 +153,6 @@ public class ObjectConverter {
             IaasConfig iaasConfig = new IaasConfig();
             iaasConfig.setType(iaasProviderBeansArray[i].getType());
             iaasConfig.setImageId(iaasProviderBeansArray[i].getImageId());
-            iaasConfig.setMaxInstanceLimit(iaasProviderBeansArray[i].getMaxInstanceLimit());
             iaasConfig.setName(iaasProviderBeansArray[i].getName());
             iaasConfig.setClassName(iaasProviderBeansArray[i].getClassName());
             iaasConfig.setCredential(iaasProviderBeansArray[i].getCredential());
@@ -219,22 +218,26 @@ public class ObjectConverter {
     
     public static org.apache.stratos.cloud.controller.stub.Properties convertPropertyBeansToCCStubProperties(
             List<PropertyBean> propertyBeans) {
+        if (propertyBeans == null) {
+            return null;
+        }
 
-        //convert to an array
-        PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()];
-        propertyBeans.toArray(propertyBeansArray);
-        org.apache.stratos.cloud.controller.stub.Property[] propertyArray = new org.apache.stratos.cloud.controller.stub.Property[propertyBeansArray.length];
+        List<org.apache.stratos.cloud.controller.stub.Property> stubPropertiesList
=
+                new ArrayList<org.apache.stratos.cloud.controller.stub.Property>();
 
-        for (int j = 0; j < propertyBeansArray.length; j++) {
-            org.apache.stratos.cloud.controller.stub.Property property = new org.apache.stratos.cloud.controller.stub.Property();
-            property.setName(propertyBeansArray[j].getName());
-            property.setValue(propertyBeansArray[j].getValue());
-            propertyArray[j] = property;
+        for (PropertyBean propertyBean : propertyBeans) {
+            org.apache.stratos.cloud.controller.stub.Property stubProperty = new org.apache.stratos.cloud.controller.stub.Property();
+            stubProperty.setName(propertyBean.getName());
+            stubProperty.setValue(propertyBean.getValue());
+            stubPropertiesList.add(stubProperty);
         }
 
-        org.apache.stratos.cloud.controller.stub.Properties properties = new org.apache.stratos.cloud.controller.stub.Properties();
-        properties.setProperties(propertyArray);
-        return properties;
+        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()]);
+        stubProperties.setProperties(stubPropertiesArray);
+
+        return stubProperties;
     }
 
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c8c1270/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml
----------------------------------------------------------------------
diff --git a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml
b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml
index b049170..6c2967a 100644
--- a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml
+++ b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml
@@ -56,10 +56,14 @@
         <iaasProvider type="kubernetes" name="Kubernetes">
             <className>org.apache.stratos.cloud.controller.iaases.KubernetesIaas</className>
             <provider>kubernetes</provider>
+            <identity svns:secretAlias="cloud.controller.kubernetes.identity">identity</identity>
+            <credential svns:secretAlias="cloud.controller.kubernetes.credential">credential</credential>
         </iaasProvider>
         <iaasProvider type="mock" name="Mock">
             <className>org.apache.stratos.cloud.controller.iaases.MockIaas</className>
             <provider>mock</provider>
+            <identity svns:secretAlias="cloud.controller.mock.identity">identity</identity>
+            <credential svns:secretAlias="cloud.controller.mock.credential">credential</credential>
         </iaasProvider>
 	</iaasProviders>
 </cloudController>

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c8c1270/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
b/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
index 293808f..ef701fd 100644
--- a/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
+++ b/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
@@ -197,45 +197,45 @@
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
-            <xs:element name="startInstance">
+            <xs:element name="registerService">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="instanceContext" nillable="true"
type="ax26:InstanceContext"/>
+                        <xs:element minOccurs="0" name="registrant" nillable="true" type="ax26:Registrant"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
-            <xs:element name="startInstanceResponse">
+            <xs:element name="registerServiceResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax26:MemberContext"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
-            <xs:element name="CloudControllerServiceInvalidMemberException">
+            <xs:element name="startInstance">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="InvalidMemberException" nillable="true"
type="ax21:InvalidMemberException"/>
+                        <xs:element minOccurs="0" name="instanceContext" nillable="true"
type="ax26:InstanceContext"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
-            <xs:element name="terminateInstance">
+            <xs:element name="startInstanceResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax26:MemberContext"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
-            <xs:element name="registerService">
+            <xs:element name="CloudControllerServiceInvalidMemberException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="registrant" nillable="true" type="ax26:Registrant"/>
+                        <xs:element minOccurs="0" name="InvalidMemberException" nillable="true"
type="ax21:InvalidMemberException"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
-            <xs:element name="registerServiceResponse">
+            <xs:element name="terminateInstance">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -698,7 +698,6 @@
                     <xs:element minOccurs="0" name="credential" nillable="true" type="xs:string"/>
                     <xs:element minOccurs="0" name="identity" nillable="true" type="xs:string"/>
                     <xs:element minOccurs="0" name="imageId" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="maxInstanceLimit" type="xs:int"/>
                     <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
                     <xs:element minOccurs="0" name="networkInterfaces" nillable="true"
type="ax23:NetworkInterfaces"/>
                     <xs:element minOccurs="0" name="payload" nillable="true" type="xs:base64Binary"/>
@@ -791,6 +790,19 @@
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true"
type="ax23:Volume"/>
                 </xs:sequence>
             </xs:complexType>
+            <xs:complexType name="Registrant">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="autoScalerPolicyName" nillable="true"
type="xs:string"/>
+                    <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="deploymentPolicyName" nillable="true"
type="xs:string"/>
+                    <xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="payload" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="persistence" nillable="true" type="ax23:Persistence"/>
+                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
+                    <xs:element minOccurs="0" name="tenantRange" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
             <xs:complexType name="InstanceContext">
                 <xs:sequence>
                     <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
@@ -851,19 +863,6 @@
                     <xs:element minOccurs="0" name="ram" type="xs:int"/>
                 </xs:sequence>
             </xs:complexType>
-            <xs:complexType name="Registrant">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="autoScalerPolicyName" nillable="true"
type="xs:string"/>
-                    <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="deploymentPolicyName" nillable="true"
type="xs:string"/>
-                    <xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="payload" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="persistence" nillable="true" type="ax23:Persistence"/>
-                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
-                    <xs:element minOccurs="0" name="tenantRange" nillable="true" type="xs:string"/>
-                </xs:sequence>
-            </xs:complexType>
             <xs:complexType name="CartridgeInfo">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="appTypes" nillable="true"
type="ax23:AppType"/>


Mime
View raw message