incubator-cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelven Yang <kelven.y...@citrix.com>
Subject Re: [DISCUSS] Question about @Parameter (entityType)
Date Mon, 28 Jan 2013 06:50:07 GMT


On 1/27/13 9:52 PM, "Mice Xia" <weiran.xia1@gmail.com> wrote:

>i have the same question and i found this:
>
>http://mail-archives.apache.org/mod_mbox//incubator-cloudstack-dev/201301.
>mbox/%3CCANLSSBXHw5FHwRN3BS+YOj6YCpbbdU1kHjzq4nCAA59fQfaAUg@mail.gmail.com
>%3E
>
>seems this annotation is used for converting entity UUID->ID


Yes, I know it is used for this purpose, my question is why we do this
indirectly through a Response class? Especially when a command object is
expecting multiple such entities, we can see a number of Response classes
be introduced to the Command class like DeployVMCmd, a new developer may
wonder what are those Response classes are to do with one command.

And one more confusing part in DeployVMCmd, I can see some entity
references are done through Response classes, while the special
ipToNetworkList parameter is trying to directly refer to the entities (by
the way, populating value of ipToNetworkList is actually done by another
helper method in DeployVMCmd class). Is this in this way for an
implementation purpose?

-Kelven

>
>-Mice
>
>2013/1/28 Kelven Yang <kelven.yang@citrix.com>:
>> I have a question about a change in @Parameter at API layer, in regards
>>to
>> entityType, does anyone know the reason behind why it has to go through
>> with some Response class which in turn declares links to the entity
>>class
>> via @EntityReference annotation?
>>
>> And in DeployVMCmd as an example, there is also another special field
>> (ipToNetworkList) declares entity reference directly, could someone
>> clarify it?
>>
>> @ACL(checkKeyAccess=true)
>>     @Parameter(name = ApiConstants.IP_NETWORK_LIST, type =
>> CommandType.MAP, entityType={Network.class, IpAddress.class},
>>             description = "ip to network mapping. Can't be specified
>>with
>> networkIds parameter." +
>>                     " Example:
>> iptonetworklist[0].ip=10.10.10.11&iptonetworklist[0].networkid=uuid -
>> requests to use ip 10.10.10.11 in network id=uuid")
>>     private Map ipToNetworkList;
>>
>> Kelven
>>
>>


Mime
View raw message