Conflicts:

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

Signed-off-by: Min Chen <min.chen@citrix.com>
This commit is contained in:
Min Chen 2012-12-17 15:41:56 -08:00
parent de8aa86542
commit 348d3ae448
18 changed files with 290 additions and 273 deletions

View File

@ -31,6 +31,8 @@ public interface DataCenter extends Grouping {
long getId(); long getId();
String getUuid();
String getDns1(); String getDns1();
String getDns2(); String getDns2();

View File

@ -33,6 +33,8 @@ public interface Domain extends OwnedBy {
long getId(); long getId();
String getUuid();
Long getParent(); Long getParent();
void setParent(Long parent); void setParent(Long parent);

View File

@ -66,6 +66,8 @@ public interface Host extends StateObject<Status> {
*/ */
long getId(); long getId();
String getUuid();
/** /**
* @return name of the machine. * @return name of the machine.
*/ */

View File

@ -27,6 +27,8 @@ public interface Cluster extends Grouping {
long getId(); long getId();
String getUuid();
String getName(); String getName();
long getDataCenterId(); long getDataCenterId();

View File

@ -51,6 +51,8 @@ public interface Account extends ControlledEntity {
public long getId(); public long getId();
public String getUuid();
public String getAccountName(); public String getAccountName();
public short getType(); public short getType();

View File

@ -25,7 +25,6 @@ import org.apache.cloudstack.api.Entity;
import com.cloud.domain.Domain; import com.cloud.domain.Domain;
import com.cloud.serializer.Param; import com.cloud.serializer.Param;
import com.cloud.user.Account; import com.cloud.user.Account;
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;
@ -33,7 +32,7 @@ import org.apache.cloudstack.api.BaseResponse;
@Entity(value = Account.class) @Entity(value = Account.class)
public class AccountResponse extends BaseResponse { public class AccountResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the id of the account") @SerializedName(ApiConstants.ID) @Param(description="the id of the account")
private IdentityProxy id = new IdentityProxy("account"); private String id;
@SerializedName(ApiConstants.NAME) @Param(description="the name of the account") @SerializedName(ApiConstants.NAME) @Param(description="the name of the account")
private String name; private String name;
@ -42,13 +41,13 @@ public class AccountResponse extends BaseResponse {
private Short accountType; private Short accountType;
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="id of the Domain the account belongs too") @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="id of the Domain the account belongs too")
private IdentityProxy domainId = new IdentityProxy("domain"); private String domainId;
@SerializedName(ApiConstants.DOMAIN) @Param(description="name of the Domain the account belongs too") @SerializedName(ApiConstants.DOMAIN) @Param(description="name of the Domain the account belongs too")
private String domainName; private String domainName;
@SerializedName(ApiConstants.DEFAULT_ZONE_ID) @Param(description="the default zone of the account") @SerializedName(ApiConstants.DEFAULT_ZONE_ID) @Param(description="the default zone of the account")
private IdentityProxy defaultZoneId = new IdentityProxy("data_center"); private String defaultZoneId;
@SerializedName(ApiConstants.RECEIVED_BYTES) @Param(description="the total number of network traffic bytes received") @SerializedName(ApiConstants.RECEIVED_BYTES) @Param(description="the total number of network traffic bytes received")
private Long bytesReceived; private Long bytesReceived;
@ -150,8 +149,8 @@ public class AccountResponse extends BaseResponse {
@SerializedName(ApiConstants.ACCOUNT_DETAILS) @Param(description="details for the account") @SerializedName(ApiConstants.ACCOUNT_DETAILS) @Param(description="details for the account")
private Map<String, String> details; private Map<String, String> details;
public void setId(Long id) { public void setId(String id) {
this.id.setValue(id); this.id = id;
} }
public void setName(String name) { public void setName(String name) {
@ -162,8 +161,8 @@ public class AccountResponse extends BaseResponse {
this.accountType = accountType; this.accountType = accountType;
} }
public void setDomainId(Long domainId) { public void setDomainId(String domainId) {
this.domainId.setValue(domainId); this.domainId = domainId;
} }
public void setDomainName(String domainName) { public void setDomainName(String domainName) {
@ -290,7 +289,7 @@ public class AccountResponse extends BaseResponse {
this.networkAvailable = networkAvailable; this.networkAvailable = networkAvailable;
} }
public void setDefaultZone(Long defaultZoneId) { public void setDefaultZone(String defaultZoneId) {
this.defaultZoneId.setValue(defaultZoneId); this.defaultZoneId = defaultZoneId;
} }
} }

View File

@ -27,19 +27,19 @@ public class CapacityResponse extends BaseResponse {
private Short capacityType; private Short capacityType;
@SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID") @SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID")
private IdentityProxy zoneId = new IdentityProxy("data_center"); private String zoneId;
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name") @SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name")
private String zoneName; private String zoneName;
@SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID") @SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID")
private IdentityProxy podId = new IdentityProxy("host_pod_ref"); private String podId;
@SerializedName("podname") @Param(description="the Pod name") @SerializedName("podname") @Param(description="the Pod name")
private String podName; private String podName;
@SerializedName(ApiConstants.CLUSTER_ID) @Param(description="the Cluster ID") @SerializedName(ApiConstants.CLUSTER_ID) @Param(description="the Cluster ID")
private IdentityProxy clusterId = new IdentityProxy("cluster"); private String clusterId;
@SerializedName("clustername") @Param(description="the Cluster name") @SerializedName("clustername") @Param(description="the Cluster name")
private String clusterName; private String clusterName;
@ -61,12 +61,12 @@ public class CapacityResponse extends BaseResponse {
this.capacityType = capacityType; this.capacityType = capacityType;
} }
public Long getZoneId() { public String getZoneId() {
return zoneId.getValue(); return zoneId;
} }
public void setZoneId(Long zoneId) { public void setZoneId(String zoneId) {
this.zoneId.setValue(zoneId); this.zoneId = zoneId;
} }
public String getZoneName() { public String getZoneName() {
@ -77,12 +77,12 @@ public class CapacityResponse extends BaseResponse {
this.zoneName = zoneName; this.zoneName = zoneName;
} }
public Long getPodId() { public String getPodId() {
return podId.getValue(); return podId;
} }
public void setPodId(Long podId) { public void setPodId(String podId) {
this.podId.setValue(podId); this.podId = podId;
} }
public String getPodName() { public String getPodName() {
@ -93,12 +93,12 @@ public class CapacityResponse extends BaseResponse {
this.podName = podName; this.podName = podName;
} }
public Long getClusterId() { public String getClusterId() {
return clusterId.getValue(); return clusterId;
} }
public void setClusterId(Long clusterId) { public void setClusterId(String clusterId) {
this.clusterId.setValue(clusterId); this.clusterId = clusterId;
} }
public String getClusterName() { public String getClusterName() {

View File

@ -32,19 +32,19 @@ import org.apache.cloudstack.api.BaseResponse;
@Entity(value = Cluster.class) @Entity(value = Cluster.class)
public class ClusterResponse extends BaseResponse { public class ClusterResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the cluster ID") @SerializedName(ApiConstants.ID) @Param(description="the cluster ID")
private IdentityProxy id = new IdentityProxy("cluster"); private String id;
@SerializedName(ApiConstants.NAME) @Param(description="the cluster name") @SerializedName(ApiConstants.NAME) @Param(description="the cluster name")
private String name; private String name;
@SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID of the cluster") @SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID of the cluster")
private IdentityProxy podId = new IdentityProxy("host_pod_ref"); private String podId;
@SerializedName("podname") @Param(description="the Pod name of the cluster") @SerializedName("podname") @Param(description="the Pod name of the cluster")
private String podName; private String podName;
@SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID of the cluster") @SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID of the cluster")
private IdentityProxy zoneId = new IdentityProxy("data_center"); private String zoneId;
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the cluster") @SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the cluster")
private String zoneName; private String zoneName;
@ -64,12 +64,12 @@ public class ClusterResponse extends BaseResponse {
@SerializedName("capacity") @Param(description="the capacity of the Cluster", responseObject = CapacityResponse.class) @SerializedName("capacity") @Param(description="the capacity of the Cluster", responseObject = CapacityResponse.class)
private List<CapacityResponse> capacitites; private List<CapacityResponse> capacitites;
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() {
@ -80,12 +80,12 @@ public class ClusterResponse extends BaseResponse {
this.name = name; this.name = name;
} }
public Long getPodId() { public String getPodId() {
return podId.getValue(); return podId;
} }
public void setPodId(Long podId) { public void setPodId(String podId) {
this.podId.setValue(podId); this.podId = podId;
} }
public String getPodName() { public String getPodName() {
@ -96,12 +96,12 @@ public class ClusterResponse extends BaseResponse {
this.podName = podName; this.podName = podName;
} }
public Long getZoneId() { public String getZoneId() {
return zoneId.getValue(); return zoneId;
} }
public void setZoneId(Long zoneId) { public void setZoneId(String zoneId) {
this.zoneId.setValue(zoneId); this.zoneId = zoneId;
} }
public String getZoneName() { public String getZoneName() {

View File

@ -27,7 +27,7 @@ import com.google.gson.annotations.SerializedName;
@Entity(value = Domain.class) @Entity(value = Domain.class)
public class DomainResponse extends BaseResponse { public class DomainResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the ID of the domain") @SerializedName(ApiConstants.ID) @Param(description="the ID of the domain")
private IdentityProxy id = new IdentityProxy("domain"); private String id;
@SerializedName(ApiConstants.NAME) @Param(description="the name of the domain") @SerializedName(ApiConstants.NAME) @Param(description="the name of the domain")
private String domainName; private String domainName;
@ -36,7 +36,7 @@ public class DomainResponse extends BaseResponse {
private Integer level; private Integer level;
@SerializedName("parentdomainid") @Param(description="the domain ID of the parent domain") @SerializedName("parentdomainid") @Param(description="the domain ID of the parent domain")
private IdentityProxy parentDomainId = new IdentityProxy("domain"); private String parentDomainId;
@SerializedName("parentdomainname") @Param(description="the domain name of the parent domain") @SerializedName("parentdomainname") @Param(description="the domain name of the parent domain")
private String parentDomainName; private String parentDomainName;
@ -50,12 +50,12 @@ public class DomainResponse extends BaseResponse {
@SerializedName(ApiConstants.PATH) @Param(description="the path of the domain") @SerializedName(ApiConstants.PATH) @Param(description="the path of the domain")
private String path; private String path;
public Long getId() { public String getId() {
return id.getValue(); return this.id;
} }
public void setId(Long id) { public void setId(String id) {
this.id.setValue(id); this.id = id;
} }
public String getDomainName() { public String getDomainName() {
@ -74,12 +74,12 @@ public class DomainResponse extends BaseResponse {
this.level = level; this.level = level;
} }
public Long getParentDomainId() { public String getParentDomainId() {
return parentDomainId.getValue(); return parentDomainId;
} }
public void setParentDomainId(Long parentDomainId) { public void setParentDomainId(String parentDomainId) {
this.parentDomainId.setValue(parentDomainId); this.parentDomainId = parentDomainId;
} }
public String getParentDomainName() { public String getParentDomainName() {

View File

@ -29,7 +29,7 @@ import org.apache.cloudstack.api.BaseResponse;
public class HostResponse extends BaseResponse { public class HostResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the ID of the host") @SerializedName(ApiConstants.ID) @Param(description="the ID of the host")
private IdentityProxy id = new IdentityProxy("host"); private String id;
@SerializedName(ApiConstants.NAME) @Param(description="the name of the host") @SerializedName(ApiConstants.NAME) @Param(description="the name of the host")
private String name; private String name;
@ -44,7 +44,7 @@ public class HostResponse extends BaseResponse {
private Host.Type hostType; private Host.Type hostType;
@SerializedName("oscategoryid") @Param(description="the OS category ID of the host") @SerializedName("oscategoryid") @Param(description="the OS category ID of the host")
private IdentityProxy osCategoryId = new IdentityProxy("guest_os_category"); private String osCategoryId;
@SerializedName("oscategoryname") @Param(description="the OS category name of the host") @SerializedName("oscategoryname") @Param(description="the OS category name of the host")
private String osCategoryName; private String osCategoryName;
@ -53,13 +53,13 @@ public class HostResponse extends BaseResponse {
private String ipAddress; private String ipAddress;
@SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID of the host") @SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID of the host")
private IdentityProxy zoneId = new IdentityProxy("data_center"); private String zoneId;
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the host") @SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the host")
private String zoneName; private String zoneName;
@SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID of the host") @SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID of the host")
private IdentityProxy podId = new IdentityProxy("host_pod_ref"); private String podId;
@SerializedName("podname") @Param(description="the Pod name of the host") @SerializedName("podname") @Param(description="the Pod name of the host")
private String podName; private String podName;
@ -119,7 +119,7 @@ public class HostResponse extends BaseResponse {
private Long managementServerId; private Long managementServerId;
@SerializedName("clusterid") @Param(description="the cluster ID of the host") @SerializedName("clusterid") @Param(description="the cluster ID of the host")
private IdentityProxy clusterId = new IdentityProxy("cluster"); private String clusterId;
@SerializedName("clustername") @Param(description="the cluster name of the host") @SerializedName("clustername") @Param(description="the cluster name of the host")
private String clusterName; private String clusterName;
@ -158,17 +158,12 @@ public class HostResponse extends BaseResponse {
private Boolean haHost; private Boolean haHost;
@Override public String getId() {
public Long getObjectId() { return id;
return getId();
} }
public Long getId() { public void setId(String id) {
return id.getValue(); this.id = id;
}
public void setId(Long id) {
this.id.setValue(id);
} }
public void setName(String name) { public void setName(String name) {
@ -187,8 +182,8 @@ public class HostResponse extends BaseResponse {
this.hostType = hostType; this.hostType = hostType;
} }
public void setOsCategoryId(Long osCategoryId) { public void setOsCategoryId(String osCategoryId) {
this.osCategoryId.setValue(osCategoryId); this.osCategoryId = osCategoryId;
} }
public void setOsCategoryName(String osCategoryName) { public void setOsCategoryName(String osCategoryName) {
@ -199,16 +194,16 @@ public class HostResponse extends BaseResponse {
this.ipAddress = ipAddress; this.ipAddress = ipAddress;
} }
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) {
this.zoneName = zoneName; this.zoneName = zoneName;
} }
public void setPodId(Long podId) { public void setPodId(String podId) {
this.podId.setValue(podId); this.podId = podId;
} }
public void setPodName(String podName) { public void setPodName(String podName) {
@ -287,8 +282,8 @@ public class HostResponse extends BaseResponse {
this.managementServerId = managementServerId; this.managementServerId = managementServerId;
} }
public void setClusterId(Long clusterId) { public void setClusterId(String clusterId) {
this.clusterId.setValue(clusterId); this.clusterId = clusterId;
} }
public void setClusterName(String clusterName) { public void setClusterName(String clusterName) {
@ -348,22 +343,6 @@ public class HostResponse extends BaseResponse {
this.hypervisorVersion = hypervisorVersion; this.hypervisorVersion = hypervisorVersion;
} }
public void setOsCategoryId(IdentityProxy osCategoryId) {
this.osCategoryId = osCategoryId;
}
public void setZoneId(IdentityProxy zoneId) {
this.zoneId = zoneId;
}
public void setPodId(IdentityProxy podId) {
this.podId = podId;
}
public void setClusterId(IdentityProxy clusterId) {
this.clusterId = clusterId;
}
public void setHaHost(Boolean haHost) { public void setHaHost(Boolean haHost) {
this.haHost = haHost; this.haHost = haHost;
} }

View File

@ -22,7 +22,6 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.Entity; import org.apache.cloudstack.api.Entity;
import com.cloud.dc.DataCenter; import com.cloud.dc.DataCenter;
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;
@ -30,7 +29,7 @@ import com.google.gson.annotations.SerializedName;
@Entity(value = DataCenter.class) @Entity(value = DataCenter.class)
public class ZoneResponse extends BaseResponse { public class ZoneResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="Zone id") @SerializedName(ApiConstants.ID) @Param(description="Zone id")
private IdentityProxy id = new IdentityProxy("data_center"); private String id;
@SerializedName(ApiConstants.NAME) @Param(description="Zone name") @SerializedName(ApiConstants.NAME) @Param(description="Zone name")
private String name; private String name;
@ -93,8 +92,8 @@ public class ZoneResponse extends BaseResponse {
@SerializedName(ApiConstants.LOCAL_STORAGE_ENABLED) @Param(description="true if local storage offering enabled, false otherwise") @SerializedName(ApiConstants.LOCAL_STORAGE_ENABLED) @Param(description="true if local storage offering enabled, false otherwise")
private boolean localStorageEnabled; private boolean localStorageEnabled;
public void setId(Long id) { public void setId(String id) {
this.id.setValue(id); this.id = id;
} }
public void setName(String name) { public void setName(String name) {

View File

@ -43,6 +43,12 @@ public class CheckOnHostCommandTest {
return 101L; return 101L;
}; };
@Override
public String getUuid() {
return "101";
}
public String getName() { public String getName() {
return "hostName"; return "hostName";
}; };

View File

@ -48,7 +48,7 @@ import com.cloud.utils.db.GenericDao;
@Table(name="host") @Table(name="host")
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32) @DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32)
public class HostVO implements Host, Identity { public class HostVO implements Host {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")
@ -128,20 +128,20 @@ public class HostVO implements Host, Identity {
@Column(name="setup") @Column(name="setup")
private boolean setup = false; private boolean setup = false;
@Column(name="resource_state", nullable=false) @Column(name="resource_state", nullable=false)
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
private ResourceState resourceState; private ResourceState resourceState;
@Column(name="hypervisor_version") @Column(name="hypervisor_version")
private String hypervisorVersion; private String hypervisorVersion;
@Column(name="update_count", updatable = true, nullable=false) @Column(name="update_count", updatable = true, nullable=false)
protected long updated; // This field should be updated everytime the state is updated. There's no set method in the vo object because it is done with in the dao code. protected long updated; // This field should be updated everytime the state is updated. There's no set method in the vo object because it is done with in the dao code.
@Column(name="uuid") @Column(name="uuid")
private String uuid; private String uuid;
// 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 host dao to load it. // Call host dao to load it.
@ -695,36 +695,36 @@ public class HostVO implements Host, Identity {
public Status getState() { public Status getState() {
return status; return status;
} }
@Override @Override
public ResourceState getResourceState() { public ResourceState getResourceState() {
return resourceState; return resourceState;
} }
public void setResourceState(ResourceState state) { public void setResourceState(ResourceState state) {
resourceState = state; resourceState = state;
} }
@Override @Override
public boolean isInMaintenanceStates() { public boolean isInMaintenanceStates() {
return (getResourceState() == ResourceState.Maintenance || getResourceState() == ResourceState.ErrorInMaintenance return (getResourceState() == ResourceState.Maintenance || getResourceState() == ResourceState.ErrorInMaintenance
|| getResourceState() == ResourceState.PrepareForMaintenance); || getResourceState() == ResourceState.PrepareForMaintenance);
} }
public long getUpdated() { public long getUpdated() {
return updated; return updated;
} }
public long incrUpdated() { public long incrUpdated() {
updated++; updated++;
return updated; return updated;
} }
@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;
} }

View File

@ -33,7 +33,7 @@ import com.cloud.utils.db.GenericDao;
@Entity @Entity
@Table(name="account") @Table(name="account")
public class AccountVO implements Account, Identity { public class AccountVO implements Account {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")
@ -54,28 +54,28 @@ public class AccountVO implements Account, Identity {
@Column(name=GenericDao.REMOVED_COLUMN) @Column(name=GenericDao.REMOVED_COLUMN)
private Date removed; private Date removed;
@Column(name="cleanup_needed") @Column(name="cleanup_needed")
private boolean needsCleanup = false; private boolean needsCleanup = false;
@Column(name="network_domain") @Column(name="network_domain")
private String networkDomain; private String networkDomain;
@Column(name="uuid") @Column(name="uuid")
private String uuid; private String uuid;
@Column(name="default_zone_id") @Column(name="default_zone_id")
private Long defaultZoneId = null; private Long defaultZoneId = null;
public AccountVO() { public AccountVO() {
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
public AccountVO(long id) { public AccountVO(long id) {
this.id = id; this.id = id;
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
public AccountVO(String accountName, long domainId, String networkDomain, short type) { public AccountVO(String accountName, long domainId, String networkDomain, short type) {
this.accountName = accountName; this.accountName = accountName;
this.domainId = domainId; this.domainId = domainId;
@ -84,11 +84,11 @@ public class AccountVO implements Account, Identity {
this.state = State.enabled; this.state = State.enabled;
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
public void setNeedsCleanup(boolean value) { public void setNeedsCleanup(boolean value) {
needsCleanup = value; needsCleanup = value;
} }
public boolean getNeedsCleanup() { public boolean getNeedsCleanup() {
return needsCleanup; return needsCleanup;
} }
@ -102,16 +102,16 @@ public class AccountVO implements Account, Identity {
public String getAccountName() { public String getAccountName() {
return accountName; return accountName;
} }
public void setAccountName(String accountName) { public void setAccountName(String accountName) {
this.accountName = accountName; this.accountName = accountName;
} }
@Override @Override
public short getType() { public short getType() {
return type; return type;
} }
public void setType(short type) { public void setType(short type) {
this.type = type; this.type = type;
} }
@ -120,16 +120,16 @@ public class AccountVO implements Account, Identity {
public long getDomainId() { public long getDomainId() {
return domainId; return domainId;
} }
public void setDomainId(long domainId) { public void setDomainId(long domainId) {
this.domainId = domainId; this.domainId = domainId;
} }
@Override @Override
public Long getDefaultZoneId() { public Long getDefaultZoneId() {
return defaultZoneId; return defaultZoneId;
} }
public void setDefaultZoneId(Long defaultZoneId) { public void setDefaultZoneId(Long defaultZoneId) {
this.defaultZoneId = defaultZoneId; this.defaultZoneId = defaultZoneId;
} }
@ -138,7 +138,7 @@ public class AccountVO implements Account, Identity {
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;
} }
@ -147,31 +147,31 @@ public class AccountVO implements Account, Identity {
public Date getRemoved() { public Date getRemoved() {
return removed; return removed;
} }
@Override @Override
public long getAccountId() { public long getAccountId() {
return id; return id;
} }
@Override @Override
public String toString() { public String toString() {
return new StringBuilder("Acct[").append(id).append("-").append(accountName).append("]").toString(); return new StringBuilder("Acct[").append(id).append("-").append(accountName).append("]").toString();
} }
@Override @Override
public String getNetworkDomain() { public String getNetworkDomain() {
return networkDomain; return networkDomain;
} }
public void setNetworkDomain(String networkDomain) { public void setNetworkDomain(String networkDomain) {
this.networkDomain = networkDomain; this.networkDomain = networkDomain;
} }
@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;
} }

View File

@ -259,14 +259,20 @@ public class ApiResponseHelper implements ResponseGenerator {
public AccountResponse createAccountResponse(Account account) { public AccountResponse createAccountResponse(Account account) {
boolean accountIsAdmin = (account.getType() == Account.ACCOUNT_TYPE_ADMIN); boolean accountIsAdmin = (account.getType() == Account.ACCOUNT_TYPE_ADMIN);
AccountResponse accountResponse = new AccountResponse(); AccountResponse accountResponse = new AccountResponse();
accountResponse.setId(account.getId()); accountResponse.setId(account.getUuid());
accountResponse.setName(account.getAccountName()); accountResponse.setName(account.getAccountName());
accountResponse.setAccountType(account.getType()); accountResponse.setAccountType(account.getType());
accountResponse.setDomainId(account.getDomainId()); Domain domain = ApiDBUtils.findDomainById(account.getDomainId());
accountResponse.setDomainName(ApiDBUtils.findDomainById(account.getDomainId()).getName()); if (domain != null) {
accountResponse.setDomainId(domain.getUuid());
accountResponse.setDomainName(domain.getName());
}
accountResponse.setState(account.getState().toString()); accountResponse.setState(account.getState().toString());
accountResponse.setNetworkDomain(account.getNetworkDomain()); accountResponse.setNetworkDomain(account.getNetworkDomain());
accountResponse.setDefaultZone(account.getDefaultZoneId()); DataCenterVO dc = ApiDBUtils.findZoneById(account.getDefaultZoneId());
if (dc != null) {
accountResponse.setDefaultZone(dc.getUuid());
}
// get network stat // get network stat
List<UserStatisticsVO> stats = ApiDBUtils.listUserStatsBy(account.getId()); List<UserStatisticsVO> stats = ApiDBUtils.listUserStatsBy(account.getId());
@ -415,10 +421,10 @@ public class ApiResponseHelper implements ResponseGenerator {
public DomainResponse createDomainResponse(Domain domain) { public DomainResponse createDomainResponse(Domain domain) {
DomainResponse domainResponse = new DomainResponse(); DomainResponse domainResponse = new DomainResponse();
domainResponse.setDomainName(domain.getName()); domainResponse.setDomainName(domain.getName());
domainResponse.setId(domain.getId()); domainResponse.setId(domain.getUuid());
domainResponse.setLevel(domain.getLevel()); domainResponse.setLevel(domain.getLevel());
domainResponse.setNetworkDomain(domain.getNetworkDomain()); domainResponse.setNetworkDomain(domain.getNetworkDomain());
domainResponse.setParentDomainId(domain.getParent()); domainResponse.setParentDomainId(ApiDBUtils.findDomainById(domain.getParent()).getUuid());
StringBuilder domainPath = new StringBuilder("ROOT"); StringBuilder domainPath = new StringBuilder("ROOT");
(domainPath.append(domain.getPath())).deleteCharAt(domainPath.length() - 1); (domainPath.append(domain.getPath())).deleteCharAt(domainPath.length() - 1);
domainResponse.setPath(domainPath.toString()); domainResponse.setPath(domainPath.toString());
@ -583,18 +589,30 @@ public class ApiResponseHelper implements ResponseGenerator {
@Override @Override
public HostResponse createHostResponse(Host host, EnumSet<HostDetails> details) { public HostResponse createHostResponse(Host host, EnumSet<HostDetails> details) {
HostResponse hostResponse = new HostResponse(); HostResponse hostResponse = new HostResponse();
hostResponse.setId(host.getId()); hostResponse.setId(host.getUuid());
hostResponse.setCapabilities(host.getCapabilities()); hostResponse.setCapabilities(host.getCapabilities());
hostResponse.setClusterId(host.getClusterId()); ClusterVO cluster = null;
if (host.getClusterId() != null) {
cluster = ApiDBUtils.findClusterById(host.getClusterId());
if (cluster != null) {
hostResponse.setClusterId(cluster.getUuid());
}
}
hostResponse.setCpuNumber(host.getCpus()); hostResponse.setCpuNumber(host.getCpus());
hostResponse.setZoneId(host.getDataCenterId()); DataCenterVO zone = ApiDBUtils.findZoneById(host.getDataCenterId());
if (zone != null) {
hostResponse.setZoneId(zone.getUuid());
}
hostResponse.setDisconnectedOn(host.getDisconnectedOn()); hostResponse.setDisconnectedOn(host.getDisconnectedOn());
hostResponse.setHypervisor(host.getHypervisorType()); hostResponse.setHypervisor(host.getHypervisorType());
hostResponse.setHostType(host.getType()); hostResponse.setHostType(host.getType());
hostResponse.setLastPinged(new Date(host.getLastPinged())); hostResponse.setLastPinged(new Date(host.getLastPinged()));
hostResponse.setManagementServerId(host.getManagementServerId()); hostResponse.setManagementServerId(host.getManagementServerId());
hostResponse.setName(host.getName()); hostResponse.setName(host.getName());
hostResponse.setPodId(host.getPodId()); HostPodVO pod = ApiDBUtils.findPodById(host.getPodId());
if (pod != null) {
hostResponse.setPodId(pod.getUuid());
}
hostResponse.setRemoved(host.getRemoved()); hostResponse.setRemoved(host.getRemoved());
hostResponse.setCpuSpeed(host.getSpeed()); hostResponse.setCpuSpeed(host.getSpeed());
hostResponse.setState(host.getStatus()); hostResponse.setState(host.getStatus());
@ -607,20 +625,18 @@ public class ApiResponseHelper implements ResponseGenerator {
GuestOSCategoryVO guestOSCategory = ApiDBUtils.getHostGuestOSCategory(host.getId()); GuestOSCategoryVO guestOSCategory = ApiDBUtils.getHostGuestOSCategory(host.getId());
if (guestOSCategory != null) { if (guestOSCategory != null) {
hostResponse.setOsCategoryId(guestOSCategory.getId()); hostResponse.setOsCategoryId(guestOSCategory.getUuid());
hostResponse.setOsCategoryName(guestOSCategory.getName()); hostResponse.setOsCategoryName(guestOSCategory.getName());
} }
hostResponse.setZoneName(ApiDBUtils.findZoneById(host.getDataCenterId()).getName()); if (zone != null) {
hostResponse.setZoneName(zone.getName());
if (host.getPodId() != null) {
HostPodVO pod = ApiDBUtils.findPodById(host.getPodId());
if (pod != null) {
hostResponse.setPodName(pod.getName());
}
} }
if (host.getClusterId() != null) { if (pod != null) {
ClusterVO cluster = ApiDBUtils.findClusterById(host.getClusterId()); hostResponse.setPodName(pod.getName());
}
if (cluster != null) {
hostResponse.setClusterName(cluster.getName()); hostResponse.setClusterName(cluster.getName());
hostResponse.setClusterType(cluster.getClusterType().toString()); hostResponse.setClusterType(cluster.getClusterType().toString());
} }
@ -935,7 +951,7 @@ public class ApiResponseHelper implements ResponseGenerator {
public ZoneResponse createZoneResponse(DataCenter dataCenter, Boolean showCapacities) { public ZoneResponse createZoneResponse(DataCenter dataCenter, Boolean showCapacities) {
Account account = UserContext.current().getCaller(); Account account = UserContext.current().getCaller();
ZoneResponse zoneResponse = new ZoneResponse(); ZoneResponse zoneResponse = new ZoneResponse();
zoneResponse.setId(dataCenter.getId()); zoneResponse.setId(dataCenter.getUuid());
zoneResponse.setName(dataCenter.getName()); zoneResponse.setName(dataCenter.getName());
zoneResponse.setSecurityGroupsEnabled(ApiDBUtils.isSecurityGroupEnabledInZone(dataCenter.getId())); zoneResponse.setSecurityGroupsEnabled(ApiDBUtils.isSecurityGroupEnabledInZone(dataCenter.getId()));
zoneResponse.setLocalStorageEnabled(dataCenter.isLocalStorageEnabled()); zoneResponse.setLocalStorageEnabled(dataCenter.isLocalStorageEnabled());
@ -1216,20 +1232,24 @@ public class ApiResponseHelper implements ResponseGenerator {
@Override @Override
public ClusterResponse createClusterResponse(Cluster cluster, Boolean showCapacities) { public ClusterResponse createClusterResponse(Cluster cluster, Boolean showCapacities) {
ClusterResponse clusterResponse = new ClusterResponse(); ClusterResponse clusterResponse = new ClusterResponse();
clusterResponse.setId(cluster.getId()); clusterResponse.setId(cluster.getUuid());
clusterResponse.setName(cluster.getName()); clusterResponse.setName(cluster.getName());
clusterResponse.setPodId(cluster.getPodId()); HostPodVO pod = ApiDBUtils.findPodById(cluster.getPodId());
clusterResponse.setZoneId(cluster.getDataCenterId()); if (pod != null) {
clusterResponse.setPodId(pod.getUuid());
clusterResponse.setPodName(pod.getName());
}
DataCenterVO dc = ApiDBUtils.findZoneById(cluster.getDataCenterId());
if (dc != null) {
clusterResponse.setZoneId(dc.getUuid());
clusterResponse.setZoneName(dc.getName());
}
clusterResponse.setHypervisorType(cluster.getHypervisorType().toString()); clusterResponse.setHypervisorType(cluster.getHypervisorType().toString());
clusterResponse.setClusterType(cluster.getClusterType().toString()); clusterResponse.setClusterType(cluster.getClusterType().toString());
clusterResponse.setAllocationState(cluster.getAllocationState().toString()); clusterResponse.setAllocationState(cluster.getAllocationState().toString());
clusterResponse.setManagedState(cluster.getManagedState().toString()); clusterResponse.setManagedState(cluster.getManagedState().toString());
HostPodVO pod = ApiDBUtils.findPodById(cluster.getPodId());
if (pod != null) {
clusterResponse.setPodName(pod.getName());
}
DataCenterVO zone = ApiDBUtils.findZoneById(cluster.getDataCenterId());
clusterResponse.setZoneName(zone.getName());
if (showCapacities != null && showCapacities) { if (showCapacities != null && showCapacities) {
List<SummedCapacity> capacities = ApiDBUtils.getCapacityByClusterPodZone(null, null, cluster.getId()); List<SummedCapacity> capacities = ApiDBUtils.getCapacityByClusterPodZone(null, null, cluster.getId());
Set<CapacityResponse> capacityResponses = new HashSet<CapacityResponse>(); Set<CapacityResponse> capacityResponses = new HashSet<CapacityResponse>();
@ -2196,26 +2216,30 @@ public class ApiResponseHelper implements ResponseGenerator {
capacityResponse.setCapacityType(summedCapacity.getCapacityType()); capacityResponse.setCapacityType(summedCapacity.getCapacityType());
capacityResponse.setCapacityUsed(summedCapacity.getUsedCapacity()); capacityResponse.setCapacityUsed(summedCapacity.getUsedCapacity());
if (summedCapacity.getPodId() != null) { if (summedCapacity.getPodId() != null) {
capacityResponse.setPodId(summedCapacity.getPodId()); capacityResponse.setPodId(ApiDBUtils.findPodById(summedCapacity.getPodId()).getUuid());
HostPodVO pod = ApiDBUtils.findPodById(summedCapacity.getPodId()); HostPodVO pod = ApiDBUtils.findPodById(summedCapacity.getPodId());
if (pod != null) { if (pod != null) {
capacityResponse.setPodId(pod.getUuid());
capacityResponse.setPodName(pod.getName()); capacityResponse.setPodName(pod.getName());
} }
} }
if (summedCapacity.getClusterId() != null) { if (summedCapacity.getClusterId() != null) {
capacityResponse.setClusterId(summedCapacity.getClusterId());
ClusterVO cluster = ApiDBUtils.findClusterById(summedCapacity.getClusterId()); ClusterVO cluster = ApiDBUtils.findClusterById(summedCapacity.getClusterId());
if (cluster != null) { if (cluster != null) {
capacityResponse.setClusterId(cluster.getUuid());
capacityResponse.setClusterName(cluster.getName()); capacityResponse.setClusterName(cluster.getName());
if (summedCapacity.getPodId() == null) { if (summedCapacity.getPodId() == null) {
long podId = cluster.getPodId(); HostPodVO pod = ApiDBUtils.findPodById(cluster.getPodId());
capacityResponse.setPodId(podId); capacityResponse.setPodId(pod.getUuid());
capacityResponse.setPodName(ApiDBUtils.findPodById(podId).getName()); capacityResponse.setPodName(pod.getName());
} }
} }
} }
capacityResponse.setZoneId(summedCapacity.getDataCenterId()); DataCenterVO zone = ApiDBUtils.findZoneById(summedCapacity.getDataCenterId());
capacityResponse.setZoneName(ApiDBUtils.findZoneById(summedCapacity.getDataCenterId()).getName()); if (zone != null) {
capacityResponse.setZoneId(zone.getUuid());
capacityResponse.setZoneName(zone.getName());
}
if (summedCapacity.getUsedPercentage() != null){ if (summedCapacity.getUsedPercentage() != null){
capacityResponse.setPercentUsed(format.format(summedCapacity.getUsedPercentage() * 100f)); capacityResponse.setPercentUsed(format.format(summedCapacity.getUsedPercentage() * 100f));
} else if (summedCapacity.getTotalCapacity() != 0) { } else if (summedCapacity.getTotalCapacity() != 0) {

View File

@ -38,53 +38,53 @@ import com.cloud.utils.db.GenericDao;
@Entity @Entity
@Table(name="cluster") @Table(name="cluster")
public class ClusterVO implements Cluster, Identity { public class ClusterVO implements Cluster {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")
long id; long id;
@Column(name="name") @Column(name="name")
String name; String name;
@Column(name="guid") @Column(name="guid")
String guid; String guid;
@Column(name="data_center_id") @Column(name="data_center_id")
long dataCenterId; long dataCenterId;
@Column(name="pod_id") @Column(name="pod_id")
long podId; long podId;
@Column(name="hypervisor_type") @Column(name="hypervisor_type")
String hypervisorType; String hypervisorType;
@Column(name="cluster_type") @Column(name="cluster_type")
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
Cluster.ClusterType clusterType; Cluster.ClusterType clusterType;
@Column(name="allocation_state") @Column(name="allocation_state")
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
AllocationState allocationState; AllocationState allocationState;
@Column(name="managed_state") @Column(name="managed_state")
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
ManagedState managedState; ManagedState managedState;
@Column(name=GenericDao.REMOVED_COLUMN) @Column(name=GenericDao.REMOVED_COLUMN)
private Date removed; private Date removed;
@Column(name="uuid") @Column(name="uuid")
String uuid; String uuid;
public ClusterVO() { public ClusterVO() {
clusterType = Cluster.ClusterType.CloudManaged; clusterType = Cluster.ClusterType.CloudManaged;
allocationState = Grouping.AllocationState.Enabled; allocationState = Grouping.AllocationState.Enabled;
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
public ClusterVO(long dataCenterId, long podId, String name) { public ClusterVO(long dataCenterId, long podId, String name) {
this.dataCenterId = dataCenterId; this.dataCenterId = dataCenterId;
this.podId = podId; this.podId = podId;
@ -110,23 +110,23 @@ public class ClusterVO implements Cluster, Identity {
public long getPodId() { public long getPodId() {
return podId; return podId;
} }
public Cluster.ClusterType getClusterType() { public Cluster.ClusterType getClusterType() {
return clusterType; return clusterType;
} }
public void setClusterType(Cluster.ClusterType clusterType) { public void setClusterType(Cluster.ClusterType clusterType) {
this.clusterType = clusterType; this.clusterType = clusterType;
} }
public AllocationState getAllocationState() { public AllocationState getAllocationState() {
return allocationState; return allocationState;
} }
public void setAllocationState(AllocationState allocationState) { public void setAllocationState(AllocationState allocationState) {
this.allocationState = allocationState; this.allocationState = allocationState;
} }
public ManagedState getManagedState() { public ManagedState getManagedState() {
return managedState; return managedState;
} }
@ -143,7 +143,7 @@ public class ClusterVO implements Cluster, Identity {
public int hashCode() { public int hashCode() {
return NumbersUtil.hash(id); return NumbersUtil.hash(id);
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (!(obj instanceof ClusterVO)) { if (!(obj instanceof ClusterVO)) {
@ -152,7 +152,7 @@ public class ClusterVO implements Cluster, Identity {
ClusterVO that = (ClusterVO)obj; ClusterVO that = (ClusterVO)obj;
return this.id == that.id; return this.id == that.id;
} }
public HypervisorType getHypervisorType() { public HypervisorType getHypervisorType() {
return HypervisorType.getType(hypervisorType); return HypervisorType.getType(hypervisorType);
} }
@ -160,11 +160,11 @@ public class ClusterVO implements Cluster, Identity {
public void setHypervisorType(String hy) { public void setHypervisorType(String hy) {
hypervisorType = hy; hypervisorType = hy;
} }
public String getGuid() { public String getGuid() {
return guid; return guid;
} }
public void setGuid(String guid) { public void setGuid(String guid) {
this.guid = guid; this.guid = guid;
} }
@ -176,12 +176,12 @@ public class ClusterVO implements Cluster, Identity {
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@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;
} }

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,
@ -39,91 +39,91 @@ import com.cloud.utils.db.GenericDao;
@Entity @Entity
@Table(name="data_center") @Table(name="data_center")
public class DataCenterVO implements DataCenter, Identity { public class DataCenterVO implements DataCenter {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")
private long id; private long id;
@Column(name="name") @Column(name="name")
private String name = null; private String name = null;
@Column(name="description") @Column(name="description")
private String description = null; private String description = null;
@Column(name="dns1") @Column(name="dns1")
private String dns1 = null; private String dns1 = null;
@Column(name="dns2") @Column(name="dns2")
private String dns2 = null; private String dns2 = null;
@Column(name="internal_dns1") @Column(name="internal_dns1")
private String internalDns1 = null; private String internalDns1 = null;
@Column(name="internal_dns2") @Column(name="internal_dns2")
private String internalDns2 = null; private String internalDns2 = null;
@Column(name="router_mac_address", updatable = false, nullable=false) @Column(name="router_mac_address", updatable = false, nullable=false)
private String routerMacAddress = "02:00:00:00:00:01"; private String routerMacAddress = "02:00:00:00:00:01";
@Column(name="guest_network_cidr") @Column(name="guest_network_cidr")
private String guestNetworkCidr = null; private String guestNetworkCidr = null;
@Column(name="domain_id") @Column(name="domain_id")
private Long domainId = null; private Long domainId = null;
@Column(name="domain") @Column(name="domain")
private String domain; private String domain;
@Column(name="networktype") @Column(name="networktype")
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
NetworkType networkType; NetworkType networkType;
@Column(name="dns_provider") @Column(name="dns_provider")
private String dnsProvider; private String dnsProvider;
@Column(name="dhcp_provider") @Column(name="dhcp_provider")
private String dhcpProvider; private String dhcpProvider;
@Column(name="gateway_provider") @Column(name="gateway_provider")
private String gatewayProvider; private String gatewayProvider;
@Column(name="vpn_provider") @Column(name="vpn_provider")
private String vpnProvider; private String vpnProvider;
@Column(name="userdata_provider") @Column(name="userdata_provider")
private String userDataProvider; private String userDataProvider;
@Column(name="lb_provider") @Column(name="lb_provider")
private String loadBalancerProvider; private String loadBalancerProvider;
@Column(name="firewall_provider") @Column(name="firewall_provider")
private String firewallProvider; private String firewallProvider;
@Column(name="mac_address", nullable=false) @Column(name="mac_address", nullable=false)
@TableGenerator(name="mac_address_sq", table="data_center", pkColumnName="id", valueColumnName="mac_address", allocationSize=1) @TableGenerator(name="mac_address_sq", table="data_center", pkColumnName="id", valueColumnName="mac_address", allocationSize=1)
private long macAddress = 1; private long macAddress = 1;
@Column(name="zone_token") @Column(name="zone_token")
private String zoneToken; private String zoneToken;
@Column(name=GenericDao.REMOVED_COLUMN) @Column(name=GenericDao.REMOVED_COLUMN)
private Date removed; private Date removed;
// 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 the dao to load it. // Call the dao to load it.
@Transient @Transient
Map<String, String> details; Map<String, String> details;
@Column(name="allocation_state") @Column(name="allocation_state")
@Enumerated(value=EnumType.STRING) @Enumerated(value=EnumType.STRING)
AllocationState allocationState; AllocationState allocationState;
@Column(name="uuid") @Column(name="uuid")
private String uuid; private String uuid;
@Column(name="is_security_group_enabled") @Column(name="is_security_group_enabled")
boolean securityGroupEnabled; boolean securityGroupEnabled;
@ -168,13 +168,13 @@ public class DataCenterVO implements DataCenter, Identity {
@Override @Override
public String getFirewallProvider() { public String getFirewallProvider() {
return firewallProvider; return firewallProvider;
} }
public void setFirewallProvider(String firewallProvider) { public void setFirewallProvider(String firewallProvider) {
this.firewallProvider = firewallProvider; this.firewallProvider = firewallProvider;
} }
public DataCenterVO(long id, String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain, Long domainId, NetworkType zoneType, String zoneToken, String domainSuffix) { public DataCenterVO(long id, String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain, Long domainId, NetworkType zoneType, String zoneToken, String domainSuffix) {
this(name, description, dns1, dns2, dns3, dns4, guestCidr, domain, domainId, zoneType, zoneToken, domainSuffix, false, false); this(name, description, dns1, dns2, dns3, dns4, guestCidr, domain, domainId, zoneType, zoneToken, domainSuffix, false, false);
this.id = id; this.id = id;
@ -216,7 +216,7 @@ public class DataCenterVO implements DataCenter, Identity {
this.domain = domainSuffix; this.domain = domainSuffix;
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }
@Override @Override
public String getVpnProvider() { public String getVpnProvider() {
return vpnProvider; return vpnProvider;
@ -234,13 +234,13 @@ public class DataCenterVO implements DataCenter, Identity {
public void setUserDataProvider(String userDataProvider) { public void setUserDataProvider(String userDataProvider) {
this.userDataProvider = userDataProvider; this.userDataProvider = userDataProvider;
} }
@Override @Override
public String getGuestNetworkCidr() public String getGuestNetworkCidr()
{ {
return guestNetworkCidr; return guestNetworkCidr;
} }
public void setGuestNetworkCidr(String guestNetworkCidr) public void setGuestNetworkCidr(String guestNetworkCidr)
{ {
this.guestNetworkCidr = guestNetworkCidr; this.guestNetworkCidr = guestNetworkCidr;
@ -254,7 +254,7 @@ public class DataCenterVO implements DataCenter, Identity {
public void setDomainId(Long domainId) { public void setDomainId(Long domainId) {
this.domainId = domainId; this.domainId = domainId;
} }
@Override @Override
public String getDescription() { public String getDescription() {
return description; return description;
@ -263,12 +263,12 @@ public class DataCenterVO implements DataCenter, Identity {
public String getRouterMacAddress() { public String getRouterMacAddress() {
return routerMacAddress; return routerMacAddress;
} }
@Override @Override
public String getDns1() { public String getDns1() {
return dns1; return dns1;
} }
@Override @Override
public String getDns2() { public String getDns2() {
return dns2; return dns2;
@ -291,28 +291,28 @@ public class DataCenterVO implements DataCenter, Identity {
public long getId() { public long getId() {
return id; return id;
} }
@Override @Override
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public void setDns1(String dns1) { public void setDns1(String dns1) {
this.dns1 = dns1; this.dns1 = dns1;
} }
public void setDns2(String dns2) { public void setDns2(String dns2) {
this.dns2 = dns2; this.dns2 = dns2;
} }
public void setInternalDns1(String dns3) { public void setInternalDns1(String dns3) {
this.internalDns1 = dns3; this.internalDns1 = dns3;
} }
public void setInternalDns2(String dns4) { public void setInternalDns2(String dns4) {
this.internalDns2 = dns4; this.internalDns2 = dns4;
} }
@ -320,7 +320,7 @@ public class DataCenterVO implements DataCenter, Identity {
public void setRouterMacAddress(String routerMacAddress) { public void setRouterMacAddress(String routerMacAddress) {
this.routerMacAddress = routerMacAddress; this.routerMacAddress = routerMacAddress;
} }
@Override @Override
public String getDomain() { public String getDomain() {
return domain; return domain;
@ -329,7 +329,7 @@ public class DataCenterVO implements DataCenter, Identity {
public void setDomain(String domain) { public void setDomain(String domain) {
this.domain = domain; this.domain = domain;
} }
public void setNetworkType(NetworkType zoneNetworkType) { public void setNetworkType(NetworkType zoneNetworkType) {
this.networkType = zoneNetworkType; this.networkType = zoneNetworkType;
} }
@ -338,12 +338,12 @@ public class DataCenterVO implements DataCenter, Identity {
public NetworkType getNetworkType() { public NetworkType getNetworkType() {
return networkType; return networkType;
} }
@Override @Override
public boolean isSecurityGroupEnabled() { public boolean isSecurityGroupEnabled() {
return securityGroupEnabled; return securityGroupEnabled;
} }
public void setSecurityGroupEnabled(boolean enabled) { public void setSecurityGroupEnabled(boolean enabled) {
this.securityGroupEnabled = enabled; this.securityGroupEnabled = enabled;
} }
@ -364,34 +364,34 @@ public class DataCenterVO implements DataCenter, Identity {
@Override @Override
public void setDetails(Map<String, String> details2) { public void setDetails(Map<String, String> details2) {
details = details2; details = details2;
} }
public String getDetail(String name) { public String getDetail(String name) {
assert (details != null) : "Did you forget to load the details?"; assert (details != null) : "Did you forget to load the details?";
return details != null ? details.get(name) : null; return details != null ? details.get(name) : null;
} }
public void setDetail(String name, String value) { public void setDetail(String name, String value) {
assert (details != null) : "Did you forget to load the details?"; assert (details != null) : "Did you forget to load the details?";
details.put(name, value); details.put(name, value);
} }
public AllocationState getAllocationState() { public AllocationState getAllocationState() {
return allocationState; return allocationState;
} }
public void setAllocationState(AllocationState allocationState) { public void setAllocationState(AllocationState allocationState) {
this.allocationState = allocationState; this.allocationState = allocationState;
} }
@Override @Override
public int hashCode() { public int hashCode() {
return NumbersUtil.hash(id); return NumbersUtil.hash(id);
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (!(obj instanceof DataCenterVO)) { if (!(obj instanceof DataCenterVO)) {
@ -405,20 +405,20 @@ public class DataCenterVO implements DataCenter, Identity {
public String getZoneToken() { public String getZoneToken() {
return zoneToken; return zoneToken;
} }
public void setZoneToken(String zoneToken) { public void setZoneToken(String zoneToken) {
this.zoneToken = zoneToken; this.zoneToken = zoneToken;
} }
public Date getRemoved() { public Date getRemoved() {
return removed; return removed;
} }
@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;
} }

View File

@ -33,9 +33,9 @@ import com.cloud.utils.db.GenericDao;
@Entity @Entity
@Table(name="domain") @Table(name="domain")
public class DomainVO implements Domain, Identity { public class DomainVO implements Domain {
public static final Logger s_logger = Logger.getLogger(DomainVO.class.getName()); public static final Logger s_logger = Logger.getLogger(DomainVO.class.getName());
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")
@ -49,10 +49,10 @@ public class DomainVO implements Domain, Identity {
@Column(name="owner") @Column(name="owner")
private long accountId; private long accountId;
@Column(name="path") @Column(name="path")
private String path = null; private String path = null;
@Column(name="level") @Column(name="level")
private int level; private int level;
@ -64,18 +64,18 @@ public class DomainVO implements Domain, Identity {
@Column(name="next_child_seq") @Column(name="next_child_seq")
private long nextChildSeq = 1L; private long nextChildSeq = 1L;
@Column(name="state") @Column(name="state")
private Domain.State state; private Domain.State state;
@Column(name="network_domain") @Column(name="network_domain")
private String networkDomain; private String networkDomain;
@Column(name="uuid") @Column(name="uuid")
private String uuid; private String uuid;
public DomainVO() {} public DomainVO() {}
public DomainVO(long id, String name, long owner, Long parentId, String networkDomain) { public DomainVO(long id, String name, long owner, Long parentId, String networkDomain) {
this(name, owner, parentId, networkDomain); this(name, owner, parentId, networkDomain);
this.id = id; this.id = id;
@ -102,7 +102,7 @@ public class DomainVO implements Domain, Identity {
public Long getParent() { public Long getParent() {
return parent; return parent;
} }
@Override @Override
public void setParent(Long parent) { public void setParent(Long parent) {
if(parent == null) { if(parent == null) {
@ -119,7 +119,7 @@ public class DomainVO implements Domain, Identity {
public String getName() { public String getName() {
return name; return name;
} }
@Override @Override
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
@ -129,59 +129,59 @@ public class DomainVO implements Domain, Identity {
public long getAccountId() { public long getAccountId() {
return accountId; return accountId;
} }
@Override @Override
public Date getRemoved() { public Date getRemoved() {
return removed; return removed;
} }
@Override @Override
public String getPath() { public String getPath() {
return path; return path;
} }
@Override @Override
public void setPath(String path) { public void setPath(String path) {
this.path = path; this.path = path;
} }
@Override @Override
public int getLevel() { public int getLevel() {
return level; return level;
} }
public void setLevel(int level) { public void setLevel(int level) {
this.level = level; this.level = level;
} }
@Override @Override
public int getChildCount() { public int getChildCount() {
return childCount; return childCount;
} }
public void setChildCount(int count) { public void setChildCount(int count) {
childCount = count; childCount = count;
} }
@Override @Override
public long getNextChildSeq() { public long getNextChildSeq() {
return nextChildSeq; return nextChildSeq;
} }
public void setNextChildSeq(long seq) { public void setNextChildSeq(long seq) {
nextChildSeq = seq; nextChildSeq = seq;
} }
@Override @Override
public Domain.State getState() { public Domain.State getState() {
return state; return state;
} }
@Override @Override
public void setState(Domain.State state) { public void setState(Domain.State state) {
this.state = state; this.state = state;
} }
@Override @Override
public String toString() { public String toString() {
return new StringBuilder("Domain:").append(id).append(path).toString(); return new StringBuilder("Domain:").append(id).append(path).toString();
@ -195,12 +195,12 @@ public class DomainVO implements Domain, Identity {
public void setNetworkDomain(String domainSuffix) { public void setNetworkDomain(String domainSuffix) {
this.networkDomain = domainSuffix; this.networkDomain = domainSuffix;
} }
@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;
} }