incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From frankzh...@apache.org
Subject [5/7] git commit: refs/heads/4.1 - CloudStack CLOUDSTACK-774 Supporting kickstart in CloudStack baremetal
Date Thu, 21 Feb 2013 23:34:58 GMT
CloudStack CLOUDSTACK-774
Supporting kickstart in CloudStack baremetal

fixing bugs to align to new code base


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/241d05e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/241d05e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/241d05e6

Branch: refs/heads/4.1
Commit: 241d05e6850cbefbd663ac5904cdbde56d0a4f55
Parents: 42d9cc4
Author: frank <frank.zhang@citrix.com>
Authored: Wed Feb 13 11:23:02 2013 -0800
Committer: frank <frank.zhang@citrix.com>
Committed: Thu Feb 21 15:39:15 2013 -0800

----------------------------------------------------------------------
 client/pom.xml                                     |    5 +
 client/tomcatconf/componentContext.xml.in          |   23 +++-
 client/tomcatconf/nonossComponentContext.xml.in    |    7 +-
 .../discovery/ApiDiscoveryServiceImpl.java         |    6 +-
 .../cloud/baremetal/database/BaremetalCmdbDao.java |   25 ----
 .../baremetal/database/BaremetalCmdbDaoImpl.java   |   32 -----
 .../cloud/baremetal/database/BaremetalCmdbVO.java  |  104 ---------------
 .../baremetal/manager/AddBaremetalHostCmd.java     |    4 +-
 .../AddBaremetalPxePingServerCmd.java              |    2 +
 .../networkservice/BaremetalDhcpManagerImpl.java   |    5 +-
 .../networkservice/BaremetalPxeElement.java        |    6 +-
 .../networkservice/BaremetalPxeManagerImpl.java    |    8 +-
 server/src/com/cloud/api/ApiServer.java            |    9 +-
 utils/src/com/cloud/utils/db/Transaction.java      |    4 +-
 14 files changed, 59 insertions(+), 181 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index 930a171..4902310 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -86,6 +86,11 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-hypervisor-baremetal</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
        <groupId>org.apache.cloudstack</groupId>
        <artifactId>cloud-plugin-hypervisor-ovm</artifactId>
        <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
index c45ab1b..032f547 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -44,7 +44,6 @@
   <bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl"
/>
   <bean id="clusteredVirtualMachineManagerImpl" class="com.cloud.vm.ClusteredVirtualMachineManagerImpl"
/>
   <bean id="highAvailabilityManagerExtImpl" class="com.cloud.ha.HighAvailabilityManagerExtImpl"
/>
-  <!-- bean id="bareMetalVmManagerImpl" class="com.cloud.baremetal.BareMetalVmManagerImpl"
/ -->
   <bean id="userVmManagerImpl" class="com.cloud.vm.UserVmManagerImpl" />
   <bean id="consoleProxyManagerImpl" class="com.cloud.consoleproxy.ConsoleProxyManagerImpl"
/>
   <bean id="securityGroupManagerImpl2" class="com.cloud.network.security.SecurityGroupManagerImpl2"
/>
@@ -53,6 +52,11 @@
   <bean id="ipv6AddressManagerImpl" class="com.cloud.network.Ipv6AddressManagerImpl" />
 
   <bean id="apiRateLimitServiceImpl" class="org.apache.cloudstack.ratelimit.ApiRateLimitServiceImpl"/>
+  <bean id="BaremetalManager" class="com.cloud.baremetal.manager.BaremetalManagerImpl"/>
+  <bean id="BaremetalDhcpManager" class="com.cloud.baremetal.networkservice.BaremetalDhcpManagerImpl"/>
+  <bean id="BaremetalKickStartPxeService" class="com.cloud.baremetal.networkservice.BaremetalKickStartServiceImpl"/>
+  <bean id="BaremetalPingPxeService" class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl"
/>
+  <bean id="BaremetalPxeManager" class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl"
/>
 
    
   <!--
@@ -64,8 +68,11 @@
   <bean id="ExternalDhcpServer" class="com.cloud.network.element.ExternalDhcpElement">
     <property name="name" value="ExternalDhcpServer"/>
   </bean>
-  <bean id="BareMetal" class="com.cloud.network.element.BareMetalElement">
-    <property name="name" value="BareMetal"/>
+  <bean id="BareMetalDhcp" class="com.cloud.baremetal.networkservice.BaremetalDhcpElement">
+      <property name="name" value="BareMetalDhcp"/>
+  </bean>
+  <bean id="BareMetalPxe" class="com.cloud.baremetal.networkservice.BaremetalPxeElement">
+      <property name="name" value="BareMetalPxe"/>
   </bean>
   <bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
     <property name="name" value="SecurityGroupProvider"/>
@@ -119,6 +126,14 @@
     <property name="name" value="Basic"/>
   </bean>
 
