cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [5/5] git commit: updated refs/heads/master to 7cb4b57
Date Tue, 04 Feb 2014 23:52:49 GMT
ExternalUUID control: enforce checking uuid validity by defining checkUUID method in the corresponding
absract class, and performing the check during API command dispatching


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

Branch: refs/heads/master
Commit: 7cb4b571c8ebb27e5dc6aaf4dcc985e7238c87ae
Parents: e5335cd
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Tue Feb 4 15:21:09 2014 -0800
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Tue Feb 4 15:47:13 2014 -0800

----------------------------------------------------------------------
 .../org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java  |  2 +-
 api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java   |  2 +-
 .../user/autoscale/UpdateAutoScaleVmGroupCmd.java        |  2 +-
 .../user/autoscale/UpdateAutoScaleVmProfileCmd.java      |  2 +-
 .../command/user/network/UpdateNetworkACLItemCmd.java    |  2 +-
 .../api/command/user/network/UpdateNetworkCmd.java       |  2 +-
 .../cloudstack/api/command/user/vm/UpdateVMCmd.java      |  2 +-
 .../api/command/user/volume/UpdateVolumeCmd.java         |  2 +-
 .../cloudstack/api/command/user/vpc/UpdateVPCCmd.java    |  2 +-
 server/src/com/cloud/api/ApiDispatcher.java              | 11 ++++++++++-
 10 files changed, 19 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java
index e57e038..dfb9439 100644
--- a/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCustomIdCmd.java
@@ -27,6 +27,6 @@ public abstract class BaseAsyncCustomIdCmd extends BaseAsyncCmd {
         return customId;
     }
 
-    public abstract void checkUuid(String id, Class<?> cls);
+    public abstract void checkUuid();
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java b/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java
index c9c8e04..942f29f 100644
--- a/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCustomIdCmd.java
@@ -27,6 +27,6 @@ public abstract class BaseCustomIdCmd extends BaseCmd {
         return customId;
     }
 
-    public abstract void checkUuid(String id, Class<?> cls);
+    public abstract void checkUuid();
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
index 221cc36..628bb8a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
@@ -155,7 +155,7 @@ public class UpdateAutoScaleVmGroupCmd extends BaseAsyncCustomIdCmd {
     }
 
     @Override
-    public void checkUuid(String id, Class<?> cls) {
+    public void checkUuid() {
         if (this.getCustomId() != null) {
             _uuidMgr.checkUuid(this.getCustomId(), AutoScaleVmGroup.class);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
index b9d53b2..d6405c1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
@@ -147,7 +147,7 @@ public class UpdateAutoScaleVmProfileCmd extends BaseAsyncCustomIdCmd
{
     }
 
     @Override
-    public void checkUuid(String id, Class<?> cls) {
+    public void checkUuid() {
         if (this.getCustomId() != null) {
             _uuidMgr.checkUuid(this.getCustomId(), AutoScaleVmProfile.class);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
index accad84..e684dcf 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
@@ -174,7 +174,7 @@ public class UpdateNetworkACLItemCmd extends BaseAsyncCustomIdCmd {
     }
 
     @Override
-    public void checkUuid(String id, Class<?> cls) {
+    public void checkUuid() {
         if (this.getCustomId() != null) {
             _uuidMgr.checkUuid(this.getCustomId(), NetworkACLItem.class);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
index 65da3c3..85bea5f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
@@ -190,7 +190,7 @@ public class UpdateNetworkCmd extends BaseAsyncCustomIdCmd {
     }
 
     @Override
-    public void checkUuid(String id, Class<?> cls) {
+    public void checkUuid() {
         if (this.getCustomId() != null) {
             _uuidMgr.checkUuid(this.getCustomId(), Network.class);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
index 630d4fc..0639477 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
@@ -148,7 +148,7 @@ public class UpdateVMCmd extends BaseCustomIdCmd {
     }
 
     @Override
-    public void checkUuid(String id, Class<?> cls) {
+    public void checkUuid() {
         if (this.getCustomId() != null) {
             _uuidMgr.checkUuid(this.getCustomId(), UserVm.class);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
index 310acde..65d2849 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
@@ -150,7 +150,7 @@ public class UpdateVolumeCmd extends BaseAsyncCustomIdCmd {
     }
 
     @Override
-    public void checkUuid(String id, Class<?> cls) {
+    public void checkUuid() {
         if (this.getCustomId() != null) {
             _uuidMgr.checkUuid(this.getCustomId(), Volume.class);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
index 38ecf88..3f24a2f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
@@ -115,7 +115,7 @@ public class UpdateVPCCmd extends BaseAsyncCustomIdCmd {
     }
 
     @Override
-    public void checkUuid(String id, Class<?> cls) {
+    public void checkUuid() {
         if (this.getCustomId() != null) {
             _uuidMgr.checkUuid(this.getCustomId(), Vpc.class);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cb4b571/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java
index 19406c2..7d9b7d7 100755
--- a/server/src/com/cloud/api/ApiDispatcher.java
+++ b/server/src/com/cloud/api/ApiDispatcher.java
@@ -21,14 +21,16 @@ import java.util.Map;
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseAsyncCmd;
 import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
 import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.BaseCustomIdCmd;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.framework.jobs.AsyncJob;
 import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+import org.apache.log4j.Logger;
 
 import com.cloud.api.dispatch.DispatchChain;
 import com.cloud.api.dispatch.DispatchChainFactory;
@@ -97,6 +99,13 @@ public class ApiDispatcher {
                 }
             }
         }
+
+        if (cmd instanceof BaseAsyncCustomIdCmd) {
+            ((BaseAsyncCustomIdCmd)cmd).checkUuid();
+        } else if (cmd instanceof BaseCustomIdCmd) {
+            ((BaseCustomIdCmd)cmd).checkUuid();
+        }
+
         cmd.execute();
     }
 


Mime
View raw message