f5: Annotate f5 cmd classes, remove IdentityMapper

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-01-04 16:49:27 -08:00
parent 4cf0b05a0b
commit 4dd5f14e76
6 changed files with 14 additions and 10 deletions

View File

@ -44,8 +44,8 @@ public class ConfigureF5LoadBalancerCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="external_load_balancer_devices")
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.LONG, required=true, description="F5 load balancer device ID")
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType = F5LoadBalancerResponse.class,
required=true, description="F5 load balancer device ID")
private Long lbDeviceId;
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_CAPACITY, type=CommandType.LONG, required=false, description="capacity of the device, Capacity will be interpreted as number of networks device can handle")

View File

@ -29,6 +29,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.api.response.F5LoadBalancerResponse;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
@ -49,8 +50,8 @@ public class DeleteF5LoadBalancerCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="external_load_balancer_devices")
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.LONG, required=true, description="netscaler load balancer device ID")
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType = F5LoadBalancerResponse.class,
required=true, description="netscaler load balancer device ID")
private Long lbDeviceId;
/////////////////////////////////////////////////////

View File

@ -25,7 +25,6 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
@ -52,8 +51,8 @@ public class ListF5LoadBalancerNetworksCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="external_load_balancer_devices")
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.LONG, required = true, description="f5 load balancer device ID")
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType = F5LoadBalancerResponse.class,
required = true, description="f5 load balancer device ID")
private Long lbDeviceId;
/////////////////////////////////////////////////////

View File

@ -50,8 +50,8 @@ public class ListF5LoadBalancersCmd extends BaseListCmd {
description="the Physical Network ID")
private Long physicalNetworkId;
@IdentityMapper(entityTableName="external_load_balancer_devices")
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.LONG, description="f5 load balancer device ID")
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType = F5LoadBalancerResponse.class,
description="f5 load balancer device ID")
private Long lbDeviceId;
/////////////////////////////////////////////////////

View File

@ -16,11 +16,14 @@
// under the License.
package com.cloud.api.response;
import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.network.ExternalLoadBalancerDeviceVO;
@EntityReference(value=ExternalLoadBalancerDeviceVO.class)
public class F5LoadBalancerResponse extends BaseResponse {
@SerializedName(ApiConstants.LOAD_BALANCER_DEVICE_ID) @Param(description="device id of the F5 load balancer")
private String id;

View File

@ -16,6 +16,7 @@
// under the License.
package com.cloud.network;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import org.apache.cloudstack.network.ExternalNetworkDeviceManager;
@ -36,7 +37,7 @@ import javax.persistence.Table;
@Entity
@Table(name="external_load_balancer_devices")
public class ExternalLoadBalancerDeviceVO implements InternalIdentity {
public class ExternalLoadBalancerDeviceVO implements InternalIdentity, Identity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)