+  <bean id="hyervisorTemplateAdapter" class="com.cloud.template.HyervisorTemplateAdapter">
+    <property name="name" value="HypervisorAdapter"/>
+  </bean>
+
+  <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter"
>
+    <property name="name" value="BareMetalTemplateAdapter"/>
+  </bean>
+
   <!--
     Authenticators
   -->
@@ -174,7 +189,7 @@
     <property name="name" value="KVM Agent"/>
   </bean>
 
-  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.BareMetalDiscoverer">
+  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
     <property name="name" value="Bare Metal Agent"/>
   </bean>
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/client/tomcatconf/nonossComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in
index 5532bec..372f24e 100644
--- a/client/tomcatconf/nonossComponentContext.xml.in
+++ b/client/tomcatconf/nonossComponentContext.xml.in
@@ -68,8 +68,11 @@
   <bean id="ExternalDhcpServer" class="com.cloud.network.element.ExternalDhcpElement">
     <property name="name" value="ExternalDhcpServer"/>
   </bean>
-  <bean id="BareMetal" class="com.cloud.network.element.BareMetalElement">
-    <property name="name" value="BareMetal"/>
+  <bean id="BareMetalDhcp" class="com.cloud.baremetal.networkservice.BaremetalDhcpElement">
+    <property name="name" value="BareMetalDhcp"/>
+  </bean>
+  <bean id="BareMetalPxe" class="com.cloud.baremetal.networkservice.BaremetalPxeElement">
+    <property name="name" value="BareMetalPxe"/>
   </bean>
   <bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
     <property name="name" value="SecurityGroupProvider"/>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
