Skip to content

Commit a88ce6b

Browse files
committed
Remove IdentityProxy from CloudException and ExceptionResponse.
1 parent eb2a7de commit a88ce6b

9 files changed

Lines changed: 435 additions & 451 deletions

File tree

api/src/com/cloud/exception/CloudException.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
public class CloudException extends Exception {
3131

3232
// This holds a list of uuids and their names. Add uuid:fieldname pairs
33-
protected ArrayList<IdentityProxy> idList = new ArrayList<IdentityProxy>();
33+
protected ArrayList<String> idList = new ArrayList<String>();
3434

3535
protected Integer csErrorCode;
3636

@@ -44,26 +44,19 @@ public CloudException(String message, Throwable cause) {
4444
setCSErrorCode(CSExceptionErrorCode.getCSErrCode(this.getClass().getName()));
4545
}
4646

47-
public void addProxyObject(Object voObj, Long id, String idFieldName) {
48-
// Get the VO object's table name.
49-
String tablename = AnnotationHelper.getTableName(voObj);
50-
if (tablename != null) {
51-
addProxyObject(tablename, id, idFieldName);
52-
}
53-
return;
54-
}
47+
5548

5649
public CloudException() {
5750
super();
5851
setCSErrorCode(CSExceptionErrorCode.getCSErrCode(this.getClass().getName()));
5952
}
6053

61-
public void addProxyObject(String tableName, Long id, String idFieldName) {
62-
idList.add(new IdentityProxy(tableName, id, idFieldName));
54+
public void addProxyObject(String uuid) {
55+
idList.add(uuid);
6356
return;
6457
}
6558

66-
public ArrayList<IdentityProxy> getIdProxyList() {
59+
public ArrayList<String> getIdProxyList() {
6760
return idList;
6861
}
6962

api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import com.cloud.exception.ResourceInUseException;
3737
import com.cloud.org.Cluster;
3838
import com.cloud.user.Account;
39-
import com.cloud.utils.IdentityProxy;
4039

4140
@Implementation(description="Adds a new cluster", responseObject=ClusterResponse.class)
4241
public class AddClusterCmd extends BaseCmd {
@@ -173,8 +172,8 @@ public void execute(){
173172
} catch (ResourceInUseException ex) {
174173
s_logger.warn("Exception: ", ex);
175174
ServerApiException e = new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
176-
for (IdentityProxy proxyObj : ex.getIdProxyList()) {
177-
e.addProxyObject(proxyObj.getTableName(), proxyObj.getValue(), proxyObj.getidFieldName());
175+
for (String proxyObj : ex.getIdProxyList()) {
176+
e.addProxyObject(proxyObj);
178177
}
179178
throw e;
180179
}

api/src/org/apache/cloudstack/api/response/ExceptionResponse.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@
1919
import java.util.ArrayList;
2020

2121
import com.cloud.serializer.Param;
22-
import com.cloud.utils.IdentityProxy;
2322
import com.google.gson.annotations.SerializedName;
2423
import org.apache.cloudstack.api.BaseResponse;
2524

2625
public class ExceptionResponse extends BaseResponse {
2726

2827
@SerializedName("uuidList") @Param(description="List of uuids associated with this error")
29-
private ArrayList<IdentityProxy> idList = new ArrayList<IdentityProxy>();
28+
private ArrayList<String> idList;
3029

3130
@SerializedName("errorcode") @Param(description="numeric code associated with this error")
3231
private Integer errorCode;
@@ -53,12 +52,12 @@ public void setErrorText(String errorText) {
5352
this.errorText = errorText;
5453
}
5554

56-
public void addProxyObject(String tableName, Long id, String idFieldName) {
57-
idList.add(new IdentityProxy(tableName, id, idFieldName));
55+
public void addProxyObject(String id) {
56+
idList.add(id);
5857
return;
5958
}
6059

61-
public ArrayList<IdentityProxy> getIdProxyList() {
60+
public ArrayList<String> getIdProxyList() {
6261
return idList;
6362
}
6463

0 commit comments

Comments
 (0)