Description:
Modifying the API functions' exception handling to call
addProxyObject() wherever applicable, and removing some
wrong calls to addProxyObject() that were put in in an
earlier commit for this bug.
With this commit, we cover many API functions to use the
new exception handling code, but some pieces may still be
left out. These will be covered as work in progress, when
making changes to the CS API code.
Description:
Removed some wrong invocations to addProxyObject() when
throwing exceptions in NetworkManagerImpl.java.
Replaced db ids with uuids in various points in the code
of NetworkManagerImpl.java, where exceptions are thrown.
Description:
Replacing placement of db ids in exception messages to uuids
in the file ManagementServerImpl.java.
Since there are a large number of files that throw exceptions
with db ids in them and they need to be changed, we will make
the changes in multiple commits.
Description:
Adding a new class AnnotationHelper, that provides routines
to read annotations from a VO class.
Cloudstack does the mapping between cloudstack java VO objects
and the database tables using cglib. cglib creates proxy objects
as the maps between VO objects and the database. A VO (value
object) class is populated after querying from the MYSQL database.
Ideally, a getAnnotation() issued on a cglib proxy object should
get a list of all the annotations in all classes in the inheritence
chain. However, this functionality seems to be currently broken
in cglib. Hence, when querying for annotations given the object
of a VO class, we need to get to the corresponding VO class of that
cglib proxy class and issue a getAnnotation() on that class. To get
the VO class, we simply need to get the super class of the proxy
object. Also, we need to recurse to the root VO class in case the
VO class extends another VO class.
Note that the cache used by CS is ehcache.
Bug 13127: API error text refer to database ids instead of uuids
Code-Reviewers: Ewan Mellor, Kelven Yang
Description:
1. A new class CSExceptionErrorCode has been added to utils.
It contains a list of error codes for each type of
Exception class. Use fully qualified package paths for
Exceptions in CSExceptionErrorCode. We log any exception
name not found in the list of error codes for exceptions.
2. Whenever we throw an exception exobj anywhere in the
CS code, the CSErrorCode is set in the base class
constructor.
3. We add a new field csErrorCode in classes CloudException,
RuntimeCloudException, ExecutionException and
ExceptionResponse.
4. Two places in ApiServer.java were wrongly modified when
putting in changes for bug 13127 to not throw an exception.
This has been corrected in this commit.
Bug 14006 - Admin could not create a VM when the cluster is Disabled
Changes:
- For Root admin, planner will not filter out the disabled pods or clusters from the resource list
Description:
Modified the IdentityTypeAdapter's custom serializer to
identify whether this is an exception response that is being
serialized, by checking if the idFieldName is set. If so,
serialize both uuid and the uuidProperty (for eg, zoneId and
"zoneId" (string)) and pass back the json representation of that.
Modified XML serializer also to build a list of uuids+fieldnames.
Introduced a new field "cserrorcode" in ExceptionResponse. This
refers to an error code that can be according to the specific
Exception being thrown. This will be serialized as usual. There
shouldn't be any need to do a db lookup for conversion for these
error codes.