Remove IdentityProxy from OfferingResponse, FirewallResponse,

FirewallRuleResponse, HypervisorCapabilitiesResponse, IPAddressResponse.

Signed-off-by: Min Chen <min.chen@citrix.com>
This commit is contained in:
Min Chen 2012-12-18 12:02:08 -08:00
parent 1aa30f03e7
commit 16be94e9d7
22 changed files with 324 additions and 233 deletions

View File

@ -28,6 +28,8 @@ public interface HypervisorCapabilities {
*/ */
long getId(); long getId();
String getUuid();
/** /**
* @return type of hypervisor * @return type of hypervisor
*/ */

View File

@ -72,6 +72,8 @@ public interface IpAddress extends ControlledEntity {
*/ */
long getId(); long getId();
String getUuid();
void setState(IpAddress.State state); void setState(IpAddress.State state);
Long getAllocatedToAccountId(); Long getAllocatedToAccountId();

View File

@ -255,6 +255,8 @@ public interface Network extends ControlledEntity {
*/ */
long getId(); long getId();
String getUuid();
String getName(); String getName();
Mode getMode(); Mode getMode();

View File

@ -24,6 +24,7 @@ import com.cloud.network.Networks.TrafficType;
public class NetworkProfile implements Network { public class NetworkProfile implements Network {
private long id; private long id;
private String uuid;
private long dataCenterId; private long dataCenterId;
private long ownerId; private long ownerId;
private long domainId; private long domainId;
@ -51,6 +52,7 @@ public class NetworkProfile implements Network {
public NetworkProfile(Network network) { public NetworkProfile(Network network) {
this.id = network.getId(); this.id = network.getId();
this.uuid = network.getUuid();
this.broadcastUri = network.getBroadcastUri(); this.broadcastUri = network.getBroadcastUri();
this.dataCenterId = network.getDataCenterId(); this.dataCenterId = network.getDataCenterId();
this.ownerId = network.getAccountId(); this.ownerId = network.getAccountId();
@ -105,6 +107,12 @@ public class NetworkProfile implements Network {
return id; return id;
} }
@Override
public String getUuid() {
return uuid;
}
@Override @Override
public long getDataCenterId() { public long getDataCenterId() {
return dataCenterId; return dataCenterId;

View File

@ -52,6 +52,12 @@ public interface FirewallRule extends ControlledEntity {
*/ */
long getId(); long getId();
/**
*
* @return uuid
*/
String getUuid();
/** /**
* @return external id. * @return external id.
*/ */

View File

@ -153,6 +153,13 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
return null; return null;
} }
@Override
public String getUuid() {
// TODO Auto-generated method stub
return null;
}
@Override @Override
public Long getSourceIpAddressId() { public Long getSourceIpAddressId() {
return ipAddressId; return ipAddressId;

View File

@ -208,6 +208,13 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
return null; return null;
} }
@Override
public String getUuid() {
// TODO Auto-generated method stub
return null;
}
@Override @Override
public Long getSourceIpAddressId() { public Long getSourceIpAddressId() {
return ipAddressId; return ipAddressId;

View File

@ -255,6 +255,13 @@ public class CreateIpForwardingRuleCmd extends BaseAsyncCreateCmd implements Sta
return null; return null;
} }
@Override
public String getUuid() {
// TODO Auto-generated method stub
return null;
}
@Override @Override
public String getSyncObjType() { public String getSyncObjType() {
return BaseAsyncCmd.networkSyncObject; return BaseAsyncCmd.networkSyncObject;

View File

@ -184,6 +184,13 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd implements FirewallR
return null; return null;
} }
@Override
public String getUuid() {
// TODO Auto-generated method stub
return null;
}
@Override @Override
public Long getSourceIpAddressId() { public Long getSourceIpAddressId() {
return null; return null;

View File

@ -19,17 +19,16 @@ package org.apache.cloudstack.api.response;
import java.util.Date; import java.util.Date;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import com.cloud.utils.IdentityProxy;
import com.cloud.serializer.Param; import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.BaseResponse;
public class DiskOfferingResponse extends BaseResponse { public class DiskOfferingResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="unique ID of the disk offering") @SerializedName(ApiConstants.ID) @Param(description="unique ID of the disk offering")
private IdentityProxy id = new IdentityProxy("disk_offering"); private String id;
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.") @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.")
private IdentityProxy domainId = new IdentityProxy("domain"); private String domainId;
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.") @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.")
private String domain; private String domain;
@ -55,20 +54,20 @@ public class DiskOfferingResponse extends BaseResponse {
@SerializedName("storagetype") @Param(description="the storage type for this disk offering") @SerializedName("storagetype") @Param(description="the storage type for this disk offering")
private String storageType; private String storageType;
public Long getId() { public String getId() {
return id.getValue(); return id;
} }
public void setId(Long id) { public void setId(String id) {
this.id.setValue(id); this.id = id;
} }
public Long getDomainId() { public String getDomainId() {
return domainId.getValue(); return domainId;
} }
public void setDomainId(Long domainId) { public void setDomainId(String domainId) {
this.domainId.setValue(domainId); this.domainId = domainId;
} }
public String getDomain() { public String getDomain() {

View File

@ -20,14 +20,13 @@ import java.util.List;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param; import com.cloud.serializer.Param;
import com.cloud.utils.IdentityProxy;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.BaseResponse;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class FirewallResponse extends BaseResponse { public class FirewallResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the ID of the firewall rule") @SerializedName(ApiConstants.ID) @Param(description="the ID of the firewall rule")
private IdentityProxy id = new IdentityProxy("firewall_rules"); private String id;
@SerializedName(ApiConstants.PROTOCOL) @Param(description="the protocol of the firewall rule") @SerializedName(ApiConstants.PROTOCOL) @Param(description="the protocol of the firewall rule")
private String protocol; private String protocol;
@ -59,8 +58,8 @@ public class FirewallResponse extends BaseResponse {
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with the rule", responseObject = ResourceTagResponse.class) @SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with the rule", responseObject = ResourceTagResponse.class)
private List<ResourceTagResponse> tags; private List<ResourceTagResponse> tags;
public void setId(Long id) { public void setId(String id) {
this.id.setValue(id); this.id = id;
} }
public void setProtocol(String protocol) { public void setProtocol(String protocol) {

View File

@ -20,14 +20,13 @@ import java.util.List;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param; import com.cloud.serializer.Param;
import com.cloud.utils.IdentityProxy;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.BaseResponse;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class FirewallRuleResponse extends BaseResponse { public class FirewallRuleResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the ID of the port forwarding rule") @SerializedName(ApiConstants.ID) @Param(description="the ID of the port forwarding rule")
private IdentityProxy id = new IdentityProxy("firewall_rules"); private String id;
@SerializedName(ApiConstants.PRIVATE_START_PORT) @Param(description = "the starting port of port forwarding rule's private port range") @SerializedName(ApiConstants.PRIVATE_START_PORT) @Param(description = "the starting port of port forwarding rule's private port range")
private String privateStartPort; private String privateStartPort;
@ -45,7 +44,7 @@ public class FirewallRuleResponse extends BaseResponse {
private String publicEndPort; private String publicEndPort;
@SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) @Param(description="the VM ID for the port forwarding rule") @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) @Param(description="the VM ID for the port forwarding rule")
private IdentityProxy virtualMachineId = new IdentityProxy("vm_instance"); private String virtualMachineId;
@SerializedName("virtualmachinename") @Param(description="the VM name for the port forwarding rule") @SerializedName("virtualmachinename") @Param(description="the VM name for the port forwarding rule")
private String virtualMachineName; private String virtualMachineName;
@ -54,7 +53,7 @@ public class FirewallRuleResponse extends BaseResponse {
private String virtualMachineDisplayName; private String virtualMachineDisplayName;
@SerializedName(ApiConstants.IP_ADDRESS_ID) @Param(description="the public ip address id for the port forwarding rule") @SerializedName(ApiConstants.IP_ADDRESS_ID) @Param(description="the public ip address id for the port forwarding rule")
private IdentityProxy publicIpAddressId = new IdentityProxy("user_ip_address"); private String publicIpAddressId;
@SerializedName(ApiConstants.IP_ADDRESS) @Param(description="the public ip address for the port forwarding rule") @SerializedName(ApiConstants.IP_ADDRESS) @Param(description="the public ip address for the port forwarding rule")
private String publicIpAddress; private String publicIpAddress;
@ -68,12 +67,12 @@ public class FirewallRuleResponse extends BaseResponse {
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with the rule", responseObject = ResourceTagResponse.class) @SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with the rule", responseObject = ResourceTagResponse.class)
private List<ResourceTagResponse> tags; private List<ResourceTagResponse> tags;
public Long getId() { public String getId() {
return id.getValue(); return id;
} }
public void setId(Long id) { public void setId(String id) {
this.id.setValue(id); this.id = id;
} }
public String getPrivateStartPort() { public String getPrivateStartPort() {
@ -116,12 +115,12 @@ public class FirewallRuleResponse extends BaseResponse {
this.publicEndPort = publicPort; this.publicEndPort = publicPort;
} }
public Long getVirtualMachineId() { public String getVirtualMachineId() {
return virtualMachineId.getValue(); return virtualMachineId;
} }
public void setVirtualMachineId(Long virtualMachineId) { public void setVirtualMachineId(String virtualMachineId) {
this.virtualMachineId.setValue(virtualMachineId); this.virtualMachineId = virtualMachineId;
} }
public String getVirtualMachineName() { public String getVirtualMachineName() {
@ -156,12 +155,12 @@ public class FirewallRuleResponse extends BaseResponse {
this.state = state; this.state = state;
} }
public Long getPublicIpAddressId() { public String getPublicIpAddressId() {
return publicIpAddressId.getValue(); return publicIpAddressId;
} }
public void setPublicIpAddressId(Long publicIpAddressId) { public void setPublicIpAddressId(String publicIpAddressId) {
this.publicIpAddressId.setValue(publicIpAddressId); this.publicIpAddressId = publicIpAddressId;
} }
public String getCidrList() { public String getCidrList() {

View File

@ -17,7 +17,6 @@
package org.apache.cloudstack.api.response; package org.apache.cloudstack.api.response;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import com.cloud.utils.IdentityProxy;
import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.serializer.Param; import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
@ -25,7 +24,7 @@ import org.apache.cloudstack.api.BaseResponse;
public class HypervisorCapabilitiesResponse extends BaseResponse { public class HypervisorCapabilitiesResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the ID of the hypervisor capabilities row") @SerializedName(ApiConstants.ID) @Param(description="the ID of the hypervisor capabilities row")
private IdentityProxy id = new IdentityProxy("hypervisor_capabilities"); private String id;
@SerializedName(ApiConstants.HYPERVISOR_VERSION) @Param(description="the hypervisor version") @SerializedName(ApiConstants.HYPERVISOR_VERSION) @Param(description="the hypervisor version")
private String hypervisorVersion; private String hypervisorVersion;
@ -39,17 +38,13 @@ public class HypervisorCapabilitiesResponse extends BaseResponse {
@SerializedName(ApiConstants.SECURITY_GROUP_EANBLED) @Param(description="true if security group is supported") @SerializedName(ApiConstants.SECURITY_GROUP_EANBLED) @Param(description="true if security group is supported")
private boolean isSecurityGroupEnabled; private boolean isSecurityGroupEnabled;
@Override
public Long getObjectId() { public String getId() {
return getId(); return id;
} }
public Long getId() { public void setId(String id) {
return id.getValue(); this.id = id;
}
public void setId(Long id) {
this.id.setValue(id);
} }

View File

@ -21,14 +21,13 @@ import java.util.List;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param; import com.cloud.serializer.Param;
import com.cloud.utils.IdentityProxy;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.BaseResponse;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class IPAddressResponse extends BaseResponse implements ControlledEntityResponse { public class IPAddressResponse extends BaseResponse implements ControlledEntityResponse {
@SerializedName(ApiConstants.ID) @Param(description="public IP address id") @SerializedName(ApiConstants.ID) @Param(description="public IP address id")
private IdentityProxy id = new IdentityProxy("user_ip_address"); private String id;
@SerializedName(ApiConstants.IP_ADDRESS) @Param(description="public IP address") @SerializedName(ApiConstants.IP_ADDRESS) @Param(description="public IP address")
private String ipAddress; private String ipAddress;
@ -37,7 +36,7 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
private Date allocated; private Date allocated;
@SerializedName(ApiConstants.ZONE_ID) @Param(description="the ID of the zone the public IP address belongs to") @SerializedName(ApiConstants.ZONE_ID) @Param(description="the ID of the zone the public IP address belongs to")
private IdentityProxy zoneId = new IdentityProxy("data_center"); private String zoneId;
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the name of the zone the public IP address belongs to") @SerializedName(ApiConstants.ZONE_NAME) @Param(description="the name of the zone the public IP address belongs to")
private String zoneName; private String zoneName;
@ -65,7 +64,7 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
@SerializedName(ApiConstants.VLAN_ID) @Param(description="the ID of the VLAN associated with the IP address." + @SerializedName(ApiConstants.VLAN_ID) @Param(description="the ID of the VLAN associated with the IP address." +
" This parameter is visible to ROOT admins only") " This parameter is visible to ROOT admins only")
private IdentityProxy vlanId = new IdentityProxy("vlan"); private String vlanId;
@SerializedName("vlanname") @Param(description="the VLAN associated with the IP address") @SerializedName("vlanname") @Param(description="the VLAN associated with the IP address")
private String vlanName; private String vlanName;
@ -77,7 +76,7 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
private Boolean isSystem; private Boolean isSystem;
@SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) @Param(description="virutal machine id the ip address is assigned to (not null only for static nat Ip)") @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) @Param(description="virutal machine id the ip address is assigned to (not null only for static nat Ip)")
private IdentityProxy virtualMachineId = new IdentityProxy("vm_instance"); private String virtualMachineId;
@SerializedName("virtualmachinename") @Param(description="virutal machine name the ip address is assigned to (not null only for static nat Ip)") @SerializedName("virtualmachinename") @Param(description="virutal machine name the ip address is assigned to (not null only for static nat Ip)")
private String virtualMachineName; private String virtualMachineName;
@ -86,25 +85,25 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
private String virtualMachineDisplayName; private String virtualMachineDisplayName;
@SerializedName(ApiConstants.ASSOCIATED_NETWORK_ID) @Param(description="the ID of the Network associated with the IP address") @SerializedName(ApiConstants.ASSOCIATED_NETWORK_ID) @Param(description="the ID of the Network associated with the IP address")
private IdentityProxy associatedNetworkId = new IdentityProxy("networks"); private String associatedNetworkId;
@SerializedName(ApiConstants.ASSOCIATED_NETWORK_NAME) @Param(description="the name of the Network associated with the IP address") @SerializedName(ApiConstants.ASSOCIATED_NETWORK_NAME) @Param(description="the name of the Network associated with the IP address")
private String associatedNetworkName; private String associatedNetworkName;
@SerializedName(ApiConstants.NETWORK_ID) @Param(description="the ID of the Network where ip belongs to") @SerializedName(ApiConstants.NETWORK_ID) @Param(description="the ID of the Network where ip belongs to")
private IdentityProxy networkId = new IdentityProxy("networks"); private String networkId;
@SerializedName(ApiConstants.STATE) @Param(description="State of the ip address. Can be: Allocatin, Allocated and Releasing") @SerializedName(ApiConstants.STATE) @Param(description="State of the ip address. Can be: Allocatin, Allocated and Releasing")
private String state; private String state;
@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network this belongs to") @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network this belongs to")
private IdentityProxy physicalNetworkId = new IdentityProxy("physical_network"); private String physicalNetworkId;
@SerializedName(ApiConstants.PURPOSE) @Param(description="purpose of the IP address. In Acton this value is not null for Ips with isSystem=true, and can have either StaticNat or LB value") @SerializedName(ApiConstants.PURPOSE) @Param(description="purpose of the IP address. In Acton this value is not null for Ips with isSystem=true, and can have either StaticNat or LB value")
private String purpose; private String purpose;
@SerializedName(ApiConstants.VPC_ID) @Param(description="VPC the ip belongs to") @SerializedName(ApiConstants.VPC_ID) @Param(description="VPC the ip belongs to")
private IdentityProxy vpcId = new IdentityProxy("vpc"); private String vpcId;
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with ip address", responseObject = ResourceTagResponse.class) @SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with ip address", responseObject = ResourceTagResponse.class)
private List<ResourceTagResponse> tags; private List<ResourceTagResponse> tags;
@ -122,8 +121,8 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
this.allocated = allocated; this.allocated = allocated;
} }
public void setZoneId(Long zoneId) { public void setZoneId(String zoneId) {
this.zoneId.setValue(zoneId); this.zoneId = zoneId;
} }
public void setZoneName(String zoneName) { public void setZoneName(String zoneName) {
@ -153,8 +152,8 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
this.forVirtualNetwork = forVirtualNetwork; this.forVirtualNetwork = forVirtualNetwork;
} }
public void setVlanId(Long vlanId) { public void setVlanId(String vlanId) {
this.vlanId.setValue(vlanId); this.vlanId = vlanId;
} }
public void setVlanName(String vlanName) { public void setVlanName(String vlanName) {
@ -165,16 +164,16 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
this.staticNat = staticNat; this.staticNat = staticNat;
} }
public void setAssociatedNetworkId(Long networkId) { public void setAssociatedNetworkId(String networkId) {
this.associatedNetworkId.setValue(networkId); this.associatedNetworkId = networkId;
} }
public void setNetworkId(Long networkId) { public void setNetworkId(String networkId) {
this.networkId.setValue(networkId); this.networkId = networkId;
} }
public void setVirtualMachineId(Long virtualMachineId) { public void setVirtualMachineId(String virtualMachineId) {
this.virtualMachineId.setValue(virtualMachineId); this.virtualMachineId = virtualMachineId;
} }
public void setVirtualMachineName(String virtualMachineName) { public void setVirtualMachineName(String virtualMachineName) {
@ -185,22 +184,18 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
this.virtualMachineDisplayName = virtualMachineDisplayName; this.virtualMachineDisplayName = virtualMachineDisplayName;
} }
public Long getId() { public String getId() {
return id.getValue(); return id;
} }
public void setId(Long id) { public void setId(String id) {
this.id.setValue(id); this.id = id;
} }
public void setState(String state) { public void setState(String state) {
this.state = state; this.state = state;
} }
@Override
public Long getObjectId() {
return getId();
}
@Override @Override
public void setProjectId(String projectId) { public void setProjectId(String projectId) {
@ -212,8 +207,8 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
this.projectName = projectName; this.projectName = projectName;
} }
public void setPhysicalNetworkId(long physicalNetworkId) { public void setPhysicalNetworkId(String physicalNetworkId) {
this.physicalNetworkId.setValue(physicalNetworkId); this.physicalNetworkId = physicalNetworkId;
} }
public void setIsSystem(Boolean isSystem) { public void setIsSystem(Boolean isSystem) {
@ -224,8 +219,8 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
this.purpose = purpose; this.purpose = purpose;
} }
public void setVpcId(Long vpcId) { public void setVpcId(String vpcId) {
this.vpcId.setValue(vpcId); this.vpcId = vpcId;
} }
public void setTags(List<ResourceTagResponse> tags) { public void setTags(List<ResourceTagResponse> tags) {

View File

@ -19,14 +19,13 @@ package org.apache.cloudstack.api.response;
import java.util.Date; import java.util.Date;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import com.cloud.utils.IdentityProxy;
import com.cloud.serializer.Param; import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.BaseResponse;
public class ServiceOfferingResponse extends BaseResponse { public class ServiceOfferingResponse extends BaseResponse {
@SerializedName("id") @Param(description="the id of the service offering") @SerializedName("id") @Param(description="the id of the service offering")
private IdentityProxy id = new IdentityProxy("disk_offering"); private String id;
@SerializedName("name") @Param(description="the name of the service offering") @SerializedName("name") @Param(description="the name of the service offering")
private String name; private String name;
@ -59,7 +58,7 @@ public class ServiceOfferingResponse extends BaseResponse {
private String tags; private String tags;
@SerializedName("domainid") @Param(description="the domain id of the service offering") @SerializedName("domainid") @Param(description="the domain id of the service offering")
private IdentityProxy domainId = new IdentityProxy("domain"); private String domainId;
@SerializedName(ApiConstants.DOMAIN) @Param(description="Domain name for the offering") @SerializedName(ApiConstants.DOMAIN) @Param(description="Domain name for the offering")
private String domain; private String domain;
@ -80,12 +79,12 @@ public class ServiceOfferingResponse extends BaseResponse {
private Integer networkRate; private Integer networkRate;
public Long getId() { public String getId() {
return id.getValue(); return id;
} }
public void setId(Long id) { public void setId(String id) {
this.id.setValue(id); this.id = id;
} }
public String getName() { public String getName() {
@ -195,12 +194,12 @@ public class ServiceOfferingResponse extends BaseResponse {
this.tags = tags; this.tags = tags;
} }
public Long getDomainId() { public String getDomainId() {
return domainId.getValue(); return domainId;
} }
public void setDomainId(Long domainId) { public void setDomainId(String domainId) {
this.domainId.setValue(domainId); this.domainId = domainId;
} }
public String getDomain() { public String getDomain() {

View File

@ -137,6 +137,7 @@ import com.cloud.network.security.dao.SecurityGroupDao;
import com.cloud.network.vpc.StaticRouteVO; import com.cloud.network.vpc.StaticRouteVO;
import com.cloud.network.vpc.VpcGatewayVO; import com.cloud.network.vpc.VpcGatewayVO;
import com.cloud.network.vpc.VpcManager; import com.cloud.network.vpc.VpcManager;
import com.cloud.network.vpc.VpcVO;
import com.cloud.network.vpc.dao.StaticRouteDao; import com.cloud.network.vpc.dao.StaticRouteDao;
import com.cloud.network.vpc.dao.VpcGatewayDao; import com.cloud.network.vpc.dao.VpcGatewayDao;
import com.cloud.offering.NetworkOffering; import com.cloud.offering.NetworkOffering;
@ -218,6 +219,7 @@ import com.cloud.vm.dao.DomainRouterDao;
import com.cloud.vm.dao.UserVmDao; import com.cloud.vm.dao.UserVmDao;
import com.cloud.vm.dao.UserVmDetailsDao; import com.cloud.vm.dao.UserVmDetailsDao;
import com.cloud.vm.dao.VMInstanceDao; import com.cloud.vm.dao.VMInstanceDao;
import com.cloud.network.vpc.dao.VpcDao;
public class ApiDBUtils { public class ApiDBUtils {
private static ManagementServer _ms; private static ManagementServer _ms;
@ -302,6 +304,7 @@ public class ApiDBUtils {
private static FirewallRulesDao _firewallRuleDao; private static FirewallRulesDao _firewallRuleDao;
private static StaticRouteDao _staticRouteDao; private static StaticRouteDao _staticRouteDao;
private static VpcGatewayDao _vpcGatewayDao; private static VpcGatewayDao _vpcGatewayDao;
private static VpcDao _vpcDao;
static { static {
_ms = (ManagementServer) ComponentLocator.getComponent(ManagementServer.Name); _ms = (ManagementServer) ComponentLocator.getComponent(ManagementServer.Name);
@ -385,6 +388,7 @@ public class ApiDBUtils {
_vpcGatewayDao = locator.getDao(VpcGatewayDao.class); _vpcGatewayDao = locator.getDao(VpcGatewayDao.class);
_asVmProfileDao = locator.getDao(AutoScaleVmProfileDao.class); _asVmProfileDao = locator.getDao(AutoScaleVmProfileDao.class);
_asVmGroupDao = locator.getDao(AutoScaleVmGroupDao.class); _asVmGroupDao = locator.getDao(AutoScaleVmGroupDao.class);
_vpcDao = locator.getDao(VpcDao.class);
// Note: stats collector should already have been initialized by this time, otherwise a null instance is returned // Note: stats collector should already have been initialized by this time, otherwise a null instance is returned
_statsCollector = StatsCollector.getInstance(); _statsCollector = StatsCollector.getInstance();
@ -1020,6 +1024,10 @@ public class ApiDBUtils {
public static GuestOSCategoryVO findGuestOsCategoryById(long catId){ public static GuestOSCategoryVO findGuestOsCategoryById(long catId){
return _guestOSCategoryDao.findById(catId); return _guestOSCategoryDao.findById(catId);
} }
public static VpcVO findVpcById(long vpcId){
return _vpcDao.findById(vpcId);
}
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// Newly Added Utility Methods for List API refactoring // // Newly Added Utility Methods for List API refactoring //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////

View File

@ -156,6 +156,7 @@ import com.cloud.network.Network.Capability;
import com.cloud.network.Network.Provider; import com.cloud.network.Network.Provider;
import com.cloud.network.Network.Service; import com.cloud.network.Network.Service;
import com.cloud.network.NetworkProfile; import com.cloud.network.NetworkProfile;
import com.cloud.network.NetworkVO;
import com.cloud.network.Networks.TrafficType; import com.cloud.network.Networks.TrafficType;
import com.cloud.network.PhysicalNetwork; import com.cloud.network.PhysicalNetwork;
import com.cloud.network.PhysicalNetworkServiceProvider; import com.cloud.network.PhysicalNetworkServiceProvider;
@ -196,6 +197,7 @@ import com.cloud.network.vpc.StaticRouteVO;
import com.cloud.network.vpc.Vpc; import com.cloud.network.vpc.Vpc;
import com.cloud.network.vpc.VpcGatewayVO; import com.cloud.network.vpc.VpcGatewayVO;
import com.cloud.network.vpc.VpcOffering; import com.cloud.network.vpc.VpcOffering;
import com.cloud.network.vpc.VpcVO;
import com.cloud.offering.DiskOffering; import com.cloud.offering.DiskOffering;
import com.cloud.offering.NetworkOffering; import com.cloud.offering.NetworkOffering;
import com.cloud.offering.ServiceOffering; import com.cloud.offering.ServiceOffering;
@ -451,14 +453,17 @@ public class ApiResponseHelper implements ResponseGenerator {
@Override @Override
public DiskOfferingResponse createDiskOfferingResponse(DiskOffering offering) { public DiskOfferingResponse createDiskOfferingResponse(DiskOffering offering) {
DiskOfferingResponse diskOfferingResponse = new DiskOfferingResponse(); DiskOfferingResponse diskOfferingResponse = new DiskOfferingResponse();
diskOfferingResponse.setId(offering.getId()); diskOfferingResponse.setId(offering.getUuid());
diskOfferingResponse.setName(offering.getName()); diskOfferingResponse.setName(offering.getName());
diskOfferingResponse.setDisplayText(offering.getDisplayText()); diskOfferingResponse.setDisplayText(offering.getDisplayText());
diskOfferingResponse.setCreated(offering.getCreated()); diskOfferingResponse.setCreated(offering.getCreated());
diskOfferingResponse.setDiskSize(offering.getDiskSize() / (1024 * 1024 * 1024)); diskOfferingResponse.setDiskSize(offering.getDiskSize() / (1024 * 1024 * 1024));
if (offering.getDomainId() != null) { if (offering.getDomainId() != null) {
diskOfferingResponse.setDomain(ApiDBUtils.findDomainById(offering.getDomainId()).getName()); Domain domain = ApiDBUtils.findDomainById(offering.getDomainId());
diskOfferingResponse.setDomainId(offering.getDomainId()); if (domain != null) {
diskOfferingResponse.setDomain(domain.getName());
diskOfferingResponse.setDomainId(domain.getUuid());
}
} }
diskOfferingResponse.setTags(offering.getTags()); diskOfferingResponse.setTags(offering.getTags());
diskOfferingResponse.setCustomized(offering.isCustomized()); diskOfferingResponse.setCustomized(offering.isCustomized());
@ -507,7 +512,7 @@ public class ApiResponseHelper implements ResponseGenerator {
@Override @Override
public ServiceOfferingResponse createServiceOfferingResponse(ServiceOffering offering) { public ServiceOfferingResponse createServiceOfferingResponse(ServiceOffering offering) {
ServiceOfferingResponse offeringResponse = new ServiceOfferingResponse(); ServiceOfferingResponse offeringResponse = new ServiceOfferingResponse();
offeringResponse.setId(offering.getId()); offeringResponse.setId(offering.getUuid());
offeringResponse.setName(offering.getName()); offeringResponse.setName(offering.getName());
offeringResponse.setIsSystemOffering(offering.getSystemUse()); offeringResponse.setIsSystemOffering(offering.getSystemUse());
offeringResponse.setDefaultUse(offering.getDefaultUse()); offeringResponse.setDefaultUse(offering.getDefaultUse());
@ -522,8 +527,11 @@ public class ApiResponseHelper implements ResponseGenerator {
offeringResponse.setLimitCpuUse(offering.getLimitCpuUse()); offeringResponse.setLimitCpuUse(offering.getLimitCpuUse());
offeringResponse.setTags(offering.getTags()); offeringResponse.setTags(offering.getTags());
if (offering.getDomainId() != null) { if (offering.getDomainId() != null) {
offeringResponse.setDomain(ApiDBUtils.findDomainById(offering.getDomainId()).getName()); Domain domain = ApiDBUtils.findDomainById(offering.getDomainId());
offeringResponse.setDomainId(offering.getDomainId()); if (domain != null) {
offeringResponse.setDomain(domain.getName());
offeringResponse.setDomainId(domain.getUuid());
}
} }
offeringResponse.setNetworkRate(offering.getRateMbps()); offeringResponse.setNetworkRate(offering.getRateMbps());
offeringResponse.setHostTag(offering.getHostTag()); offeringResponse.setHostTag(offering.getHostTag());
@ -788,13 +796,16 @@ public class ApiResponseHelper implements ResponseGenerator {
long zoneId = ipAddr.getDataCenterId(); long zoneId = ipAddr.getDataCenterId();
IPAddressResponse ipResponse = new IPAddressResponse(); IPAddressResponse ipResponse = new IPAddressResponse();
ipResponse.setId(ipAddr.getId()); ipResponse.setId(ipAddr.getUuid());
ipResponse.setIpAddress(ipAddr.getAddress().toString()); ipResponse.setIpAddress(ipAddr.getAddress().toString());
if (ipAddr.getAllocatedTime() != null) { if (ipAddr.getAllocatedTime() != null) {
ipResponse.setAllocated(ipAddr.getAllocatedTime()); ipResponse.setAllocated(ipAddr.getAllocatedTime());
} }
ipResponse.setZoneId(zoneId); DataCenterVO zone = ApiDBUtils.findZoneById(ipAddr.getDataCenterId());
ipResponse.setZoneName(ApiDBUtils.findZoneById(ipAddr.getDataCenterId()).getName()); if (zone != null) {
ipResponse.setZoneId(zone.getUuid());
ipResponse.setZoneName(zone.getName());
}
ipResponse.setSourceNat(ipAddr.isSourceNat()); ipResponse.setSourceNat(ipAddr.isSourceNat());
ipResponse.setIsSystem(ipAddr.getSystem()); ipResponse.setIsSystem(ipAddr.getSystem());
@ -808,24 +819,34 @@ public class ApiResponseHelper implements ResponseGenerator {
if (ipAddr.getAssociatedWithVmId() != null) { if (ipAddr.getAssociatedWithVmId() != null) {
UserVm vm = ApiDBUtils.findUserVmById(ipAddr.getAssociatedWithVmId()); UserVm vm = ApiDBUtils.findUserVmById(ipAddr.getAssociatedWithVmId());
ipResponse.setVirtualMachineId(vm.getId()); if (vm != null) {
ipResponse.setVirtualMachineName(vm.getHostName()); ipResponse.setVirtualMachineId(vm.getUuid());
if (vm.getDisplayName() != null) { ipResponse.setVirtualMachineName(vm.getHostName());
ipResponse.setVirtualMachineDisplayName(vm.getDisplayName()); if (vm.getDisplayName() != null) {
} else { ipResponse.setVirtualMachineDisplayName(vm.getDisplayName());
ipResponse.setVirtualMachineDisplayName(vm.getHostName()); } else {
ipResponse.setVirtualMachineDisplayName(vm.getHostName());
}
} }
} }
if (ipAddr.getAssociatedWithNetworkId() != null) { if (ipAddr.getAssociatedWithNetworkId() != null) {
Network ntwk = ApiDBUtils.findNetworkById(ipAddr.getAssociatedWithNetworkId()); Network ntwk = ApiDBUtils.findNetworkById(ipAddr.getAssociatedWithNetworkId());
ipResponse.setAssociatedNetworkId(ipAddr.getAssociatedWithNetworkId()); if (ntwk != null) {
ipResponse.setAssociatedNetworkName(ntwk.getName()); ipResponse.setAssociatedNetworkId(ntwk.getUuid());
ipResponse.setAssociatedNetworkName(ntwk.getName());
}
} }
ipResponse.setVpcId(ipAddr.getVpcId()); if (ipAddr.getVpcId() != null) {
VpcVO vpc = ApiDBUtils.findVpcById(ipAddr.getVpcId());
if (vpc != null) {
ipResponse.setVpcId(vpc.getUuid());
}
}
// Network id the ip is associated with (if associated networkId is null, try to get this information from vlan) // Network id the ip is associated with (if associated networkId is
// null, try to get this information from vlan)
Long vlanNetworkId = ApiDBUtils.getVlanNetworkId(ipAddr.getVlanId()); Long vlanNetworkId = ApiDBUtils.getVlanNetworkId(ipAddr.getVlanId());
// Network id the ip belongs to // Network id the ip belongs to
@ -836,15 +857,29 @@ public class ApiResponseHelper implements ResponseGenerator {
networkId = ApiDBUtils.getPublicNetworkIdByZone(zoneId); networkId = ApiDBUtils.getPublicNetworkIdByZone(zoneId);
} }
ipResponse.setNetworkId(networkId); if (networkId != null) {
NetworkVO nw = ApiDBUtils.findNetworkById(networkId);
if (nw != null) {
ipResponse.setNetworkId(nw.getUuid());
}
}
ipResponse.setState(ipAddr.getState().toString()); ipResponse.setState(ipAddr.getState().toString());
ipResponse.setPhysicalNetworkId(ipAddr.getPhysicalNetworkId());
if (ipAddr.getPhysicalNetworkId() != null) {
PhysicalNetworkVO pnw = ApiDBUtils.findPhysicalNetworkById(ipAddr.getPhysicalNetworkId());
if (pnw != null) {
ipResponse.setPhysicalNetworkId(pnw.getUuid());
}
}
// show this info to admin only // show this info to admin only
Account account = UserContext.current().getCaller(); Account account = UserContext.current().getCaller();
if (account.getType() == Account.ACCOUNT_TYPE_ADMIN) { if (account.getType() == Account.ACCOUNT_TYPE_ADMIN) {
ipResponse.setVlanId(ipAddr.getVlanId()); VlanVO vl = ApiDBUtils.findVlanById(ipAddr.getVlanId());
ipResponse.setVlanName(ApiDBUtils.findVlanById(ipAddr.getVlanId()).getVlanTag()); if (vl != null) {
ipResponse.setVlanId(vl.getUuid());
ipResponse.setVlanName(vl.getVlanTag());
}
} }
if (ipAddr.getSystem()) { if (ipAddr.getSystem()) {
@ -1297,7 +1332,7 @@ public class ApiResponseHelper implements ResponseGenerator {
@Override @Override
public FirewallRuleResponse createPortForwardingRuleResponse(PortForwardingRule fwRule) { public FirewallRuleResponse createPortForwardingRuleResponse(PortForwardingRule fwRule) {
FirewallRuleResponse response = new FirewallRuleResponse(); FirewallRuleResponse response = new FirewallRuleResponse();
response.setId(fwRule.getId()); response.setId(fwRule.getUuid());
response.setPrivateStartPort(Integer.toString(fwRule.getDestinationPortStart())); response.setPrivateStartPort(Integer.toString(fwRule.getDestinationPortStart()));
response.setPrivateEndPort(Integer.toString(fwRule.getDestinationPortEnd())); response.setPrivateEndPort(Integer.toString(fwRule.getDestinationPortEnd()));
response.setProtocol(fwRule.getProtocol()); response.setProtocol(fwRule.getProtocol());
@ -1307,13 +1342,13 @@ public class ApiResponseHelper implements ResponseGenerator {
response.setCidrList(StringUtils.join(cidrs, ",")); response.setCidrList(StringUtils.join(cidrs, ","));
IpAddress ip = ApiDBUtils.findIpAddressById(fwRule.getSourceIpAddressId()); IpAddress ip = ApiDBUtils.findIpAddressById(fwRule.getSourceIpAddressId());
response.setPublicIpAddressId(ip.getId()); response.setPublicIpAddressId(ip.getUuid());
response.setPublicIpAddress(ip.getAddress().addr()); response.setPublicIpAddress(ip.getAddress().addr());
if (ip != null && fwRule.getDestinationIpAddress() != null) { if (ip != null && fwRule.getDestinationIpAddress() != null) {
UserVm vm = ApiDBUtils.findUserVmById(fwRule.getVirtualMachineId()); UserVm vm = ApiDBUtils.findUserVmById(fwRule.getVirtualMachineId());
if (vm != null) { if (vm != null) {
response.setVirtualMachineId(vm.getId()); response.setVirtualMachineId(vm.getUuid());
response.setVirtualMachineName(vm.getHostName()); response.setVirtualMachineName(vm.getHostName());
if (vm.getDisplayName() != null) { if (vm.getDisplayName() != null) {
@ -2758,7 +2793,7 @@ public class ApiResponseHelper implements ResponseGenerator {
public FirewallResponse createFirewallResponse(FirewallRule fwRule) { public FirewallResponse createFirewallResponse(FirewallRule fwRule) {
FirewallResponse response = new FirewallResponse(); FirewallResponse response = new FirewallResponse();
response.setId(fwRule.getId()); response.setId(fwRule.getUuid());
response.setProtocol(fwRule.getProtocol()); response.setProtocol(fwRule.getProtocol());
if (fwRule.getSourcePortStart() != null) { if (fwRule.getSourcePortStart() != null) {
response.setStartPort(Integer.toString(fwRule.getSourcePortStart())); response.setStartPort(Integer.toString(fwRule.getSourcePortStart()));
@ -2844,7 +2879,7 @@ public class ApiResponseHelper implements ResponseGenerator {
@Override @Override
public HypervisorCapabilitiesResponse createHypervisorCapabilitiesResponse(HypervisorCapabilities hpvCapabilities) { public HypervisorCapabilitiesResponse createHypervisorCapabilitiesResponse(HypervisorCapabilities hpvCapabilities) {
HypervisorCapabilitiesResponse hpvCapabilitiesResponse = new HypervisorCapabilitiesResponse(); HypervisorCapabilitiesResponse hpvCapabilitiesResponse = new HypervisorCapabilitiesResponse();
hpvCapabilitiesResponse.setId(hpvCapabilities.getId()); hpvCapabilitiesResponse.setId(hpvCapabilities.getUuid());
hpvCapabilitiesResponse.setHypervisor(hpvCapabilities.getHypervisorType()); hpvCapabilitiesResponse.setHypervisor(hpvCapabilities.getHypervisorType());
hpvCapabilitiesResponse.setHypervisorVersion(hpvCapabilities.getHypervisorVersion()); hpvCapabilitiesResponse.setHypervisorVersion(hpvCapabilities.getHypervisorVersion());
hpvCapabilitiesResponse.setIsSecurityGroupEnabled(hpvCapabilities.isSecurityGroupEnabled()); hpvCapabilitiesResponse.setIsSecurityGroupEnabled(hpvCapabilities.isSecurityGroupEnabled());

View File

@ -5,7 +5,7 @@
// to you under the Apache License, Version 2.0 (the // to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance // "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at // with the License. You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, // Unless required by applicable law or agreed to in writing,
@ -40,12 +40,12 @@ import com.cloud.utils.net.Ip;
*/ */
@Entity @Entity
@Table(name=("user_ip_address")) @Table(name=("user_ip_address"))
public class IPAddressVO implements IpAddress, Identity { public class IPAddressVO implements IpAddress {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")
long id; long id;
@Column(name="account_id") @Column(name="account_id")
private Long allocatedToAccountId = null; private Long allocatedToAccountId = null;
@ -59,59 +59,59 @@ public class IPAddressVO implements IpAddress, Identity {
@Column(name="data_center_id", updatable=false) @Column(name="data_center_id", updatable=false)
private long dataCenterId; private long dataCenterId;
@Column(name="source_nat") @Column(name="source_nat")
private boolean sourceNat; private boolean sourceNat;
@Column(name="allocated") @Column(name="allocated")
@Temporal(value=TemporalType.TIMESTAMP) @Temporal(value=TemporalType.TIMESTAMP)
private Date allocatedTime; private Date allocatedTime;
@Column(name="vlan_db_id") @Column(name="vlan_db_id")
private long vlanId; private long vlanId;
@Column(name="one_to_one_nat") @Column(name="one_to_one_nat")
private boolean oneToOneNat; private boolean oneToOneNat;
@Column(name="vm_id") @Column(name="vm_id")
private Long associatedWithVmId; private Long associatedWithVmId;
@Column(name="state") @Column(name="state")
private State state; private State state;
@Column(name="mac_address") @Column(name="mac_address")
private long macAddress; private long macAddress;
@Column(name="source_network_id") @Column(name="source_network_id")
private Long sourceNetworkId; private Long sourceNetworkId;
@Column(name="network_id") @Column(name="network_id")
private Long associatedWithNetworkId; private Long associatedWithNetworkId;
@Column(name="uuid") @Column(name="uuid")
private String uuid; private String uuid;
@Column(name="physical_network_id") @Column(name="physical_network_id")
private Long physicalNetworkId; private Long physicalNetworkId;
@Column(name="is_system") @Column(name="is_system")
private boolean system; private boolean system;
@Column(name="account_id") @Column(name="account_id")
@Transient @Transient
private Long accountId = null; private Long accountId = null;
@Transient @Transient
@Column(name="domain_id") @Column(name="domain_id")
private Long domainId = null; private Long domainId = null;
@Column(name="vpc_id") @Column(name="vpc_id")
private Long vpcId; private Long vpcId;
protected IPAddressVO() { protected IPAddressVO() {
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
@Override @Override
public boolean readyToUse() { public boolean readyToUse() {
return state == State.Allocated; return state == State.Allocated;
@ -129,36 +129,36 @@ public class IPAddressVO implements IpAddress, Identity {
this.macAddress = macAddress; this.macAddress = macAddress;
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
public long getMacAddress() { public long getMacAddress() {
return macAddress; return macAddress;
} }
@Override @Override
public long getDataCenterId() { public long getDataCenterId() {
return dataCenterId; return dataCenterId;
} }
@Override @Override
public Ip getAddress() { public Ip getAddress() {
return address; return address;
} }
@Override @Override
public Long getAllocatedToAccountId() { public Long getAllocatedToAccountId() {
return allocatedToAccountId; return allocatedToAccountId;
} }
@Override @Override
public Long getAllocatedInDomainId() { public Long getAllocatedInDomainId() {
return allocatedInDomainId; return allocatedInDomainId;
} }
@Override @Override
public Long getAssociatedWithNetworkId() { public Long getAssociatedWithNetworkId() {
return associatedWithNetworkId; return associatedWithNetworkId;
} }
public void setAssociatedWithNetworkId(Long networkId) { public void setAssociatedWithNetworkId(Long networkId) {
this.associatedWithNetworkId = networkId; this.associatedWithNetworkId = networkId;
} }
@ -171,7 +171,7 @@ public class IPAddressVO implements IpAddress, Identity {
public void setAssociatedWithVmId(Long associatedWithVmId) { public void setAssociatedWithVmId(Long associatedWithVmId) {
this.associatedWithVmId = associatedWithVmId; this.associatedWithVmId = associatedWithVmId;
} }
@Override @Override
public Date getAllocatedTime() { public Date getAllocatedTime() {
return allocatedTime; return allocatedTime;
@ -188,7 +188,7 @@ public class IPAddressVO implements IpAddress, Identity {
public void setSourceNat(boolean sourceNat) { public void setSourceNat(boolean sourceNat) {
this.sourceNat = sourceNat; this.sourceNat = sourceNat;
} }
@Override @Override
public boolean isSourceNat() { public boolean isSourceNat() {
return sourceNat; return sourceNat;
@ -197,12 +197,12 @@ public class IPAddressVO implements IpAddress, Identity {
public void setAllocatedTime(Date allocated) { public void setAllocatedTime(Date allocated) {
this.allocatedTime = allocated; this.allocatedTime = allocated;
} }
@Override @Override
public long getVlanId() { public long getVlanId() {
return this.vlanId; return this.vlanId;
} }
public void setVlanId(long vlanDbId) { public void setVlanId(long vlanDbId) {
this.vlanId = vlanDbId; this.vlanId = vlanDbId;
} }
@ -215,31 +215,31 @@ public class IPAddressVO implements IpAddress, Identity {
public void setOneToOneNat(boolean oneToOneNat) { public void setOneToOneNat(boolean oneToOneNat) {
this.oneToOneNat = oneToOneNat; this.oneToOneNat = oneToOneNat;
} }
@Override @Override
public long getDomainId() { public long getDomainId() {
return allocatedInDomainId == null ? -1 : allocatedInDomainId; return allocatedInDomainId == null ? -1 : allocatedInDomainId;
} }
@Override @Override
public long getAccountId() { public long getAccountId() {
return allocatedToAccountId == null ? -1 : allocatedToAccountId; return allocatedToAccountId == null ? -1 : allocatedToAccountId;
} }
@Override @Override
public State getState() { public State getState() {
return state; return state;
} }
public void setState(State state) { public void setState(State state) {
this.state = state; this.state = state;
} }
@Override @Override
public String toString() { public String toString() {
return new StringBuilder("Ip[").append(address).append("-").append(dataCenterId).append("]").toString(); return new StringBuilder("Ip[").append(address).append("-").append(dataCenterId).append("]").toString();
} }
@Override @Override
public long getId() { public long getId() {
return id; return id;
@ -252,12 +252,12 @@ public class IPAddressVO implements IpAddress, Identity {
public void setSourceNetworkId(Long sourceNetworkId) { public void setSourceNetworkId(Long sourceNetworkId) {
this.sourceNetworkId = sourceNetworkId; this.sourceNetworkId = sourceNetworkId;
} }
@Override @Override
public String getUuid() { public String getUuid() {
return this.uuid; return this.uuid;
} }
public void setUuid(String uuid) { public void setUuid(String uuid) {
this.uuid = uuid; this.uuid = uuid;
} }
@ -269,7 +269,7 @@ public class IPAddressVO implements IpAddress, Identity {
public void setPhysicalNetworkId(Long physicalNetworkId) { public void setPhysicalNetworkId(Long physicalNetworkId) {
this.physicalNetworkId = physicalNetworkId; this.physicalNetworkId = physicalNetworkId;
} }
@Override @Override
public boolean getSystem() { public boolean getSystem() {
return system; return system;

View File

@ -5,7 +5,7 @@
// to you under the Apache License, Version 2.0 (the // to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance // "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at // with the License. You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, // Unless required by applicable law or agreed to in writing,
@ -44,7 +44,7 @@ import com.cloud.utils.net.NetUtils;
*/ */
@Entity @Entity
@Table(name="networks") @Table(name="networks")
public class NetworkVO implements Network, Identity { public class NetworkVO implements Network {
@Id @Id
@TableGenerator(name="networks_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="networks_seq", allocationSize=1) @TableGenerator(name="networks_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="networks_seq", allocationSize=1)
@Column(name="id") @Column(name="id")
@ -79,13 +79,13 @@ public class NetworkVO implements Network, Identity {
@Column(name="network_offering_id") @Column(name="network_offering_id")
long networkOfferingId; long networkOfferingId;
@Column(name="vpc_id") @Column(name="vpc_id")
Long vpcId; Long vpcId;
@Column(name="physical_network_id") @Column(name="physical_network_id")
Long physicalNetworkId; Long physicalNetworkId;
@Column(name="data_center_id") @Column(name="data_center_id")
long dataCenterId; long dataCenterId;
@ -132,24 +132,24 @@ public class NetworkVO implements Network, Identity {
@Column(name="reservation_id") @Column(name="reservation_id")
String reservationId; String reservationId;
@Column(name="uuid") @Column(name="uuid")
String uuid; String uuid;
@Column(name="guest_type") @Column(name="guest_type")
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
Network.GuestType guestType; Network.GuestType guestType;
@Column(name="acl_type") @Column(name="acl_type")
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
ControlledEntity.ACLType aclType; ControlledEntity.ACLType aclType;
@Column(name="restart_required") @Column(name="restart_required")
boolean restartRequired = false; boolean restartRequired = false;
@Column(name="specify_ip_ranges") @Column(name="specify_ip_ranges")
boolean specifyIpRanges = false; boolean specifyIpRanges = false;
public NetworkVO() { public NetworkVO() {
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
@ -181,8 +181,8 @@ public class NetworkVO implements Network, Identity {
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
public NetworkVO(long id, Network that, long offeringId, String guruName, long domainId, long accountId, public NetworkVO(long id, Network that, long offeringId, String guruName, long domainId, long accountId,
long related, String name, String displayText, String networkDomain, GuestType guestType, long dcId, long related, String name, String displayText, String networkDomain, GuestType guestType, long dcId,
Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId) { Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId) {
this(id, that.getTrafficType(), that.getMode(), that.getBroadcastDomainType(), offeringId, domainId, accountId, this(id, that.getTrafficType(), that.getMode(), that.getBroadcastDomainType(), offeringId, domainId, accountId,
related, name, displayText, networkDomain, guestType, dcId, physicalNetworkId, aclType, specifyIpRanges, vpcId); related, name, displayText, networkDomain, guestType, dcId, physicalNetworkId, aclType, specifyIpRanges, vpcId);
@ -215,8 +215,8 @@ public class NetworkVO implements Network, Identity {
* @param vpcId TODO * @param vpcId TODO
* @param dataCenterId * @param dataCenterId
*/ */
public NetworkVO(long id, TrafficType trafficType, Mode mode, BroadcastDomainType broadcastDomainType, public NetworkVO(long id, TrafficType trafficType, Mode mode, BroadcastDomainType broadcastDomainType,
long networkOfferingId, long domainId, long accountId, long related, String name, String displayText, long networkOfferingId, long domainId, long accountId, long related, String name, String displayText,
String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId) { String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId) {
this(trafficType, mode, broadcastDomainType, networkOfferingId, State.Allocated, dcId, physicalNetworkId); this(trafficType, mode, broadcastDomainType, networkOfferingId, State.Allocated, dcId, physicalNetworkId);
this.domainId = domainId; this.domainId = domainId;
@ -368,7 +368,7 @@ public class NetworkVO implements Network, Identity {
public Long getPhysicalNetworkId() { public Long getPhysicalNetworkId() {
return physicalNetworkId; return physicalNetworkId;
} }
@Override @Override
public void setPhysicalNetworkId(Long physicalNetworkId) { public void setPhysicalNetworkId(Long physicalNetworkId) {
this.physicalNetworkId = physicalNetworkId; this.physicalNetworkId = physicalNetworkId;
@ -428,7 +428,7 @@ public class NetworkVO implements Network, Identity {
public void setCreated(Date created) { public void setCreated(Date created) {
this.created = created; this.created = created;
} }
@Override @Override
public Network.GuestType getGuestType() { public Network.GuestType getGuestType() {
return guestType; return guestType;
@ -465,7 +465,7 @@ public class NetworkVO implements Network, Identity {
public String getUuid() { public String getUuid() {
return this.uuid; return this.uuid;
} }
public void setUuid(String uuid) { public void setUuid(String uuid) {
this.uuid = uuid; this.uuid = uuid;
} }
@ -482,7 +482,7 @@ public class NetworkVO implements Network, Identity {
public boolean isRestartRequired() { public boolean isRestartRequired() {
return restartRequired; return restartRequired;
} }
@Override @Override
public boolean getSpecifyIpRanges() { public boolean getSpecifyIpRanges() {
return specifyIpRanges; return specifyIpRanges;

View File

@ -5,7 +5,7 @@
// to you under the Apache License, Version 2.0 (the // to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance // "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at // with the License. You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, // Unless required by applicable law or agreed to in writing,
@ -36,52 +36,52 @@ public class PublicIp implements PublicIpAddress {
_vlan = vlan; _vlan = vlan;
this.macAddress = NetUtils.long2Mac(macAddress); this.macAddress = NetUtils.long2Mac(macAddress);
} }
@Override @Override
public Ip getAddress() { public Ip getAddress() {
return _addr.getAddress(); return _addr.getAddress();
} }
@Override @Override
public String getNetmask() { public String getNetmask() {
return _vlan.getVlanNetmask(); return _vlan.getVlanNetmask();
} }
@Override @Override
public String getGateway() { public String getGateway() {
return _vlan.getVlanGateway(); return _vlan.getVlanGateway();
} }
@Override @Override
public String getVlanTag() { public String getVlanTag() {
return _vlan.getVlanTag(); return _vlan.getVlanTag();
} }
@Override @Override
public long getDataCenterId() { public long getDataCenterId() {
return _addr.getDataCenterId(); return _addr.getDataCenterId();
} }
@Override @Override
public boolean readyToUse() { public boolean readyToUse() {
return _addr.getAllocatedTime() != null && _addr.getState() == State.Allocated; return _addr.getAllocatedTime() != null && _addr.getState() == State.Allocated;
} }
@Override @Override
public boolean isSourceNat() { public boolean isSourceNat() {
return _addr.isSourceNat(); return _addr.isSourceNat();
} }
@Override @Override
public boolean isOneToOneNat() { public boolean isOneToOneNat() {
return _addr.isOneToOneNat(); return _addr.isOneToOneNat();
} }
@Override @Override
public Long getAssociatedWithVmId() { public Long getAssociatedWithVmId() {
return _addr.getAssociatedWithVmId(); return _addr.getAssociatedWithVmId();
} }
@Override @Override
public Date getAllocatedTime() { public Date getAllocatedTime() {
return _addr.getAllocatedTime(); return _addr.getAllocatedTime();
@ -106,25 +106,25 @@ public class PublicIp implements PublicIpAddress {
public State getState() { public State getState() {
return _addr.getState(); return _addr.getState();
} }
public IPAddressVO ip() { public IPAddressVO ip() {
return _addr; return _addr;
} }
public VlanVO vlan() { public VlanVO vlan() {
return _vlan; return _vlan;
} }
@Override @Override
public String getMacAddress() { public String getMacAddress() {
return macAddress; return macAddress;
} }
@Override @Override
public Long getAssociatedWithNetworkId() { public Long getAssociatedWithNetworkId() {
return _addr.getAssociatedWithNetworkId(); return _addr.getAssociatedWithNetworkId();
} }
@Override @Override
public Long getNetworkId() { public Long getNetworkId() {
return _vlan.getNetworkId(); return _vlan.getNetworkId();
@ -149,12 +149,18 @@ public class PublicIp implements PublicIpAddress {
public VlanType getVlanType() { public VlanType getVlanType() {
return _vlan.getVlanType(); return _vlan.getVlanType();
} }
@Override @Override
public long getId() { public long getId() {
return _addr.getId(); return _addr.getId();
} }
@Override
public String getUuid() {
return _addr.getUuid();
}
@Override @Override
public String toString() { public String toString() {
return _addr.getAddress().toString(); return _addr.getAddress().toString();
@ -179,7 +185,7 @@ public class PublicIp implements PublicIpAddress {
public Long getAllocatedInDomainId() { public Long getAllocatedInDomainId() {
return _addr.getAllocatedInDomainId(); return _addr.getAllocatedInDomainId();
} }
@Override @Override
public boolean getSystem() { public boolean getSystem() {
return _addr.getSystem(); return _addr.getSystem();

View File

@ -5,7 +5,7 @@
// to you under the Apache License, Version 2.0 (the // to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance // "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at // with the License. You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, // Unless required by applicable law or agreed to in writing,
@ -44,69 +44,69 @@ import com.cloud.utils.net.NetUtils;
@Table(name="firewall_rules") @Table(name="firewall_rules")
@Inheritance(strategy=InheritanceType.JOINED) @Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="purpose", discriminatorType=DiscriminatorType.STRING, length=32) @DiscriminatorColumn(name="purpose", discriminatorType=DiscriminatorType.STRING, length=32)
public class FirewallRuleVO implements Identity, FirewallRule { public class FirewallRuleVO implements FirewallRule {
protected final FirewallRulesCidrsDaoImpl _firewallRulesCidrsDao = ComponentLocator.inject(FirewallRulesCidrsDaoImpl.class); protected final FirewallRulesCidrsDaoImpl _firewallRulesCidrsDao = ComponentLocator.inject(FirewallRulesCidrsDaoImpl.class);
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")
long id; long id;
@GeneratedValue(strategy=GenerationType.AUTO) @GeneratedValue(strategy=GenerationType.AUTO)
@Column(name=GenericDao.XID_COLUMN) @Column(name=GenericDao.XID_COLUMN)
String xId; String xId;
@Column(name="domain_id", updatable=false) @Column(name="domain_id", updatable=false)
long domainId; long domainId;
@Column(name="account_id", updatable=false) @Column(name="account_id", updatable=false)
long accountId; long accountId;
@Column(name="ip_address_id", updatable=false) @Column(name="ip_address_id", updatable=false)
Long sourceIpAddressId; Long sourceIpAddressId;
@Column(name="start_port", updatable=false) @Column(name="start_port", updatable=false)
Integer sourcePortStart; Integer sourcePortStart;
@Column(name="end_port", updatable=false) @Column(name="end_port", updatable=false)
Integer sourcePortEnd; Integer sourcePortEnd;
@Column(name="protocol", updatable=false) @Column(name="protocol", updatable=false)
String protocol = NetUtils.TCP_PROTO; String protocol = NetUtils.TCP_PROTO;
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
@Column(name="purpose") @Column(name="purpose")
Purpose purpose; Purpose purpose;
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
@Column(name="state") @Column(name="state")
State state; State state;
@Column(name=GenericDao.CREATED_COLUMN) @Column(name=GenericDao.CREATED_COLUMN)
Date created; Date created;
@Column(name="network_id") @Column(name="network_id")
long networkId; long networkId;
@Column(name="icmp_code") @Column(name="icmp_code")
Integer icmpCode; Integer icmpCode;
@Column(name="icmp_type") @Column(name="icmp_type")
Integer icmpType; Integer icmpType;
@Column(name="related") @Column(name="related")
Long related; Long related;
@Column(name="type") @Column(name="type")
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
FirewallRuleType type; FirewallRuleType type;
@Column(name="traffic_type") @Column(name="traffic_type")
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
TrafficType trafficType; TrafficType trafficType;
// This is a delayed load value. If the value is null, // This is a delayed load value. If the value is null,
// then this field has not been loaded yet. // then this field has not been loaded yet.
// Call firewallrules dao to load it. // Call firewallrules dao to load it.
@ -124,7 +124,7 @@ public class FirewallRuleVO implements Identity, FirewallRule {
public List<String> getSourceCidrList() { public List<String> getSourceCidrList() {
if (sourceCidrs == null && (purpose == Purpose.Firewall || purpose == Purpose.NetworkACL)) { if (sourceCidrs == null && (purpose == Purpose.Firewall || purpose == Purpose.NetworkACL)) {
return _firewallRulesCidrsDao.getSourceCidrs(id); return _firewallRulesCidrsDao.getSourceCidrs(id);
} }
return sourceCidrs; return sourceCidrs;
} }
@ -167,7 +167,7 @@ public class FirewallRuleVO implements Identity, FirewallRule {
public String getProtocol() { public String getProtocol() {
return protocol; return protocol;
} }
public void setState(State state) { public void setState(State state) {
this.state = state; this.state = state;
} }
@ -176,17 +176,17 @@ public class FirewallRuleVO implements Identity, FirewallRule {
public Purpose getPurpose() { public Purpose getPurpose() {
return purpose; return purpose;
} }
@Override @Override
public State getState() { public State getState() {
return state; return state;
} }
@Override @Override
public long getNetworkId() { public long getNetworkId() {
return networkId; return networkId;
} }
@Override @Override
public FirewallRuleType getType() { public FirewallRuleType getType() {
return type; return type;
@ -194,12 +194,12 @@ public class FirewallRuleVO implements Identity, FirewallRule {
public Date getCreated() { public Date getCreated() {
return created; return created;
} }
protected FirewallRuleVO() { protected FirewallRuleVO() {
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
public FirewallRuleVO(String xId, Long ipAddressId, Integer portStart, Integer portEnd, String protocol, public FirewallRuleVO(String xId, Long ipAddressId, Integer portStart, Integer portEnd, String protocol,
long networkId, long accountId, long domainId, Purpose purpose, List<String> sourceCidrs, Integer icmpCode, long networkId, long accountId, long domainId, Purpose purpose, List<String> sourceCidrs, Integer icmpCode,
Integer icmpType, Long related, TrafficType trafficType) { Integer icmpType, Long related, TrafficType trafficType) {
this.xId = xId; this.xId = xId;
@ -208,11 +208,11 @@ public class FirewallRuleVO implements Identity, FirewallRule {
} }
this.accountId = accountId; this.accountId = accountId;
this.domainId = domainId; this.domainId = domainId;
if (ipAddressId == null) { if (ipAddressId == null) {
assert (purpose == Purpose.NetworkACL) : "ipAddressId can be null for " + Purpose.NetworkACL + " only"; assert (purpose == Purpose.NetworkACL) : "ipAddressId can be null for " + Purpose.NetworkACL + " only";
} }
this.sourceIpAddressId = ipAddressId; this.sourceIpAddressId = ipAddressId;
this.sourcePortStart = portStart; this.sourcePortStart = portStart;
this.sourcePortEnd = portEnd; this.sourcePortEnd = portEnd;
@ -223,28 +223,28 @@ public class FirewallRuleVO implements Identity, FirewallRule {
this.icmpCode = icmpCode; this.icmpCode = icmpCode;
this.icmpType = icmpType; this.icmpType = icmpType;
this.sourceCidrs = sourceCidrs; this.sourceCidrs = sourceCidrs;
if (related != null) { if (related != null) {
assert (purpose == Purpose.Firewall) : "related field can be set for rule of purpose " + Purpose.Firewall + " only"; assert (purpose == Purpose.Firewall) : "related field can be set for rule of purpose " + Purpose.Firewall + " only";
} }
this.related = related; this.related = related;
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
this.type = FirewallRuleType.User; this.type = FirewallRuleType.User;
this.trafficType = trafficType; this.trafficType = trafficType;
} }
public FirewallRuleVO(String xId, long ipAddressId, int port, String protocol, long networkId, long accountId, public FirewallRuleVO(String xId, long ipAddressId, int port, String protocol, long networkId, long accountId,
long domainId, Purpose purpose, List<String> sourceCidrs, Integer icmpCode, Integer icmpType, Long related) { long domainId, Purpose purpose, List<String> sourceCidrs, Integer icmpCode, Integer icmpType, Long related) {
this(xId, ipAddressId, port, port, protocol, networkId, accountId, domainId, purpose, sourceCidrs, icmpCode, icmpType, related, null); this(xId, ipAddressId, port, port, protocol, networkId, accountId, domainId, purpose, sourceCidrs, icmpCode, icmpType, related, null);
} }
@Override @Override
public String toString() { public String toString() {
return new StringBuilder("Rule[").append(id).append("-").append(purpose).append("-").append(state).append("]").toString(); return new StringBuilder("Rule[").append(id).append("-").append(purpose).append("-").append(state).append("]").toString();
} }
@Override @Override
public Integer getIcmpCode() { public Integer getIcmpCode() {
return icmpCode; return icmpCode;
@ -259,16 +259,16 @@ public class FirewallRuleVO implements Identity, FirewallRule {
public Long getRelated() { public Long getRelated() {
return related; return related;
} }
@Override @Override
public String getUuid() { public String getUuid() {
return this.uuid; return this.uuid;
} }
public void setUuid(String uuid) { public void setUuid(String uuid) {
this.uuid = uuid; this.uuid = uuid;
} }
public void setType(FirewallRuleType type) { public void setType(FirewallRuleType type) {
this.type = type; this.type = type;
} }

View File

@ -5,7 +5,7 @@
// to you under the Apache License, Version 2.0 (the // to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance // "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at // with the License. You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, // Unless required by applicable law or agreed to in writing,
@ -22,6 +22,7 @@ import java.util.List;
public class StaticNatRuleImpl implements StaticNatRule{ public class StaticNatRuleImpl implements StaticNatRule{
long id; long id;
String xid; String xid;
String uuid;
String protocol; String protocol;
int portStart; int portStart;
int portEnd; int portEnd;
@ -32,9 +33,10 @@ public class StaticNatRuleImpl implements StaticNatRule{
long sourceIpAddressId; long sourceIpAddressId;
String destIpAddress; String destIpAddress;
public StaticNatRuleImpl(FirewallRuleVO rule, String dstIp) { public StaticNatRuleImpl(FirewallRuleVO rule, String dstIp) {
this.id = rule.getId(); this.id = rule.getId();
this.xid = rule.getXid(); this.xid = rule.getXid();
this.uuid = rule.getUuid();
this.protocol = rule.getProtocol(); this.protocol = rule.getProtocol();
this.portStart = rule.getSourcePortStart(); this.portStart = rule.getSourcePortStart();
this.portEnd = rule.getSourcePortEnd(); this.portEnd = rule.getSourcePortEnd();
@ -55,7 +57,7 @@ public class StaticNatRuleImpl implements StaticNatRule{
public Integer getSourcePortEnd() { public Integer getSourcePortEnd() {
return portEnd; return portEnd;
} }
@Override @Override
public Purpose getPurpose() { public Purpose getPurpose() {
return Purpose.StaticNat; return Purpose.StaticNat;
@ -65,17 +67,17 @@ public class StaticNatRuleImpl implements StaticNatRule{
public State getState() { public State getState() {
return state; return state;
} }
@Override @Override
public long getAccountId() { public long getAccountId() {
return accountId; return accountId;
} }
@Override @Override
public long getDomainId() { public long getDomainId() {
return domainId; return domainId;
} }
@Override @Override
public long getNetworkId() { public long getNetworkId() {
return networkId; return networkId;
@ -105,12 +107,18 @@ public class StaticNatRuleImpl implements StaticNatRule{
public String getXid() { public String getXid() {
return xid; return xid;
} }
@Override
public String getUuid() {
return uuid;
}
@Override @Override
public Integer getIcmpCode() { public Integer getIcmpCode() {
return null; return null;
} }
@Override @Override
public Integer getIcmpType() { public Integer getIcmpType() {
return null; return null;
@ -130,7 +138,7 @@ public class StaticNatRuleImpl implements StaticNatRule{
public FirewallRuleType getType() { public FirewallRuleType getType() {
return FirewallRuleType.User; return FirewallRuleType.User;
} }
@Override @Override
public TrafficType getTrafficType() { public TrafficType getTrafficType() {
return null; return null;