You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2013/01/10 01:59:34 UTC

[42/50] [abbrv] git commit: api: Re-add deleted addProxyObject method on CloudException

api: Re-add deleted addProxyObject method on CloudException

- This was removed part of the response work
- Re-adding as this kind of method definition is available in several other
  exception classes and is used in a lot of cmd classes and in service layer
- TODO: We need to find a way to replace old code and refactor method with the
  new definition that gets only uuid.
- FIXME: Some tables don't have uuid for ex. ClusterVSMMapVO, in this case
  we should keep the method until we find a way to fix this issue

Partially reverting a88ce6bb7f495dddeb954d1fc7826176646b3590

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/resizevolume
Commit: 7c5c3c5dfcc985dfd6dd890c96fa840a2bac3e0e
Parents: 2eee2cd
Author: Rohit Yadav <bh...@apache.org>
Authored: Wed Jan 9 05:43:41 2013 -0800
Committer: Rohit Yadav <bh...@apache.org>
Committed: Wed Jan 9 05:43:41 2013 -0800

----------------------------------------------------------------------
 api/src/com/cloud/exception/CloudException.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7c5c3c5d/api/src/com/cloud/exception/CloudException.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/exception/CloudException.java b/api/src/com/cloud/exception/CloudException.java
index fd83956..2ec6142 100644
--- a/api/src/com/cloud/exception/CloudException.java
+++ b/api/src/com/cloud/exception/CloudException.java
@@ -56,6 +56,15 @@ public class CloudException extends Exception {
 		return;
 	}
 
+    public void addProxyObject(Object voObj, Long id, String idFieldName) {
+       // Get the VO object's table name.
+       String tablename = AnnotationHelper.getTableName(voObj);
+       if (tablename != null) {
+               addProxyObject(tablename, id, idFieldName);
+       }
+       return;
+    }
+
 	public ArrayList<String> getIdProxyList() {
 		return idList;
 	}