----------------------------------------------------------------------
diff --git a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
old mode 100644
new mode 100755
index 30123c7..293a1a4
--- a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
+++ b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
@@ -69,8 +69,10 @@ public class ApiDiscoveryServiceImpl implements ApiDiscoveryService {
             long startTime = System.nanoTime();
             s_apiNameDiscoveryResponseMap = new HashMap<String, ApiDiscoveryResponse>();
             Set<Class<?>> cmdClasses = new HashSet<Class<?>>();
-            for(PluggableService service: _services)
-                cmdClasses.addAll(service.getCommands());
+            for(PluggableService service: _services) {
+                s_logger.debug(String.format("getting api commands of service: %s", service.getClass().getName()));
+                cmdClasses.addAll(service.getCommands());
+            }
             cacheResponseMap(cmdClasses);
             long endTime = System.nanoTime();
             s_logger.info("Api Discovery Service: Annotation, docstrings, api relation graph
processed in " + (endTime - startTime) / 1000000.0 + " ms");

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbDao.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbDao.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbDao.java
deleted file mode 100755
index 0f20c67..0000000
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbDao.java
+++ /dev/null
@@ -1,25 +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.
-// 
-// Automatically generated by addcopyright.py at 01/29/2013
-package com.cloud.baremetal.database;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface BaremetalCmdbDao extends GenericDao<BaremetalCmdbVO, Long> {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbDaoImpl.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbDaoImpl.java
deleted file mode 100755
index 5a882f1..0000000
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbDaoImpl.java
+++ /dev/null
@@ -1,32 +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.
-// 
-// Automatically generated by addcopyright.py at 01/29/2013
-package com.cloud.baremetal.database;
-
-import javax.ejb.Local;
-
-import org.springframework.stereotype.Component;
-
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.GenericDaoBase;
-@Component
-@Local(value = {BaremetalCmdbDao.class})
-@DB(txn = false)
-public class BaremetalCmdbDaoImpl extends GenericDaoBase<BaremetalCmdbVO, Long> implements
BaremetalCmdbDao {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbVO.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbVO.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbVO.java
deleted file mode 100755
index ee3848a..0000000
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/database/BaremetalCmdbVO.java
+++ /dev/null
@@ -1,104 +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.
-// 
-// Automatically generated by addcopyright.py at 01/29/2013
-package com.cloud.baremetal.database;
-
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name="baremetal_cmdb")
-public class BaremetalCmdbVO {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private long id;
-    
-    @Column(name="uuid")
-    private String uuid;
-    
-    @Column(name="zone_id")
-    private long zoneId;
-    
-    @Column(name="url")
-    private String url;
-    
-    @Column(name="password")
-    private String password;
-    
-    @Column(name="username")
-    private String username;
-
-    public BaremetalCmdbVO() {
-        uuid = UUID.randomUUID().toString();
-    }
-    
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public long getZoneId() {
-        return zoneId;
-    }
-
-    public void setZoneId(long zoneId) {
-        this.zoneId = zoneId;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/AddBaremetalHostCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/AddBaremetalHostCmd.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/AddBaremetalHostCmd.java
index 5222d10..f778a4f 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/AddBaremetalHostCmd.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/AddBaremetalHostCmd.java
@@ -18,10 +18,12 @@
 // Automatically generated by addcopyright.py at 01/29/2013
 package com.cloud.baremetal.manager;
 
+import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.command.admin.host.AddHostCmd;
-
+import org.apache.cloudstack.api.response.HostResponse;
+@APICommand(name="addBaremetalHost", description="add a baremetal host", responseObject =
HostResponse.class)
 public class AddBaremetalHostCmd extends AddHostCmd {
     
     @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, description="ip address
intentionally allocated to this host after provisioning")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/AddBaremetalPxePingServerCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/AddBaremetalPxePingServerCmd.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/AddBaremetalPxePingServerCmd.java
index 70796f3..01cafd4 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/AddBaremetalPxePingServerCmd.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/AddBaremetalPxePingServerCmd.java
@@ -18,9 +18,11 @@
 // Automatically generated by addcopyright.py at 01/29/2013
 package com.cloud.baremetal.networkservice;
 
+import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.Parameter;
 
+@APICommand(name="addBaremetalPxePingServer", description="add a baremetal ping pxe server",
responseObject = BaremetalPxePingResponse.class)
 public class AddBaremetalPxePingServerCmd extends AddBaremetalPxeCmd {
 
     @Parameter(name=ApiConstants.PING_STORAGE_SERVER_IP, type=CommandType.STRING, required
= true, description="PING storage server ip")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
index af9e103..f87bf71 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
@@ -319,6 +319,9 @@ public class BaremetalDhcpManagerImpl extends ManagerBase implements BaremetalDh
 
 	@Override
 	public List<Class<?>> getCommands() {
-		return null;
+	    List<Class<?>> cmds = new ArrayList<Class<?>>();
+	    cmds.add(AddBaremetalDhcpCmd.class);
+	    cmds.add(ListBaremetalDhcpCmd.class);
+		return cmds;
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeElement.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeElement.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeElement.java
index bc4bcd3..7b8d528 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeElement.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeElement.java
@@ -166,13 +166,11 @@ public class BaremetalPxeElement extends AdapterBase implements NetworkElement
{
 
     @Override
     public boolean destroy(Network network, ReservationContext context) throws ConcurrentOperationException,
ResourceUnavailableException {
-        // TODO Auto-generated method stub
-        return false;
+        return true;
     }
 
     @Override
     public boolean verifyServicesCombination(Set<Service> services) {
-        // TODO Auto-generated method stub
-        return false;
+        return true;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
index 6e3963d..35cbaee 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
@@ -23,6 +23,7 @@
 package com.cloud.baremetal.networkservice;
 
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -236,7 +237,10 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe
 
 	@Override
 	public List<Class<?>> getCommands() {
-		// TODO Auto-generated method stub
-		return null;
+	    List<Class<?>> cmds = new ArrayList<Class<?>>();
+	    cmds.add(AddBaremetalKickStartPxeCmd.class);
+	    cmds.add(AddBaremetalPxePingServerCmd.class);
+	    cmds.add(ListBaremetalPxePingServersCmd.class);
+		return cmds;
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java
index c9d3abc..8b14d82 100755
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@ -139,6 +139,7 @@ import com.cloud.utils.component.PluggableService;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.Transaction;
+import com.cloud.utils.exception.CloudRuntimeException;
 
 @Component
 public class ApiServer implements HttpRequestHandler {
@@ -207,8 +208,12 @@ public class ApiServer implements HttpRequestHandler {
         for(PluggableService pluggableService: _pluggableServices)
             cmdClasses.addAll(pluggableService.getCommands());
 
-        for(Class<?> cmdClass: cmdClasses) {
-            String apiName = cmdClass.getAnnotation(APICommand.class).name();
+        for(Class<?> cmdClass: cmdClasses) {
+            APICommand at = cmdClass.getAnnotation(APICommand.class);
+            if (at == null) {
+                throw new CloudRuntimeException(String.format("%s is claimed as a API command,
but it doesn't have @APICommand annotation", cmdClass.getName()));
+            }
+            String apiName = at.name();
             if (_apiNameCmdClassMap.containsKey(apiName)) {
                 s_logger.error("API Cmd class " + cmdClass.getName() + " has non-unique apiname"
+ apiName);
                 continue;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/241d05e6/utils/src/com/cloud/utils/db/Transaction.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/db/Transaction.java b/utils/src/com/cloud/utils/db/Transaction.java
index c1f157e..3394270 100755
--- a/utils/src/com/cloud/utils/db/Transaction.java
+++ b/utils/src/com/cloud/utils/db/Transaction.java
@@ -97,8 +97,8 @@ public class Transaction {
         /* FIXME: We need a better solution for this
          * Initialize encryption if we need it for db.properties
          */ 
-        EncryptionSecretKeyChecker enc = new EncryptionSecretKeyChecker();
-        enc.check();        
+        //EncryptionSecretKeyChecker enc = new EncryptionSecretKeyChecker();
+        //enc.check();        
     }
 
     private final LinkedList<StackElement> _stack;


Mime
View raw message