package org.zstack.header.cluster;
import org.zstack.header.vo.ForeignKey;
import org.zstack.header.vo.ForeignKey.ReferenceOption;
import org.zstack.header.vo.Index;
import org.zstack.header.vo.ResourceVO;
import org.zstack.header.zone.ZoneEO;
import javax.persistence.*;
import java.sql.Timestamp;
/**
*/
@MappedSuperclass
public class ClusterAO extends ResourceVO {
@Column
@ForeignKey(parentEntityClass = ZoneEO.class, onDeleteAction = ReferenceOption.RESTRICT)
private String zoneUuid;
@Column
@Index
private String name;
@Column
private String type;
@Column
private String description;
@Column
@Enumerated(EnumType.STRING)
private ClusterState state;
@Column
private String hypervisorType;
@Column
private Timestamp createDate;
@Column
private Timestamp lastOpDate;
@Column
private String managementNodeId;
public ClusterAO() {
this.state = ClusterState.Disabled;
}
@PreUpdate
private void preUpdate() {
lastOpDate = null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ClusterState getState() {
return state;
}
public void setState(ClusterState state) {
this.state = state;
}
public String getZoneUuid() {
return zoneUuid;
}
public void setZoneUuid(String zoneUuid) {
this.zoneUuid = zoneUuid;
}
public String getHypervisorType() {
return hypervisorType;
}
public void setHypervisorType(String hypervisorType) {
this.hypervisorType = hypervisorType;
}
public String getManagementNodeId() {
return managementNodeId;
}
public void setManagementNodeId(String managementNodeId) {
this.managementNodeId = managementNodeId;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
public Timestamp getLastOpDate() {
return lastOpDate;
}
public void setLastOpDate(Timestamp lastOpDate) {
this.lastOpDate = lastOpDate;
}
}