changing lots of line endings

This commit is contained in:
David Nalley 2012-04-06 17:51:57 -04:00
parent 6ff3dc3951
commit a0171b9874
58 changed files with 7597 additions and 7597 deletions

View File

@ -10,17 +10,17 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.agent;
package com.cloud.agent;
import com.cloud.agent.api.AgentControlAnswer;
import com.cloud.agent.api.AgentControlCommand;
import com.cloud.exception.AgentControlChannelException;
public interface IAgentControl {
void registerControlListener(IAgentControlListener listener);
void unregisterControlListener(IAgentControlListener listener);
AgentControlAnswer sendRequest(AgentControlCommand cmd, int timeoutInMilliseconds) throws AgentControlChannelException;
void postRequest(AgentControlCommand cmd) throws AgentControlChannelException;
}
public interface IAgentControl {
void registerControlListener(IAgentControlListener listener);
void unregisterControlListener(IAgentControlListener listener);
AgentControlAnswer sendRequest(AgentControlCommand cmd, int timeoutInMilliseconds) throws AgentControlChannelException;
void postRequest(AgentControlCommand cmd) throws AgentControlChannelException;
}

View File

@ -10,15 +10,15 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.agent;
package com.cloud.agent;
import com.cloud.agent.api.AgentControlAnswer;
import com.cloud.agent.api.AgentControlCommand;
import com.cloud.agent.api.Answer;
import com.cloud.agent.transport.Request;
import com.cloud.agent.transport.Response;
public interface IAgentControlListener {
public Answer processControlRequest(Request request, AgentControlCommand cmd);
public void processControlResponse(Response response, AgentControlAnswer answer);
}
public interface IAgentControlListener {
public Answer processControlRequest(Request request, AgentControlCommand cmd);
public void processControlResponse(Response response, AgentControlAnswer answer);
}

View File

@ -10,9 +10,9 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.alert;
package com.cloud.alert;
import com.cloud.utils.component.Adapter;
public interface AlertAdapter extends Adapter {
}
public interface AlertAdapter extends Adapter {
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.alert;
package com.cloud.alert;
import java.util.Date;
import java.util.UUID;
@ -26,77 +26,77 @@ import javax.persistence.TemporalType;
import com.cloud.api.Identity;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="alert")
public class AlertVO implements Alert, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="type")
@Entity
@Table(name="alert")
public class AlertVO implements Alert, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="type")
private short type;
@Column(name="cluster_id")
private Long clusterId = null;
@Column(name="pod_id")
private Long podId = null;
@Column(name="data_center_id")
private long dataCenterId = 0;
@Column(name="subject", length=999)
private String subject;
@Column(name="sent_count")
private int sentCount = 0;
@Column(name=GenericDao.CREATED_COLUMN)
private Date createdDate;
@Temporal(TemporalType.TIMESTAMP)
@Column(name="last_sent", updatable=true, nullable=true)
private Date lastSent;
@Temporal(TemporalType.TIMESTAMP)
@Column(name="resolved", updatable=true, nullable=true)
@Column(name="pod_id")
private Long podId = null;
@Column(name="data_center_id")
private long dataCenterId = 0;
@Column(name="subject", length=999)
private String subject;
@Column(name="sent_count")
private int sentCount = 0;
@Column(name=GenericDao.CREATED_COLUMN)
private Date createdDate;
@Temporal(TemporalType.TIMESTAMP)
@Column(name="last_sent", updatable=true, nullable=true)
private Date lastSent;
@Temporal(TemporalType.TIMESTAMP)
@Column(name="resolved", updatable=true, nullable=true)
private Date resolved;
@Column(name="uuid")
private String uuid;
public AlertVO() {
this.uuid = UUID.randomUUID().toString();
}
public AlertVO(Long id) {
this.id = id;
}
public AlertVO(Long id) {
this.id = id;
this.uuid = UUID.randomUUID().toString();
}
}
@Override
public long getId() {
return id;
}
public long getId() {
return id;
}
@Override
public short getType() {
return type;
}
public void setType(short type) {
this.type = type;
}
public short getType() {
return type;
}
public void setType(short type) {
this.type = type;
}
@Override
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public Long getClusterId() {
return clusterId;
}
@ -104,57 +104,57 @@ public class AlertVO implements Alert, Identity {
this.clusterId = clusterId;
}
@Override
public Long getPodId() {
return podId;
}
public void setPodId(Long podId) {
this.podId = podId;
}
public Long getPodId() {
return podId;
}
public void setPodId(Long podId) {
this.podId = podId;
}
@Override
public long getDataCenterId() {
return dataCenterId;
}
public void setDataCenterId(long dataCenterId) {
this.dataCenterId = dataCenterId;
}
public long getDataCenterId() {
return dataCenterId;
}
public void setDataCenterId(long dataCenterId) {
this.dataCenterId = dataCenterId;
}
@Override
public int getSentCount() {
return sentCount;
}
public void setSentCount(int sentCount) {
this.sentCount = sentCount;
}
public int getSentCount() {
return sentCount;
}
public void setSentCount(int sentCount) {
this.sentCount = sentCount;
}
@Override
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
@Override
public Date getLastSent() {
return lastSent;
}
public void setLastSent(Date lastSent) {
this.lastSent = lastSent;
}
public Date getLastSent() {
return lastSent;
}
public void setLastSent(Date lastSent) {
this.lastSent = lastSent;
}
@Override
public Date getResolved() {
return resolved;
}
public void setResolved(Date resolved) {
this.resolved = resolved;
public Date getResolved() {
return resolved;
}
public void setResolved(Date resolved) {
this.resolved = resolved;
}
@Override
@ -164,5 +164,5 @@ public class AlertVO implements Alert, Identity {
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.async;
package com.cloud.async;
import java.util.Date;
import java.util.UUID;
@ -28,82 +28,82 @@ import javax.persistence.TemporalType;
import javax.persistence.Transient;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="async_job")
public class AsyncJobVO implements AsyncJob {
public static final int CALLBACK_POLLING = 0;
public static final int CALLBACK_EMAIL = 1;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id = null;
@Column(name="user_id")
private long userId;
@Column(name="account_id")
private long accountId;
@Column(name="session_key")
private String sessionKey;
@Column(name="job_cmd")
private String cmd;
@Column(name="job_cmd_originator")
private String cmdOriginator;
@Column(name="job_cmd_ver")
private int cmdVersion;
@Column(name="job_cmd_info", length=65535)
private String cmdInfo;
@Column(name="callback_type")
private int callbackType;
@Column(name="callback_address")
private String callbackAddress;
@Column(name="job_status")
private int status;
@Column(name="job_process_status")
private int processStatus;
@Column(name="job_result_code")
private int resultCode;
@Column(name="job_result", length=65535)
private String result;
@Entity
@Table(name="async_job")
public class AsyncJobVO implements AsyncJob {
public static final int CALLBACK_POLLING = 0;
public static final int CALLBACK_EMAIL = 1;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id = null;
@Column(name="user_id")
private long userId;
@Enumerated(value=EnumType.STRING)
@Column(name="instance_type", length=64)
private Type instanceType;
@Column(name="instance_id", length=64)
private Long instanceId;
@Column(name="job_init_msid")
private Long initMsid;
@Column(name="job_complete_msid")
private Long completeMsid;
@Column(name=GenericDao.CREATED_COLUMN)
private Date created;
@Column(name="last_updated")
@Temporal(TemporalType.TIMESTAMP)
private Date lastUpdated;
@Column(name="last_polled")
@Temporal(TemporalType.TIMESTAMP)
private Date lastPolled;
@Column(name=GenericDao.REMOVED_COLUMN)
@Column(name="account_id")
private long accountId;
@Column(name="session_key")
private String sessionKey;
@Column(name="job_cmd")
private String cmd;
@Column(name="job_cmd_originator")
private String cmdOriginator;
@Column(name="job_cmd_ver")
private int cmdVersion;
@Column(name="job_cmd_info", length=65535)
private String cmdInfo;
@Column(name="callback_type")
private int callbackType;
@Column(name="callback_address")
private String callbackAddress;
@Column(name="job_status")
private int status;
@Column(name="job_process_status")
private int processStatus;
@Column(name="job_result_code")
private int resultCode;
@Column(name="job_result", length=65535)
private String result;
@Enumerated(value=EnumType.STRING)
@Column(name="instance_type", length=64)
private Type instanceType;
@Column(name="instance_id", length=64)
private Long instanceId;
@Column(name="job_init_msid")
private Long initMsid;
@Column(name="job_complete_msid")
private Long completeMsid;
@Column(name=GenericDao.CREATED_COLUMN)
private Date created;
@Column(name="last_updated")
@Temporal(TemporalType.TIMESTAMP)
private Date lastUpdated;
@Column(name="last_polled")
@Temporal(TemporalType.TIMESTAMP)
private Date lastPolled;
@Column(name=GenericDao.REMOVED_COLUMN)
private Date removed;
@Column(name="uuid")
@ -114,228 +114,228 @@ public class AsyncJobVO implements AsyncJob {
@Transient
private boolean fromPreviousSession = false;
public AsyncJobVO() {
public AsyncJobVO() {
this.uuid = UUID.randomUUID().toString();
}
public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo) {
this.userId = userId;
this.accountId = accountId;
this.cmd = cmd;
this.cmdInfo = cmdInfo;
}
public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo) {
this.userId = userId;
this.accountId = accountId;
this.cmd = cmd;
this.cmdInfo = cmdInfo;
this.callbackType = CALLBACK_POLLING;
this.uuid = UUID.randomUUID().toString();
}
public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo,
int callbackType, String callbackAddress) {
this(userId, accountId, cmd, cmdInfo);
this.callbackType = callbackType;
this.callbackAddress = callbackAddress;
this.uuid = UUID.randomUUID().toString();
}
}
public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo,
int callbackType, String callbackAddress) {
this(userId, accountId, cmd, cmdInfo);
this.callbackType = callbackType;
this.callbackAddress = callbackAddress;
this.uuid = UUID.randomUUID().toString();
}
@Override
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Override
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
@Override
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
@Override
public String getCmd() {
return cmd;
}
public void setCmd(String cmd) {
this.cmd = cmd;
}
@Override
public int getCmdVersion() {
return cmdVersion;
}
public void setCmdVersion(int version) {
cmdVersion = version;
}
@Override
public String getCmdInfo() {
return cmdInfo;
}
public void setCmdInfo(String cmdInfo) {
this.cmdInfo = cmdInfo;
}
@Override
public int getCallbackType() {
return callbackType;
}
public void setCallbackType(int callbackType) {
this.callbackType = callbackType;
}
@Override
public String getCallbackAddress() {
return callbackAddress;
}
public void setCallbackAddress(String callbackAddress) {
this.callbackAddress = callbackAddress;
}
@Override
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
@Override
public int getProcessStatus() {
return processStatus;
}
public void setProcessStatus(int status) {
processStatus = status;
}
@Override
public int getResultCode() {
return resultCode;
}
public void setResultCode(int resultCode) {
this.resultCode = resultCode;
}
@Override
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
@Override
public Long getInitMsid() {
return initMsid;
}
public void setInitMsid(Long initMsid) {
this.initMsid = initMsid;
}
@Override
public Long getCompleteMsid() {
return completeMsid;
}
public void setCompleteMsid(Long completeMsid) {
this.completeMsid = completeMsid;
}
@Override
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
@Override
public Date getLastUpdated() {
return lastUpdated;
}
public void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
}
@Override
public Date getLastPolled() {
return lastPolled;
}
public void setLastPolled(Date lastPolled) {
this.lastPolled = lastPolled;
}
@Override
public Date getRemoved() {
return removed;
}
public void setRemoved(Date removed) {
this.removed = removed;
}
@Override
public Type getInstanceType() {
return instanceType;
}
public void setInstanceType(Type instanceType) {
this.instanceType = instanceType;
}
@Override
public Long getInstanceId() {
return instanceId;
}
public void setInstanceId(Long instanceId) {
this.instanceId = instanceId;
}
@Override
public String getSessionKey() {
return sessionKey;
}
public void setSessionKey(String sessionKey) {
this.sessionKey = sessionKey;
}
@Override
public String getCmdOriginator() {
return cmdOriginator;
}
public void setCmdOriginator(String cmdOriginator) {
this.cmdOriginator = cmdOriginator;
}
public String getCmd() {
return cmd;
}
public void setCmd(String cmd) {
this.cmd = cmd;
}
@Override
@Override
public int getCmdVersion() {
return cmdVersion;
}
public void setCmdVersion(int version) {
cmdVersion = version;
}
@Override
public String getCmdInfo() {
return cmdInfo;
}
public void setCmdInfo(String cmdInfo) {
this.cmdInfo = cmdInfo;
}
@Override
public int getCallbackType() {
return callbackType;
}
public void setCallbackType(int callbackType) {
this.callbackType = callbackType;
}
@Override
public String getCallbackAddress() {
return callbackAddress;
}
public void setCallbackAddress(String callbackAddress) {
this.callbackAddress = callbackAddress;
}
@Override
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
@Override
public int getProcessStatus() {
return processStatus;
}
public void setProcessStatus(int status) {
processStatus = status;
}
@Override
public int getResultCode() {
return resultCode;
}
public void setResultCode(int resultCode) {
this.resultCode = resultCode;
}
@Override
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
@Override
public Long getInitMsid() {
return initMsid;
}
public void setInitMsid(Long initMsid) {
this.initMsid = initMsid;
}
@Override
public Long getCompleteMsid() {
return completeMsid;
}
public void setCompleteMsid(Long completeMsid) {
this.completeMsid = completeMsid;
}
@Override
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
@Override
public Date getLastUpdated() {
return lastUpdated;
}
public void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
}
@Override
public Date getLastPolled() {
return lastPolled;
}
public void setLastPolled(Date lastPolled) {
this.lastPolled = lastPolled;
}
@Override
public Date getRemoved() {
return removed;
}
public void setRemoved(Date removed) {
this.removed = removed;
}
@Override
public Type getInstanceType() {
return instanceType;
}
public void setInstanceType(Type instanceType) {
this.instanceType = instanceType;
}
@Override
public Long getInstanceId() {
return instanceId;
}
public void setInstanceId(Long instanceId) {
this.instanceId = instanceId;
}
@Override
public String getSessionKey() {
return sessionKey;
}
public void setSessionKey(String sessionKey) {
this.sessionKey = sessionKey;
}
@Override
public String getCmdOriginator() {
return cmdOriginator;
}
public void setCmdOriginator(String cmdOriginator) {
this.cmdOriginator = cmdOriginator;
}
@Override
public SyncQueueItemVO getSyncSource() {
return syncSource;
}
@ -363,30 +363,30 @@ public class AsyncJobVO implements AsyncJob {
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("AsyncJobVO {id:").append(getId());
sb.append(", userId: ").append(getUserId());
sb.append(", accountId: ").append(getAccountId());
sb.append(", sessionKey: ").append(getSessionKey());
sb.append(", instanceType: ").append(getInstanceType());
sb.append(", instanceId: ").append(getInstanceId());
sb.append(", cmd: ").append(getCmd());
sb.append(", cmdOriginator: ").append(getCmdOriginator());
sb.append(", cmdInfo: ").append(getCmdInfo());
sb.append(", cmdVersion: ").append(getCmdVersion());
sb.append(", callbackType: ").append(getCallbackType());
sb.append(", callbackAddress: ").append(getCallbackAddress());
sb.append(", status: ").append(getStatus());
sb.append(", processStatus: ").append(getProcessStatus());
sb.append(", resultCode: ").append(getResultCode());
sb.append(", result: ").append(getResult());
sb.append(", initMsid: ").append(getInitMsid());
sb.append(", completeMsid: ").append(getCompleteMsid());
sb.append(", lastUpdated: ").append(getLastUpdated());
sb.append(", lastPolled: ").append(getLastPolled());
sb.append(", created: ").append(getCreated());
sb.append("}");
return sb.toString();
}
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("AsyncJobVO {id:").append(getId());
sb.append(", userId: ").append(getUserId());
sb.append(", accountId: ").append(getAccountId());
sb.append(", sessionKey: ").append(getSessionKey());
sb.append(", instanceType: ").append(getInstanceType());
sb.append(", instanceId: ").append(getInstanceId());
sb.append(", cmd: ").append(getCmd());
sb.append(", cmdOriginator: ").append(getCmdOriginator());
sb.append(", cmdInfo: ").append(getCmdInfo());
sb.append(", cmdVersion: ").append(getCmdVersion());
sb.append(", callbackType: ").append(getCallbackType());
sb.append(", callbackAddress: ").append(getCallbackAddress());
sb.append(", status: ").append(getStatus());
sb.append(", processStatus: ").append(getProcessStatus());
sb.append(", resultCode: ").append(getResultCode());
sb.append(", result: ").append(getResult());
sb.append(", initMsid: ").append(getInitMsid());
sb.append(", completeMsid: ").append(getCompleteMsid());
sb.append(", lastUpdated: ").append(getLastUpdated());
sb.append(", lastPolled: ").append(getLastPolled());
sb.append(", created: ").append(getCreated());
sb.append("}");
return sb.toString();
}
}

View File

@ -10,111 +10,111 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.async;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="sync_queue_item")
public class SyncQueueItemVO implements SyncQueueItem{
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id = null;
@Column(name="queue_id")
private Long queueId;
@Column(name="content_type")
private String contentType;
@Column(name="content_id")
private Long contentId;
@Column(name="queue_proc_msid")
private Long lastProcessMsid;
@Column(name="queue_proc_number")
private Long lastProcessNumber;
@Column(name="created")
private Date created;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getQueueId() {
return queueId;
}
public void setQueueId(Long queueId) {
this.queueId = queueId;
}
package com.cloud.async;
@Override
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="sync_queue_item")
public class SyncQueueItemVO implements SyncQueueItem{
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id = null;
@Override
public Long getContentId() {
return contentId;
}
public void setContentId(Long contentId) {
this.contentId = contentId;
}
public Long getLastProcessMsid() {
return lastProcessMsid;
}
public void setLastProcessMsid(Long lastProcessMsid) {
this.lastProcessMsid = lastProcessMsid;
}
public Long getLastProcessNumber() {
return lastProcessNumber;
}
public void setLastProcessNumber(Long lastProcessNumber) {
this.lastProcessNumber = lastProcessNumber;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("SyncQueueItemVO {id:").append(getId()).append(", queueId: ").append(getQueueId());
sb.append(", contentType: ").append(getContentType());
sb.append(", contentId: ").append(getContentId());
sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
sb.append(", lastprocessNumber: ").append(getLastProcessNumber());
sb.append(", created: ").append(getCreated());
sb.append("}");
return sb.toString();
}
}
@Column(name="queue_id")
private Long queueId;
@Column(name="content_type")
private String contentType;
@Column(name="content_id")
private Long contentId;
@Column(name="queue_proc_msid")
private Long lastProcessMsid;
@Column(name="queue_proc_number")
private Long lastProcessNumber;
@Column(name="created")
private Date created;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getQueueId() {
return queueId;
}
public void setQueueId(Long queueId) {
this.queueId = queueId;
}
@Override
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
@Override
public Long getContentId() {
return contentId;
}
public void setContentId(Long contentId) {
this.contentId = contentId;
}
public Long getLastProcessMsid() {
return lastProcessMsid;
}
public void setLastProcessMsid(Long lastProcessMsid) {
this.lastProcessMsid = lastProcessMsid;
}
public Long getLastProcessNumber() {
return lastProcessNumber;
}
public void setLastProcessNumber(Long lastProcessNumber) {
this.lastProcessNumber = lastProcessNumber;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("SyncQueueItemVO {id:").append(getId()).append(", queueId: ").append(getQueueId());
sb.append(", contentType: ").append(getContentType());
sb.append(", contentId: ").append(getContentId());
sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
sb.append(", lastprocessNumber: ").append(getLastProcessNumber());
sb.append(", created: ").append(getCreated());
sb.append("}");
return sb.toString();
}
}

View File

@ -10,126 +10,126 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.async;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
@Table(name="sync_queue")
public class SyncQueueVO {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id;
@Column(name="sync_objtype")
private String syncObjType;
@Column(name="sync_objid")
private Long syncObjId;
@Column(name="queue_proc_number")
private Long lastProcessNumber;
@Column(name="queue_proc_time")
@Temporal(TemporalType.TIMESTAMP)
private Date lastProcessTime;
@Column(name="queue_proc_msid")
private Long lastProcessMsid;
@Column(name="created")
@Temporal(TemporalType.TIMESTAMP)
private Date created;
@Column(name="last_updated")
@Temporal(TemporalType.TIMESTAMP)
private Date lastUpdated;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getSyncObjType() {
return syncObjType;
}
public void setSyncObjType(String syncObjType) {
this.syncObjType = syncObjType;
}
public Long getSyncObjId() {
return syncObjId;
}
public void setSyncObjId(Long syncObjId) {
this.syncObjId = syncObjId;
}
public Long getLastProcessNumber() {
return lastProcessNumber;
}
public void setLastProcessNumber(Long number) {
lastProcessNumber = number;
}
public Date getLastProcessTime() {
return lastProcessTime;
}
public void setLastProcessTime(Date lastProcessTime) {
this.lastProcessTime = lastProcessTime;
}
public Long getLastProcessMsid() {
return lastProcessMsid;
}
public void setLastProcessMsid(Long lastProcessMsid) {
this.lastProcessMsid = lastProcessMsid;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getLastUpdated() {
return lastUpdated;
}
public void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("SyncQueueVO {id:").append(getId());
sb.append(", syncObjType: ").append(getSyncObjType());
sb.append(", syncObjId: ").append(getSyncObjId());
sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
sb.append(", lastProcessNumber: ").append(getLastProcessNumber());
sb.append(", lastProcessTime: ").append(getLastProcessTime());
sb.append(", lastUpdated: ").append(getLastUpdated());
sb.append(", created: ").append(getCreated());
sb.append("}");
return sb.toString();
}
}
package com.cloud.async;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
@Table(name="sync_queue")
public class SyncQueueVO {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id;
@Column(name="sync_objtype")
private String syncObjType;
@Column(name="sync_objid")
private Long syncObjId;
@Column(name="queue_proc_number")
private Long lastProcessNumber;
@Column(name="queue_proc_time")
@Temporal(TemporalType.TIMESTAMP)
private Date lastProcessTime;
@Column(name="queue_proc_msid")
private Long lastProcessMsid;
@Column(name="created")
@Temporal(TemporalType.TIMESTAMP)
private Date created;
@Column(name="last_updated")
@Temporal(TemporalType.TIMESTAMP)
private Date lastUpdated;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getSyncObjType() {
return syncObjType;
}
public void setSyncObjType(String syncObjType) {
this.syncObjType = syncObjType;
}
public Long getSyncObjId() {
return syncObjId;
}
public void setSyncObjId(Long syncObjId) {
this.syncObjId = syncObjId;
}
public Long getLastProcessNumber() {
return lastProcessNumber;
}
public void setLastProcessNumber(Long number) {
lastProcessNumber = number;
}
public Date getLastProcessTime() {
return lastProcessTime;
}
public void setLastProcessTime(Date lastProcessTime) {
this.lastProcessTime = lastProcessTime;
}
public Long getLastProcessMsid() {
return lastProcessMsid;
}
public void setLastProcessMsid(Long lastProcessMsid) {
this.lastProcessMsid = lastProcessMsid;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getLastUpdated() {
return lastUpdated;
}
public void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("SyncQueueVO {id:").append(getId());
sb.append(", syncObjType: ").append(getSyncObjType());
sb.append(", syncObjId: ").append(getSyncObjId());
sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
sb.append(", lastProcessNumber: ").append(getLastProcessNumber());
sb.append(", lastProcessTime: ").append(getLastProcessTime());
sb.append(", lastUpdated: ").append(getLastUpdated());
sb.append(", created: ").append(getCreated());
sb.append("}");
return sb.toString();
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.capacity;
package com.cloud.capacity;
import javax.persistence.Transient;
import java.util.Date;
@ -25,37 +25,37 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="op_host_capacity")
public class CapacityVO implements Capacity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="host_id")
private Long hostOrPoolId;
@Column(name="data_center_id")
private Long dataCenterId;
@Column(name="pod_id")
private Long podId;
@Entity
@Table(name="op_host_capacity")
public class CapacityVO implements Capacity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="host_id")
private Long hostOrPoolId;
@Column(name="data_center_id")
private Long dataCenterId;
@Column(name="pod_id")
private Long podId;
@Column(name="cluster_id")
private Long clusterId;
@Column(name="used_capacity")
private long usedCapacity;
@Column(name="used_capacity")
private long usedCapacity;
@Column(name="reserved_capacity")
private long reservedCapacity;
@Column(name="total_capacity")
private long totalCapacity;
@Column(name="capacity_type")
@Column(name="total_capacity")
private long totalCapacity;
@Column(name="capacity_type")
private short capacityType;
@Column(name="capacity_state")
@ -67,21 +67,21 @@ public class CapacityVO implements Capacity {
@Column(name="update_time", updatable=true, nullable=true)
@Temporal(value=TemporalType.TIMESTAMP)
protected Date updateTime;
@Transient
private Float usedPercentage;
public CapacityVO() {}
public CapacityVO(Long hostId, Long dataCenterId, Long podId, Long clusterId, long usedCapacity, long totalCapacity, short capacityType) {
this.hostOrPoolId = hostId;
this.dataCenterId = dataCenterId;
public CapacityVO() {}
public CapacityVO(Long hostId, Long dataCenterId, Long podId, Long clusterId, long usedCapacity, long totalCapacity, short capacityType) {
this.hostOrPoolId = hostId;
this.dataCenterId = dataCenterId;
this.podId = podId;
this.clusterId = clusterId;
this.usedCapacity = usedCapacity;
this.totalCapacity = totalCapacity;
this.clusterId = clusterId;
this.usedCapacity = usedCapacity;
this.totalCapacity = totalCapacity;
this.capacityType = capacityType;
this.updateTime = new Date();
this.updateTime = new Date();
}
public CapacityVO(Long dataCenterId, Long podId, Long clusterId, short capacityType, float usedPercentage) {
@ -90,35 +90,35 @@ public class CapacityVO implements Capacity {
this.clusterId = clusterId;
this.capacityType = capacityType;
this.usedPercentage = usedPercentage;
}
}
@Override
public long getId() {
return id;
}
public long getId() {
return id;
}
@Override
public Long getHostOrPoolId() {
return hostOrPoolId;
}
public void setHostId(Long hostId) {
this.hostOrPoolId = hostId;
}
public Long getHostOrPoolId() {
return hostOrPoolId;
}
public void setHostId(Long hostId) {
this.hostOrPoolId = hostId;
}
@Override
public Long getDataCenterId() {
return dataCenterId;
}
public void setDataCenterId(Long dataCenterId) {
this.dataCenterId = dataCenterId;
}
public Long getDataCenterId() {
return dataCenterId;
}
public void setDataCenterId(Long dataCenterId) {
this.dataCenterId = dataCenterId;
}
@Override
public Long getPodId() {
return podId;
}
public void setPodId(long podId) {
this.podId = new Long(podId);
public Long getPodId() {
return podId;
}
public void setPodId(long podId) {
this.podId = new Long(podId);
}
@Override
@ -128,14 +128,14 @@ public class CapacityVO implements Capacity {
public void setClusterId(long clusterId) {
this.clusterId = new Long(clusterId);
}
@Override
public long getUsedCapacity() {
return usedCapacity;
}
public void setUsedCapacity(long usedCapacity) {
public long getUsedCapacity() {
return usedCapacity;
}
public void setUsedCapacity(long usedCapacity) {
this.usedCapacity = usedCapacity;
this.setUpdateTime (new Date());
this.setUpdateTime (new Date());
}
@Override
public long getReservedCapacity() {
@ -144,21 +144,21 @@ public class CapacityVO implements Capacity {
public void setReservedCapacity(long reservedCapacity) {
this.reservedCapacity = reservedCapacity;
this.setUpdateTime (new Date());
}
}
@Override
public long getTotalCapacity() {
return totalCapacity;
}
public void setTotalCapacity(long totalCapacity) {
public long getTotalCapacity() {
return totalCapacity;
}
public void setTotalCapacity(long totalCapacity) {
this.totalCapacity = totalCapacity;
this.setUpdateTime (new Date());
}
this.setUpdateTime (new Date());
}
@Override
public short getCapacityType() {
return capacityType;
}
public void setCapacityType(short capacityType) {
this.capacityType = capacityType;
public short getCapacityType() {
return capacityType;
}
public void setCapacityType(short capacityType) {
this.capacityType = capacityType;
}
public CapacityState getCapacityState() {
@ -188,5 +188,5 @@ public class CapacityVO implements Capacity {
public void setUsedPercentage(float usedPercentage) {
this.usedPercentage = usedPercentage;
}
}
}
}

View File

@ -10,94 +10,94 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.configuration;
package com.cloud.configuration;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import com.cloud.utils.crypt.DBEncryptionUtil;
@Entity
@Table(name="configuration")
public class ConfigurationVO implements Configuration{
@Column(name="instance")
private String instance;
@Column(name="component")
private String component;
@Id
@Column(name="name")
private String name;
@Column(name="value", length=4095)
private String value;
@Column(name="description", length=1024)
private String description;
@Column(name="category")
private String category;
protected ConfigurationVO() {}
public ConfigurationVO(String category, String instance, String component, String name, String value, String description) {
this.category = category;
this.instance = instance;
this.component = component;
this.name = name;
this.value = value;
this.description = description;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getInstance() {
return instance;
}
public void setInstance(String instance) {
this.instance = instance;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Entity
@Table(name="configuration")
public class ConfigurationVO implements Configuration{
@Column(name="instance")
private String instance;
@Column(name="component")
private String component;
@Id
@Column(name="name")
private String name;
@Column(name="value", length=4095)
private String value;
@Column(name="description", length=1024)
private String description;
@Column(name="category")
private String category;
protected ConfigurationVO() {}
public ConfigurationVO(String category, String instance, String component, String name, String value, String description) {
this.category = category;
this.instance = instance;
this.component = component;
this.name = name;
this.value = value;
this.description = description;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getInstance() {
return instance;
}
public void setInstance(String instance) {
this.instance = instance;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return (("Hidden".equals(getCategory()) || "Secure".equals(getCategory())) ? DBEncryptionUtil.decrypt(value) : value);
}
public void setValue(String value) {
this.value = value;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
return (("Hidden".equals(getCategory()) || "Secure".equals(getCategory())) ? DBEncryptionUtil.decrypt(value) : value);
}
public void setValue(String value) {
this.value = value;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@ -10,14 +10,14 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.consoleproxy;
import java.util.List;
import java.util.Map;
package com.cloud.consoleproxy;
import java.util.List;
import java.util.Map;
import com.cloud.utils.component.Adapter;
import com.cloud.vm.ConsoleProxyVO;
public interface ConsoleProxyAllocator extends Adapter {
public ConsoleProxyVO allocProxy(List<ConsoleProxyVO> candidates, Map<Long, Integer> loadInfo, long dataCenterId);
}
public interface ConsoleProxyAllocator extends Adapter {
public ConsoleProxyVO allocProxy(List<ConsoleProxyVO> candidates, Map<Long, Integer> loadInfo, long dataCenterId);
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.event;
package com.cloud.event;
import java.util.Date;
import java.util.UUID;
@ -27,70 +27,70 @@ import javax.persistence.Transient;
import com.cloud.api.Identity;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="event")
public class EventVO implements Event, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id = -1;
@Column(name="type")
@Entity
@Table(name="event")
public class EventVO implements Event, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id = -1;
@Column(name="type")
private String type;
@Enumerated(value=EnumType.STRING)
@Column(name="state")
private State state = State.Completed;
@Column(name="description", length=1024)
private String description;
@Column(name=GenericDao.CREATED_COLUMN)
private Date createDate;
@Column(name="user_id")
private long userId;
@Column(name="account_id")
private long accountId;
@Column(name="domain_id")
private long domainId;
@Column(name="level")
private State state = State.Completed;
@Column(name="description", length=1024)
private String description;
@Column(name=GenericDao.CREATED_COLUMN)
private Date createDate;
@Column(name="user_id")
private long userId;
@Column(name="account_id")
private long accountId;
@Column(name="domain_id")
private long domainId;
@Column(name="level")
private String level = LEVEL_INFO;
@Column(name="start_id")
private long startId;
@Column(name="parameters", length=1024)
private long startId;
@Column(name="parameters", length=1024)
private String parameters;
@Column(name="uuid")
private String uuid;
@Transient
private int totalSize;
public static final String LEVEL_INFO = "INFO";
public static final String LEVEL_WARN = "WARN";
public static final String LEVEL_ERROR = "ERROR";
@Transient
private int totalSize;
public static final String LEVEL_INFO = "INFO";
public static final String LEVEL_WARN = "WARN";
public static final String LEVEL_ERROR = "ERROR";
public EventVO() {
this.uuid = UUID.randomUUID().toString();
}
public long getId() {
return id;
}
this.uuid = UUID.randomUUID().toString();
}
public long getId() {
return id;
}
@Override
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public State getState() {
return state;
@ -101,56 +101,56 @@ public class EventVO implements Event, Identity {
}
@Override
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public Date getCreateDate() {
return createDate;
}
public void setCreatedDate(Date createdDate) {
createDate = createdDate;
}
public Date getCreateDate() {
return createDate;
}
public void setCreatedDate(Date createdDate) {
createDate = createdDate;
}
@Override
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
@Override
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
@Override
public long getDomainId() {
return domainId;
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
@Override
public long getDomainId() {
return domainId;
}
public void setDomainId(long domainId) {
this.domainId = domainId;
}
@Override
public int getTotalSize() {
return totalSize;
}
public void setTotalSize(int totalSize) {
this.totalSize = totalSize;
}
public int getTotalSize() {
return totalSize;
}
public void setTotalSize(int totalSize) {
this.totalSize = totalSize;
}
@Override
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
@Override
public long getStartId() {
return startId;
@ -161,11 +161,11 @@ public class EventVO implements Event, Identity {
}
@Override
public String getParameters() {
return parameters;
}
public void setParameters(String parameters) {
this.parameters = parameters;
public String getParameters() {
return parameters;
}
public void setParameters(String parameters) {
this.parameters = parameters;
}
@Override
@ -177,4 +177,4 @@ public class EventVO implements Event, Identity {
this.uuid = uuid;
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.event;
package com.cloud.event;
import java.util.Date;
import javax.persistence.Column;
@ -22,24 +22,24 @@ import javax.persistence.Id;
import javax.persistence.Table;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="usage_event")
public class UsageEventVO implements UsageEvent {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id = -1;
@Column(name="type")
@Entity
@Table(name="usage_event")
public class UsageEventVO implements UsageEvent {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id = -1;
@Column(name="type")
private String type;
@Column(name=GenericDao.CREATED_COLUMN)
private Date createDate;
@Column(name="account_id")
private long accountId;
@Column(name=GenericDao.CREATED_COLUMN)
private Date createDate;
@Column(name="account_id")
private long accountId;
@Column(name="zone_id")
private long zoneId;
@ -48,7 +48,7 @@ public class UsageEventVO implements UsageEvent {
@Column(name="resource_name")
private String resourceName;
@Column(name="offering_id")
private Long offeringId;
@ -64,8 +64,8 @@ public class UsageEventVO implements UsageEvent {
@Column(name="processed")
boolean processed;
public UsageEventVO() {
public UsageEventVO() {
}
public UsageEventVO(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, Long size) {
@ -121,31 +121,31 @@ public class UsageEventVO implements UsageEvent {
}
@Override
public long getId() {
return id;
}
public long getId() {
return id;
}
@Override
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public Date getCreateDate() {
return createDate;
}
public void setCreatedDate(Date createdDate) {
createDate = createdDate;
public Date getCreateDate() {
return createDate;
}
public void setCreatedDate(Date createdDate) {
createDate = createdDate;
}
@Override
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
public void setZoneId(long zoneId) {
@ -208,4 +208,4 @@ public class UsageEventVO implements UsageEvent {
return resourceType;
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.event.dao;
package com.cloud.event.dao;
import java.util.Date;
import java.util.List;
@ -19,11 +19,11 @@ import com.cloud.event.EventVO;
import com.cloud.utils.db.Filter;
import com.cloud.utils.db.GenericDao;
import com.cloud.utils.db.SearchCriteria;
public interface EventDao extends GenericDao<EventVO, Long> {
public interface EventDao extends GenericDao<EventVO, Long> {
public List<EventVO> searchAllEvents(SearchCriteria<EventVO> sc, Filter filter);
public List<EventVO> listOlderEvents(Date oldTime);
EventVO findCompletedEvent(long startId);
}
EventVO findCompletedEvent(long startId);
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.event.dao;
package com.cloud.event.dao;
import java.util.Date;
import java.util.List;
@ -25,24 +25,24 @@ import com.cloud.utils.db.Filter;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
@Local(value={EventDao.class})
public class EventDaoImpl extends GenericDaoBase<EventVO, Long> implements EventDao {
public static final Logger s_logger = Logger.getLogger(EventDaoImpl.class.getName());
protected final SearchBuilder<EventVO> CompletedEventSearch;
@Local(value={EventDao.class})
public class EventDaoImpl extends GenericDaoBase<EventVO, Long> implements EventDao {
public static final Logger s_logger = Logger.getLogger(EventDaoImpl.class.getName());
protected final SearchBuilder<EventVO> CompletedEventSearch;
public EventDaoImpl () {
CompletedEventSearch = createSearchBuilder();
CompletedEventSearch.and("state",CompletedEventSearch.entity().getState(),SearchCriteria.Op.EQ);
CompletedEventSearch.and("startId", CompletedEventSearch.entity().getStartId(), SearchCriteria.Op.EQ);
CompletedEventSearch.done();
}
@Override
public List<EventVO> searchAllEvents(SearchCriteria<EventVO> sc, Filter filter) {
return listIncludingRemovedBy(sc, filter);
}
}
@Override
public List<EventVO> searchAllEvents(SearchCriteria<EventVO> sc, Filter filter) {
return listIncludingRemovedBy(sc, filter);
}
@Override
public List<EventVO> listOlderEvents(Date oldTime) {
if (oldTime == null) return null;
@ -59,4 +59,4 @@ public class EventDaoImpl extends GenericDaoBase<EventVO, Long> implements Event
sc.setParameters("startId", startId);
return findOneIncludingRemovedBy(sc);
}
}
}

View File

@ -10,17 +10,17 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.event.dao;
package com.cloud.event.dao;
import java.util.Date;
import java.util.List;
import com.cloud.event.UsageEventVO;
import com.cloud.exception.UsageServerException;
import com.cloud.utils.db.GenericDao;
public interface UsageEventDao extends GenericDao<UsageEventVO, Long> {
public List<UsageEventVO> listLatestEvents(Date endDate);
public List<UsageEventVO> getLatestEvent();

View File

@ -62,7 +62,7 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
IpeventsSearch.or("releaseEvent", IpeventsSearch.entity().getType(), SearchCriteria.Op.EQ);
IpeventsSearch.closeParen();
IpeventsSearch.done();
}
}
@Override
public List<UsageEventVO> listLatestEvents(Date endDate) {
@ -177,5 +177,5 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
sc.setParameters("networktype", Vlan.VlanType.DirectAttached.toString());
return listBy(sc, filter);
}
}
}

View File

@ -10,14 +10,14 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.exception;
package com.cloud.exception;
import com.cloud.exception.CloudException;
public class AgentControlChannelException extends CloudException {
private static final long serialVersionUID = -310647782960500466L;
public AgentControlChannelException(String msg) {
super(msg);
}
}
public class AgentControlChannelException extends CloudException {
private static final long serialVersionUID = -310647782960500466L;
public AgentControlChannelException(String msg) {
super(msg);
}
}

View File

@ -10,50 +10,50 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.host;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="host_tags")
public class HostTagVO {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="host_id")
private long hostId;
@Column(name="tag")
private String tag;
protected HostTagVO() {
}
public HostTagVO(long hostId, String tag) {
this.hostId = hostId;
this.tag = tag;
}
public long getHostId() {
return hostId;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public long getId() {
return id;
}
}
package com.cloud.host;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="host_tags")
public class HostTagVO {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="host_id")
private long hostId;
@Column(name="tag")
private String tag;
protected HostTagVO() {
}
public HostTagVO(long hostId, String tag) {
this.hostId = hostId;
this.tag = tag;
}
public long getHostId() {
return hostId;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public long getId() {
return id;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.hypervisor;
package com.cloud.hypervisor;
import java.util.UUID;
import javax.persistence.Column;
@ -26,28 +26,28 @@ import javax.persistence.Table;
import com.cloud.api.Identity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.utils.NumbersUtil;
@Entity
@Table(name="hypervisor_capabilities")
public class HypervisorCapabilitiesVO implements HypervisorCapabilities, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Entity
@Table(name="hypervisor_capabilities")
public class HypervisorCapabilitiesVO implements HypervisorCapabilities, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="hypervisor_type")
@Enumerated(value=EnumType.STRING)
private HypervisorType hypervisorType;
@Column(name="hypervisor_version")
private String hypervisorVersion;
private HypervisorType hypervisorType;
@Column(name="hypervisor_version")
private String hypervisorVersion;
@Column(name="max_guests_limit")
private Long maxGuestsLimit;
@Column(name="security_group_enabled")
private boolean securityGroupEnabled;
@Column(name="uuid")
private String uuid;
@ -62,7 +62,7 @@ public class HypervisorCapabilitiesVO implements HypervisorCapabilities, Identit
this.securityGroupEnabled = securityGroupEnabled;
this.uuid = UUID.randomUUID().toString();
}
/**
* @param hypervisorType the hypervisorType to set
*/
@ -122,13 +122,13 @@ public class HypervisorCapabilitiesVO implements HypervisorCapabilities, Identit
}
public long getId() {
return id;
}
@Override
public int hashCode() {
return NumbersUtil.hash(id);
public long getId() {
return id;
}
@Override
public int hashCode() {
return NumbersUtil.hash(id);
}
@Override
@ -138,15 +138,15 @@ public class HypervisorCapabilitiesVO implements HypervisorCapabilities, Identit
public void setUuid(String uuid) {
this.uuid = uuid;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof HypervisorCapabilitiesVO) {
return ((HypervisorCapabilitiesVO)obj).getId() == this.getId();
} else {
return false;
}
}
}
}
@Override
public boolean equals(Object obj) {
if (obj instanceof HypervisorCapabilitiesVO) {
return ((HypervisorCapabilitiesVO)obj).getId() == this.getId();
} else {
return false;
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.hypervisor.vmware.manager;
package com.cloud.hypervisor.vmware.manager;
import java.io.File;
import java.util.List;
import java.util.Map;
@ -21,14 +21,14 @@ import com.cloud.hypervisor.vmware.mo.HostMO;
import com.cloud.hypervisor.vmware.util.VmwareContext;
import com.cloud.utils.Pair;
import com.vmware.vim25.ManagedObjectReference;
public interface VmwareManager {
public interface VmwareManager {
public final String CONTEXT_STOCK_NAME = "vmwareMgr";
// this limitation comes from the fact that we are using linked clone on shared VMFS storage,
// we need to limit the size of vCenter cluster, http://en.wikipedia.org/wiki/VMware_VMFS
public final int MAX_HOSTS_PER_CLUSTER = 8;
public final int MAX_HOSTS_PER_CLUSTER = 8;
String composeWorkerName();
String getSystemVMIsoFileNameOnDatastore();
@ -39,25 +39,25 @@ public interface VmwareManager {
void setupResourceStartupParams(Map<String, Object> params);
List<ManagedObjectReference> addHostToPodCluster(VmwareContext serviceContext, long dcId, Long podId, Long clusterId,
String hostInventoryPath) throws Exception;
String getManagementPortGroupByHost(HostMO hostMo) throws Exception;
String getServiceConsolePortGroupName();
String getManagementPortGroupName();
String getSecondaryStorageStoreUrl(long dcId);
File getSystemVMKeyFile();
File getSystemVMKeyFile();
VmwareStorageManager getStorageManager();
long pushCleanupCheckpoint(String hostGuid, String vmName);
void popCleanupCheckpoint(long checkpiont);
void gcLeftOverVMs(VmwareContext context);
void gcLeftOverVMs(VmwareContext context);
Pair<Integer, Integer> getAddiionalVncPortRange();
int getMaxHostsPerCluster();
int getRouterExtraPublicNics();
boolean beginExclusiveOperation(int timeOutSeconds);
boolean beginExclusiveOperation(int timeOutSeconds);
void endExclusiveOperation();
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.hypervisor.vmware.manager;
package com.cloud.hypervisor.vmware.manager;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.BackupSnapshotCommand;
import com.cloud.agent.api.CreatePrivateTemplateFromSnapshotCommand;
@ -19,12 +19,12 @@ import com.cloud.agent.api.CreatePrivateTemplateFromVolumeCommand;
import com.cloud.agent.api.CreateVolumeFromSnapshotCommand;
import com.cloud.agent.api.storage.CopyVolumeCommand;
import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
public interface VmwareStorageManager {
Answer execute(VmwareHostService hostService, PrimaryStorageDownloadCommand cmd);
Answer execute(VmwareHostService hostService, BackupSnapshotCommand cmd);
Answer execute(VmwareHostService hostService, CreatePrivateTemplateFromVolumeCommand cmd);
Answer execute(VmwareHostService hostService, CreatePrivateTemplateFromSnapshotCommand cmd);
Answer execute(VmwareHostService hostService, CopyVolumeCommand cmd);
Answer execute(VmwareHostService hostService, CreateVolumeFromSnapshotCommand cmd);
}
public interface VmwareStorageManager {
Answer execute(VmwareHostService hostService, PrimaryStorageDownloadCommand cmd);
Answer execute(VmwareHostService hostService, BackupSnapshotCommand cmd);
Answer execute(VmwareHostService hostService, CreatePrivateTemplateFromVolumeCommand cmd);
Answer execute(VmwareHostService hostService, CreatePrivateTemplateFromSnapshotCommand cmd);
Answer execute(VmwareHostService hostService, CopyVolumeCommand cmd);
Answer execute(VmwareHostService hostService, CreateVolumeFromSnapshotCommand cmd);
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.hypervisor.vmware.manager;
public interface VmwareStorageMount {
String getMountPoint(String storageUrl);
}
package com.cloud.hypervisor.vmware.manager;
public interface VmwareStorageMount {
String getMountPoint(String storageUrl);
}

View File

@ -10,146 +10,146 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.hypervisor.vmware.resource;
import java.io.File;
import java.io.InputStream;
import org.apache.log4j.Logger;
import com.cloud.utils.Pair;
import com.trilead.ssh2.ChannelCondition;
public class SshHelper {
private static int DEFAULT_CONNECT_TIMEOUT = 60000;
private static int DEFAULT_KEX_TIMEOUT = 60000;
private static final Logger s_logger = Logger.getLogger(SshHelper.class);
public static Pair<Boolean, String> sshExecute(String host, int port, String user, File pemKeyFile, String password, String command)
throws Exception {
return sshExecute(host, port, user, pemKeyFile, password, command, 60000, 60000, 120000);
}
public static void scpTo(String host, int port, String user, File pemKeyFile, String password, String remoteTargetDirectory,
String localFile, String fileMode) throws Exception {
scpTo(host, port, user, pemKeyFile, password, remoteTargetDirectory, localFile, fileMode,
DEFAULT_CONNECT_TIMEOUT, DEFAULT_KEX_TIMEOUT);
}
public static void scpTo(String host, int port, String user, File pemKeyFile, String password, String remoteTargetDirectory,
byte[] data, String remoteFileName, String fileMode) throws Exception {
scpTo(host, port, user, pemKeyFile, password, remoteTargetDirectory, data, remoteFileName, fileMode,
DEFAULT_CONNECT_TIMEOUT, DEFAULT_KEX_TIMEOUT);
}
public static void scpTo(String host, int port, String user, File pemKeyFile, String password, String remoteTargetDirectory,
String localFile, String fileMode, int connectTimeoutInMs, int kexTimeoutInMs) throws Exception {
com.trilead.ssh2.Connection conn = null;
com.trilead.ssh2.SCPClient scpClient = null;
try {
conn = new com.trilead.ssh2.Connection(host, port);
conn.connect(null, connectTimeoutInMs, kexTimeoutInMs);
if(pemKeyFile == null) {
if(!conn.authenticateWithPassword(user, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
} else {
if(!conn.authenticateWithPublicKey(user, pemKeyFile, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
}
scpClient = conn.createSCPClient();
if(fileMode != null)
scpClient.put(localFile, remoteTargetDirectory, fileMode);
else
scpClient.put(localFile, remoteTargetDirectory);
} finally {
if(conn != null)
conn.close();
}
}
public static void scpTo(String host, int port, String user, File pemKeyFile, String password, String remoteTargetDirectory,
byte[] data, String remoteFileName, String fileMode, int connectTimeoutInMs, int kexTimeoutInMs) throws Exception {
com.trilead.ssh2.Connection conn = null;
com.trilead.ssh2.SCPClient scpClient = null;
try {
conn = new com.trilead.ssh2.Connection(host, port);
conn.connect(null, connectTimeoutInMs, kexTimeoutInMs);
if(pemKeyFile == null) {
if(!conn.authenticateWithPassword(user, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
} else {
if(!conn.authenticateWithPublicKey(user, pemKeyFile, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
}
scpClient = conn.createSCPClient();
if(fileMode != null)
scpClient.put(data, remoteFileName, remoteTargetDirectory, fileMode);
else
scpClient.put(data, remoteFileName, remoteTargetDirectory);
} finally {
if(conn != null)
conn.close();
}
}
public static Pair<Boolean, String> sshExecute(String host, int port, String user, File pemKeyFile, String password, String command,
int connectTimeoutInMs, int kexTimeoutInMs, int waitResultTimeoutInMs) throws Exception {
com.trilead.ssh2.Connection conn = null;
com.trilead.ssh2.Session sess = null;
try {
conn = new com.trilead.ssh2.Connection(host, port);
conn.connect(null, connectTimeoutInMs, kexTimeoutInMs);
if(pemKeyFile == null) {
if(!conn.authenticateWithPassword(user, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
} else {
if(!conn.authenticateWithPublicKey(user, pemKeyFile, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
}
sess = conn.openSession();
// There is a bug in Trilead library, wait a second before
// starting a shell and executing commands, from http://spci.st.ewi.tudelft.nl/chiron/xref/nl/tudelft/swerl/util/SSHConnection.html
Thread.sleep(1000);
sess.execCommand(command);
InputStream stdout = sess.getStdout();
InputStream stderr = sess.getStderr();
package com.cloud.hypervisor.vmware.resource;
import java.io.File;
import java.io.InputStream;
import org.apache.log4j.Logger;
import com.cloud.utils.Pair;
import com.trilead.ssh2.ChannelCondition;
public class SshHelper {
private static int DEFAULT_CONNECT_TIMEOUT = 60000;
private static int DEFAULT_KEX_TIMEOUT = 60000;
private static final Logger s_logger = Logger.getLogger(SshHelper.class);
public static Pair<Boolean, String> sshExecute(String host, int port, String user, File pemKeyFile, String password, String command)
throws Exception {
return sshExecute(host, port, user, pemKeyFile, password, command, 60000, 60000, 120000);
}
public static void scpTo(String host, int port, String user, File pemKeyFile, String password, String remoteTargetDirectory,
String localFile, String fileMode) throws Exception {
scpTo(host, port, user, pemKeyFile, password, remoteTargetDirectory, localFile, fileMode,
DEFAULT_CONNECT_TIMEOUT, DEFAULT_KEX_TIMEOUT);
}
public static void scpTo(String host, int port, String user, File pemKeyFile, String password, String remoteTargetDirectory,
byte[] data, String remoteFileName, String fileMode) throws Exception {
scpTo(host, port, user, pemKeyFile, password, remoteTargetDirectory, data, remoteFileName, fileMode,
DEFAULT_CONNECT_TIMEOUT, DEFAULT_KEX_TIMEOUT);
}
public static void scpTo(String host, int port, String user, File pemKeyFile, String password, String remoteTargetDirectory,
String localFile, String fileMode, int connectTimeoutInMs, int kexTimeoutInMs) throws Exception {
com.trilead.ssh2.Connection conn = null;
com.trilead.ssh2.SCPClient scpClient = null;
try {
conn = new com.trilead.ssh2.Connection(host, port);
conn.connect(null, connectTimeoutInMs, kexTimeoutInMs);
if(pemKeyFile == null) {
if(!conn.authenticateWithPassword(user, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
} else {
if(!conn.authenticateWithPublicKey(user, pemKeyFile, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
}
scpClient = conn.createSCPClient();
if(fileMode != null)
scpClient.put(localFile, remoteTargetDirectory, fileMode);
else
scpClient.put(localFile, remoteTargetDirectory);
} finally {
if(conn != null)
conn.close();
}
}
public static void scpTo(String host, int port, String user, File pemKeyFile, String password, String remoteTargetDirectory,
byte[] data, String remoteFileName, String fileMode, int connectTimeoutInMs, int kexTimeoutInMs) throws Exception {
com.trilead.ssh2.Connection conn = null;
com.trilead.ssh2.SCPClient scpClient = null;
try {
conn = new com.trilead.ssh2.Connection(host, port);
conn.connect(null, connectTimeoutInMs, kexTimeoutInMs);
if(pemKeyFile == null) {
if(!conn.authenticateWithPassword(user, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
} else {
if(!conn.authenticateWithPublicKey(user, pemKeyFile, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
}
scpClient = conn.createSCPClient();
if(fileMode != null)
scpClient.put(data, remoteFileName, remoteTargetDirectory, fileMode);
else
scpClient.put(data, remoteFileName, remoteTargetDirectory);
} finally {
if(conn != null)
conn.close();
}
}
public static Pair<Boolean, String> sshExecute(String host, int port, String user, File pemKeyFile, String password, String command,
int connectTimeoutInMs, int kexTimeoutInMs, int waitResultTimeoutInMs) throws Exception {
com.trilead.ssh2.Connection conn = null;
com.trilead.ssh2.Session sess = null;
try {
conn = new com.trilead.ssh2.Connection(host, port);
conn.connect(null, connectTimeoutInMs, kexTimeoutInMs);
if(pemKeyFile == null) {
if(!conn.authenticateWithPassword(user, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
} else {
if(!conn.authenticateWithPublicKey(user, pemKeyFile, password)) {
String msg = "Failed to authentication SSH user " + user + " on host " + host;
s_logger.error(msg);
throw new Exception(msg);
}
}
sess = conn.openSession();
// There is a bug in Trilead library, wait a second before
// starting a shell and executing commands, from http://spci.st.ewi.tudelft.nl/chiron/xref/nl/tudelft/swerl/util/SSHConnection.html
Thread.sleep(1000);
sess.execCommand(command);
InputStream stdout = sess.getStdout();
InputStream stderr = sess.getStderr();
byte[] buffer = new byte[8192];
StringBuffer sbResult = new StringBuffer();
@ -190,12 +190,12 @@ public class SshHelper {
}
return new Pair<Boolean, String>(true, result);
} finally {
if(sess != null)
sess.close();
if(conn != null)
conn.close();
}
}
}
} finally {
if(sess != null)
sess.close();
if(conn != null)
conn.close();
}
}
}

View File

@ -10,51 +10,51 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.hypervisor.vmware.resource;
package com.cloud.hypervisor.vmware.resource;
import org.apache.log4j.Logger;
import com.cloud.hypervisor.vmware.manager.VmwareManager;
import com.cloud.hypervisor.vmware.util.VmwareContext;
import com.cloud.hypervisor.vmware.manager.VmwareManager;
import com.cloud.hypervisor.vmware.util.VmwareContext;
import com.cloud.utils.StringUtils;
import com.cloud.utils.component.ComponentLocator;
import com.vmware.apputils.version.ExtendedAppUtil;
import com.cloud.utils.component.ComponentLocator;
import com.vmware.apputils.version.ExtendedAppUtil;
public class VmwareContextFactory {
private static final Logger s_logger = Logger.getLogger(VmwareContextFactory.class);
private static volatile int s_seq = 1;
private static VmwareManager s_vmwareMgr;
static {
// skip certificate check
System.setProperty("axis.socketSecureFactory", "org.apache.axis.components.net.SunFakeTrustSocketFactory");
ComponentLocator locator = ComponentLocator.getLocator("management-server");
s_vmwareMgr = locator.getManager(VmwareManager.class);
}
public static VmwareContext create(String vCenterAddress, String vCenterUserName, String vCenterPassword) throws Exception {
assert(vCenterAddress != null);
assert(vCenterUserName != null);
assert(vCenterPassword != null);
String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";
String[] params = new String[] {"--url", serviceUrl, "--username", vCenterUserName, "--password", vCenterPassword };
private static volatile int s_seq = 1;
private static VmwareManager s_vmwareMgr;
static {
// skip certificate check
System.setProperty("axis.socketSecureFactory", "org.apache.axis.components.net.SunFakeTrustSocketFactory");
ComponentLocator locator = ComponentLocator.getLocator("management-server");
s_vmwareMgr = locator.getManager(VmwareManager.class);
}
public static VmwareContext create(String vCenterAddress, String vCenterUserName, String vCenterPassword) throws Exception {
assert(vCenterAddress != null);
assert(vCenterUserName != null);
assert(vCenterPassword != null);
String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";
String[] params = new String[] {"--url", serviceUrl, "--username", vCenterUserName, "--password", vCenterPassword };
if(s_logger.isDebugEnabled())
s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword));
ExtendedAppUtil appUtil = ExtendedAppUtil.initialize(vCenterAddress + "-" + s_seq++, params);
appUtil.connect();
VmwareContext context = new VmwareContext(appUtil, vCenterAddress);
context.registerStockObject(VmwareManager.CONTEXT_STOCK_NAME, s_vmwareMgr);
context.registerStockObject("serviceconsole", s_vmwareMgr.getServiceConsolePortGroupName());
ExtendedAppUtil appUtil = ExtendedAppUtil.initialize(vCenterAddress + "-" + s_seq++, params);
appUtil.connect();
VmwareContext context = new VmwareContext(appUtil, vCenterAddress);
context.registerStockObject(VmwareManager.CONTEXT_STOCK_NAME, s_vmwareMgr);
context.registerStockObject("serviceconsole", s_vmwareMgr.getServiceConsolePortGroupName());
context.registerStockObject("manageportgroup", s_vmwareMgr.getManagementPortGroupName());
return context;
}
}
return context;
}
}

View File

@ -10,16 +10,16 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.info;
public class ConsoleProxyConnectionInfo {
public int id;
public String host;
public int port;
public String tag;
public long createTime;
public long lastUsedTime;
public ConsoleProxyConnectionInfo() {
}
}
package com.cloud.info;
public class ConsoleProxyConnectionInfo {
public int id;
public String host;
public int port;
public String tag;
public long createTime;
public long lastUsedTime;
public ConsoleProxyConnectionInfo() {
}
}

View File

@ -10,83 +10,83 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.info;
public class ConsoleProxyInfo {
private boolean sslEnabled;
private String proxyAddress;
private int proxyPort;
private String proxyImageUrl;
private int proxyUrlPort = 8000;
public ConsoleProxyInfo(int proxyUrlPort) {
this.proxyUrlPort = proxyUrlPort;
}
public ConsoleProxyInfo(boolean sslEnabled, String proxyIpAddress, int port, int proxyUrlPort, String consoleProxyUrlDomain) {
this.sslEnabled = sslEnabled;
if(sslEnabled) {
StringBuffer sb = new StringBuffer(proxyIpAddress);
for(int i = 0; i < sb.length(); i++)
if(sb.charAt(i) == '.')
package com.cloud.info;
public class ConsoleProxyInfo {
private boolean sslEnabled;
private String proxyAddress;
private int proxyPort;
private String proxyImageUrl;
private int proxyUrlPort = 8000;
public ConsoleProxyInfo(int proxyUrlPort) {
this.proxyUrlPort = proxyUrlPort;
}
public ConsoleProxyInfo(boolean sslEnabled, String proxyIpAddress, int port, int proxyUrlPort, String consoleProxyUrlDomain) {
this.sslEnabled = sslEnabled;
if(sslEnabled) {
StringBuffer sb = new StringBuffer(proxyIpAddress);
for(int i = 0; i < sb.length(); i++)
if(sb.charAt(i) == '.')
sb.setCharAt(i, '-');
if(consoleProxyUrlDomain!=null && consoleProxyUrlDomain.length()>0)
{
sb.append(".");
sb.append(consoleProxyUrlDomain);
}
else
else
sb.append(".realhostip.com");
proxyAddress = sb.toString();
proxyPort = port;
this.proxyUrlPort = proxyUrlPort;
proxyImageUrl = "https://" + proxyAddress;
if(proxyUrlPort != 443)
proxyImageUrl += ":" + this.proxyUrlPort;
} else {
proxyAddress = proxyIpAddress;
proxyPort = port;
this.proxyUrlPort = proxyUrlPort;
proxyImageUrl = "http://" + proxyAddress;
if(proxyUrlPort != 80)
proxyImageUrl += ":" + proxyUrlPort;
}
}
public String getProxyAddress() {
return proxyAddress;
}
public void setProxyAddress(String proxyAddress) {
this.proxyAddress = proxyAddress;
}
public int getProxyPort() {
return proxyPort;
}
public void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
}
public String getProxyImageUrl() {
return proxyImageUrl;
}
public void setProxyImageUrl(String proxyImageUrl) {
this.proxyImageUrl = proxyImageUrl;
}
public boolean isSslEnabled() {
return sslEnabled;
}
public void setSslEnabled(boolean sslEnabled) {
this.sslEnabled = sslEnabled;
}
}
proxyAddress = sb.toString();
proxyPort = port;
this.proxyUrlPort = proxyUrlPort;
proxyImageUrl = "https://" + proxyAddress;
if(proxyUrlPort != 443)
proxyImageUrl += ":" + this.proxyUrlPort;
} else {
proxyAddress = proxyIpAddress;
proxyPort = port;
this.proxyUrlPort = proxyUrlPort;
proxyImageUrl = "http://" + proxyAddress;
if(proxyUrlPort != 80)
proxyImageUrl += ":" + proxyUrlPort;
}
}
public String getProxyAddress() {
return proxyAddress;
}
public void setProxyAddress(String proxyAddress) {
this.proxyAddress = proxyAddress;
}
public int getProxyPort() {
return proxyPort;
}
public void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
}
public String getProxyImageUrl() {
return proxyImageUrl;
}
public void setProxyImageUrl(String proxyImageUrl) {
this.proxyImageUrl = proxyImageUrl;
}
public boolean isSslEnabled() {
return sslEnabled;
}
public void setSslEnabled(boolean sslEnabled) {
this.sslEnabled = sslEnabled;
}
}

View File

@ -10,35 +10,35 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.info;
public class ConsoleProxyLoadInfo {
private long id;
private String name;
private int count;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}
package com.cloud.info;
public class ConsoleProxyLoadInfo {
private long id;
private String name;
private int count;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}

View File

@ -10,15 +10,15 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.info;
public class ConsoleProxyStatus {
private ConsoleProxyConnectionInfo[] connections;
public ConsoleProxyStatus() {
}
public ConsoleProxyConnectionInfo[] getConnections() {
return connections;
}
}
package com.cloud.info;
public class ConsoleProxyStatus {
private ConsoleProxyConnectionInfo[] connections;
public ConsoleProxyStatus() {
}
public ConsoleProxyConnectionInfo[] getConnections() {
return connections;
}
}

View File

@ -10,35 +10,35 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.info;
public class RunningHostCountInfo {
private long dcId;
private String hostType;
private int count;
public long getDcId() {
return dcId;
}
public void setDcId(long dcId) {
this.dcId = dcId;
}
public String getHostType() {
return hostType;
}
public void setHostType(String hostType) {
this.hostType = hostType;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}
package com.cloud.info;
public class RunningHostCountInfo {
private long dcId;
private String hostType;
private int count;
public long getDcId() {
return dcId;
}
public void setDcId(long dcId) {
this.dcId = dcId;
}
public String getHostType() {
return hostType;
}
public void setHostType(String hostType) {
this.hostType = hostType;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}

View File

@ -10,72 +10,72 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.info;
import java.util.HashMap;
import java.util.Map;
package com.cloud.info;
import java.util.HashMap;
import java.util.Map;
import com.cloud.host.Host;
public class RunningHostInfoAgregator {
public static class ZoneHostInfo {
public static int ROUTING_HOST_MASK = 2;
public static int STORAGE_HOST_MASK = 4;
public static int ALL_HOST_MASK = ROUTING_HOST_MASK | STORAGE_HOST_MASK;
private long dcId;
// (1 << 1) : at least one routing host is running in the zone
// (1 << 2) : at least one storage host is running in the zone
private int flags = 0;
public long getDcId() {
return dcId;
}
public void setDcId(long dcId) {
this.dcId = dcId;
}
public void setFlag(int flagMask) {
flags |= flagMask;
}
public int getFlags() {
return flags;
}
}
private Map<Long, ZoneHostInfo> zoneHostInfoMap = new HashMap<Long, ZoneHostInfo>();
public RunningHostInfoAgregator() {
}
public void aggregate(RunningHostCountInfo countInfo) {
if(countInfo.getCount() > 0) {
ZoneHostInfo zoneInfo = getZoneHostInfo(countInfo.getDcId());
Host.Type type = Enum.valueOf(Host.Type.class, countInfo.getHostType());
if(type == Host.Type.Routing) {
zoneInfo.setFlag(ZoneHostInfo.ROUTING_HOST_MASK);
} else if(type == Host.Type.Storage || type == Host.Type.SecondaryStorage) {
zoneInfo.setFlag(ZoneHostInfo.STORAGE_HOST_MASK);
}
}
}
public Map<Long, ZoneHostInfo> getZoneHostInfoMap() {
return zoneHostInfoMap;
}
private ZoneHostInfo getZoneHostInfo(long dcId) {
if(zoneHostInfoMap.containsKey(dcId))
return zoneHostInfoMap.get(dcId);
ZoneHostInfo info = new ZoneHostInfo();
info.setDcId(dcId);
zoneHostInfoMap.put(dcId, info);
return info;
}
}
public class RunningHostInfoAgregator {
public static class ZoneHostInfo {
public static int ROUTING_HOST_MASK = 2;
public static int STORAGE_HOST_MASK = 4;
public static int ALL_HOST_MASK = ROUTING_HOST_MASK | STORAGE_HOST_MASK;
private long dcId;
// (1 << 1) : at least one routing host is running in the zone
// (1 << 2) : at least one storage host is running in the zone
private int flags = 0;
public long getDcId() {
return dcId;
}
public void setDcId(long dcId) {
this.dcId = dcId;
}
public void setFlag(int flagMask) {
flags |= flagMask;
}
public int getFlags() {
return flags;
}
}
private Map<Long, ZoneHostInfo> zoneHostInfoMap = new HashMap<Long, ZoneHostInfo>();
public RunningHostInfoAgregator() {
}
public void aggregate(RunningHostCountInfo countInfo) {
if(countInfo.getCount() > 0) {
ZoneHostInfo zoneInfo = getZoneHostInfo(countInfo.getDcId());
Host.Type type = Enum.valueOf(Host.Type.class, countInfo.getHostType());
if(type == Host.Type.Routing) {
zoneInfo.setFlag(ZoneHostInfo.ROUTING_HOST_MASK);
} else if(type == Host.Type.Storage || type == Host.Type.SecondaryStorage) {
zoneInfo.setFlag(ZoneHostInfo.STORAGE_HOST_MASK);
}
}
}
public Map<Long, ZoneHostInfo> getZoneHostInfoMap() {
return zoneHostInfoMap;
}
private ZoneHostInfo getZoneHostInfo(long dcId) {
if(zoneHostInfoMap.containsKey(dcId))
return zoneHostInfoMap.get(dcId);
ZoneHostInfo info = new ZoneHostInfo();
info.setDcId(dcId);
zoneHostInfoMap.put(dcId, info);
return info;
}
}

View File

@ -10,35 +10,35 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.info;
public class SecStorageVmLoadInfo {
private long id;
private String name;
private int count;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}
package com.cloud.info;
public class SecStorageVmLoadInfo {
private long id;
private String name;
private int count;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.network;
package com.cloud.network;
import java.util.UUID;
import javax.persistence.Column;
@ -24,22 +24,22 @@ import javax.persistence.Id;
import javax.persistence.Table;
import com.cloud.api.Identity;
@Entity
@Table(name=("vpn_users"))
public class VpnUserVO implements VpnUser, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="owner_id")
private long accountId;
@Entity
@Table(name=("vpn_users"))
public class VpnUserVO implements VpnUser, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="owner_id")
private long accountId;
@Column(name="domain_id")
private long domainId;
@Column(name="username")
private long domainId;
@Column(name="username")
private String username;
@Column(name="password", encryptable=true)
@ -47,34 +47,34 @@ public class VpnUserVO implements VpnUser, Identity {
@Column(name="state")
@Enumerated(value=EnumType.STRING)
private State state;
private State state;
@Column(name="uuid")
private String uuid;
public VpnUserVO() {
this.uuid = UUID.randomUUID().toString();
}
public VpnUserVO(long accountId, long domainId, String userName, String password) {
}
public VpnUserVO(long accountId, long domainId, String userName, String password) {
this.accountId = accountId;
this.domainId = domainId;
this.username = userName;
this.password = password;
this.state = State.Add;
this.uuid = UUID.randomUUID().toString();
}
@Override
public long getId() {
return id;
}
@Override
public long getAccountId() {
return accountId;
}
public long getId() {
return id;
}
@Override
public long getAccountId() {
return accountId;
}
@Override
public String getUsername() {
return username;
@ -120,5 +120,5 @@ public class VpnUserVO implements VpnUser, Identity {
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
}
}

View File

@ -10,93 +10,93 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.resource;
import java.net.URI;
import java.util.List;
import java.util.Map;
import com.cloud.host.HostVO;
public interface ResourceListener {
static final Integer EVENT_DISCOVER_BEFORE = 0x1;
static final Integer EVENT_DISCOVER_AFTER = 0x1 << 1;
static final Integer EVENT_DELETE_HOST_BEFORE = 0x1 << 2;
static final Integer EVENT_DELETE_HOST_AFTER = 0x1 << 3;
static final Integer EVENT_CANCEL_MAINTENANCE_BEFORE = 0x1 << 4;
static final Integer EVENT_CANCEL_MAINTENANCE_AFTER = 0x1 << 5;
static final Integer EVENT_PREPARE_MAINTENANCE_BEFORE = 0x1 << 6;
static final Integer EVENT_PREPARE_MAINTENANCE_AFTER = 0x1 << 7;
static final Integer EVENT_ALL = (EVENT_DISCOVER_BEFORE | EVENT_DISCOVER_AFTER | EVENT_DELETE_HOST_BEFORE | EVENT_DELETE_HOST_AFTER
| EVENT_CANCEL_MAINTENANCE_BEFORE | EVENT_CANCEL_MAINTENANCE_AFTER | EVENT_PREPARE_MAINTENANCE_BEFORE | EVENT_PREPARE_MAINTENANCE_AFTER);
/**
*
* @param dcid
* @param podId
* @param clusterId
* @param uri
* @param username
* @param password
* @param hostTags
*
* Called before Discover.find()
*/
void processDiscoverEventBefore(Long dcid, Long podId, Long clusterId, URI uri, String username, String password, List<String> hostTags);
/**
*
* @param resources
*
* Called after Discover.find()
*/
void processDiscoverEventAfter(Map<? extends ServerResource, Map<String, String>> resources);
/**
*
* @param host
*
* Called before host delete
*/
void processDeleteHostEventBefore(HostVO host);
/**
*
* @param host
*
* Called after host delete. NOTE param host includes stale data which has been removed from database
*/
void processDeletHostEventAfter(HostVO host);
/**
*
* @param hostId
*
* Called before AgentManager.cancelMaintenance
*/
void processCancelMaintenaceEventBefore(Long hostId);
/**
*
* @param hostId
*
* Called after AgentManager.cancelMaintenance
*/
void processCancelMaintenaceEventAfter(Long hostId);
/**
*
* @param hostId
*
* Called before AgentManager.main
*/
void processPrepareMaintenaceEventBefore(Long hostId);
/**
*
* @param hostId
*
* Called after AgentManager.main
*/
void processPrepareMaintenaceEventAfter(Long hostId);
}
package com.cloud.resource;
import java.net.URI;
import java.util.List;
import java.util.Map;
import com.cloud.host.HostVO;
public interface ResourceListener {
static final Integer EVENT_DISCOVER_BEFORE = 0x1;
static final Integer EVENT_DISCOVER_AFTER = 0x1 << 1;
static final Integer EVENT_DELETE_HOST_BEFORE = 0x1 << 2;
static final Integer EVENT_DELETE_HOST_AFTER = 0x1 << 3;
static final Integer EVENT_CANCEL_MAINTENANCE_BEFORE = 0x1 << 4;
static final Integer EVENT_CANCEL_MAINTENANCE_AFTER = 0x1 << 5;
static final Integer EVENT_PREPARE_MAINTENANCE_BEFORE = 0x1 << 6;
static final Integer EVENT_PREPARE_MAINTENANCE_AFTER = 0x1 << 7;
static final Integer EVENT_ALL = (EVENT_DISCOVER_BEFORE | EVENT_DISCOVER_AFTER | EVENT_DELETE_HOST_BEFORE | EVENT_DELETE_HOST_AFTER
| EVENT_CANCEL_MAINTENANCE_BEFORE | EVENT_CANCEL_MAINTENANCE_AFTER | EVENT_PREPARE_MAINTENANCE_BEFORE | EVENT_PREPARE_MAINTENANCE_AFTER);
/**
*
* @param dcid
* @param podId
* @param clusterId
* @param uri
* @param username
* @param password
* @param hostTags
*
* Called before Discover.find()
*/
void processDiscoverEventBefore(Long dcid, Long podId, Long clusterId, URI uri, String username, String password, List<String> hostTags);
/**
*
* @param resources
*
* Called after Discover.find()
*/
void processDiscoverEventAfter(Map<? extends ServerResource, Map<String, String>> resources);
/**
*
* @param host
*
* Called before host delete
*/
void processDeleteHostEventBefore(HostVO host);
/**
*
* @param host
*
* Called after host delete. NOTE param host includes stale data which has been removed from database
*/
void processDeletHostEventAfter(HostVO host);
/**
*
* @param hostId
*
* Called before AgentManager.cancelMaintenance
*/
void processCancelMaintenaceEventBefore(Long hostId);
/**
*
* @param hostId
*
* Called after AgentManager.cancelMaintenance
*/
void processCancelMaintenaceEventAfter(Long hostId);
/**
*
* @param hostId
*
* Called before AgentManager.main
*/
void processPrepareMaintenaceEventBefore(Long hostId);
/**
*
* @param hostId
*
* Called after AgentManager.main
*/
void processPrepareMaintenaceEventAfter(Long hostId);
}

View File

@ -10,15 +10,15 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.resource;
import com.cloud.utils.SerialVersionUID;
import com.cloud.exception.CloudException;
public class UnableDeleteHostException extends CloudException {
private static final long serialVersionUID = SerialVersionUID.UnableDeleteHostException;
public UnableDeleteHostException(String msg) {
super(msg);
}
}
package com.cloud.resource;
import com.cloud.utils.SerialVersionUID;
import com.cloud.exception.CloudException;
public class UnableDeleteHostException extends CloudException {
private static final long serialVersionUID = SerialVersionUID.UnableDeleteHostException;
public UnableDeleteHostException(String msg) {
super(msg);
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.serializer;
package com.cloud.serializer;
import java.util.List;
@ -29,10 +29,10 @@ import com.cloud.utils.Pair;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
public class GsonHelper {
private static final Logger s_logger = Logger.getLogger(GsonHelper.class);
protected static final Gson s_gson;
protected static final Gson s_gogger;
@ -73,4 +73,4 @@ public class GsonHelper {
public final static Logger getLogger() {
return s_logger;
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.serializer;
package com.cloud.serializer;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@ -25,13 +25,13 @@ import org.apache.log4j.Logger;
import com.cloud.utils.DateUtil;
import com.cloud.utils.Pair;
import com.google.gson.Gson;
/**
* Note: toPairList and appendPairList only support simple POJO objects currently
*/
public class SerializerHelper {
/**
* Note: toPairList and appendPairList only support simple POJO objects currently
*/
public class SerializerHelper {
public static final Logger s_logger = Logger.getLogger(SerializerHelper.class.getName());
public static String token = "/";
public static String token = "/";
public static String toSerializedStringOld(Object result) {
if(result != null) {
@ -79,106 +79,106 @@ public class SerializerHelper {
throw e;
}
}
public static List<Pair<String, Object>> toPairList(Object o, String name) {
List<Pair<String, Object>> l = new ArrayList<Pair<String, Object>>();
return appendPairList(l, o, name);
}
public static List<Pair<String, Object>> appendPairList(List<Pair<String, Object>> l, Object o, String name) {
if(o != null) {
Class<?> clz = o.getClass();
if(clz.isPrimitive() || clz.getSuperclass() == Number.class || clz == String.class || clz == Date.class) {
l.add(new Pair<String, Object>(name, o.toString()));
return l;
}
for(Field f : clz.getDeclaredFields()) {
public static List<Pair<String, Object>> toPairList(Object o, String name) {
List<Pair<String, Object>> l = new ArrayList<Pair<String, Object>>();
return appendPairList(l, o, name);
}
public static List<Pair<String, Object>> appendPairList(List<Pair<String, Object>> l, Object o, String name) {
if(o != null) {
Class<?> clz = o.getClass();
if(clz.isPrimitive() || clz.getSuperclass() == Number.class || clz == String.class || clz == Date.class) {
l.add(new Pair<String, Object>(name, o.toString()));
return l;
}
for(Field f : clz.getDeclaredFields()) {
if((f.getModifiers() & Modifier.STATIC) != 0) {
continue;
}
Param param = f.getAnnotation(Param.class);
}
Param param = f.getAnnotation(Param.class);
if(param == null) {
continue;
}
String propName = f.getName();
}
String propName = f.getName();
if(!param.propName().isEmpty()) {
propName = param.propName();
}
String paramName = param.name();
}
String paramName = param.name();
if(paramName.isEmpty()) {
paramName = propName;
}
Method method = getGetMethod(o, propName);
if(method != null) {
try {
Object fieldValue = method.invoke(o);
}
Method method = getGetMethod(o, propName);
if(method != null) {
try {
Object fieldValue = method.invoke(o);
if(fieldValue != null) {
if (f.getType() == Date.class) {
l.add(new Pair<String, Object>(paramName, DateUtil.getOutputString((Date)fieldValue)));
} else {
l.add(new Pair<String, Object>(paramName, fieldValue.toString()));
}
}
//else
// l.add(new Pair<String, Object>(paramName, ""));
} catch (IllegalArgumentException e) {
s_logger.error("Illegal argument exception when calling POJO " + o.getClass().getName() + " get method for property: " + propName);
} catch (IllegalAccessException e) {
s_logger.error("Illegal access exception when calling POJO " + o.getClass().getName() + " get method for property: " + propName);
} catch (InvocationTargetException e) {
s_logger.error("Invocation target exception when calling POJO " + o.getClass().getName() + " get method for property: " + propName);
}
}
}
}
return l;
}
private static Method getGetMethod(Object o, String propName) {
Method method = null;
String methodName = getGetMethodName("get", propName);
try {
method = o.getClass().getMethod(methodName);
} catch (SecurityException e1) {
s_logger.error("Security exception in getting POJO " + o.getClass().getName() + " get method for property: " + propName);
} catch (NoSuchMethodException e1) {
}
//else
// l.add(new Pair<String, Object>(paramName, ""));
} catch (IllegalArgumentException e) {
s_logger.error("Illegal argument exception when calling POJO " + o.getClass().getName() + " get method for property: " + propName);
} catch (IllegalAccessException e) {
s_logger.error("Illegal access exception when calling POJO " + o.getClass().getName() + " get method for property: " + propName);
} catch (InvocationTargetException e) {
s_logger.error("Invocation target exception when calling POJO " + o.getClass().getName() + " get method for property: " + propName);
}
}
}
}
return l;
}
private static Method getGetMethod(Object o, String propName) {
Method method = null;
String methodName = getGetMethodName("get", propName);
try {
method = o.getClass().getMethod(methodName);
} catch (SecurityException e1) {
s_logger.error("Security exception in getting POJO " + o.getClass().getName() + " get method for property: " + propName);
} catch (NoSuchMethodException e1) {
if(s_logger.isTraceEnabled()) {
s_logger.trace("POJO " + o.getClass().getName() + " does not have " + methodName + "() method for property: " + propName + ", will check is-prefixed method to see if it is boolean property");
}
}
}
}
if(method != null) {
return method;
}
methodName = getGetMethodName("is", propName);
try {
method = o.getClass().getMethod(methodName);
} catch (SecurityException e1) {
s_logger.error("Security exception in getting POJO " + o.getClass().getName() + " get method for property: " + propName);
} catch (NoSuchMethodException e1) {
s_logger.warn("POJO " + o.getClass().getName() + " does not have " + methodName + "() method for property: " + propName);
}
return method;
}
private static String getGetMethodName(String prefix, String fieldName) {
StringBuffer sb = new StringBuffer(prefix);
if(fieldName.length() >= prefix.length() && fieldName.substring(0, prefix.length()).equals(prefix)) {
return fieldName;
} else {
sb.append(fieldName.substring(0, 1).toUpperCase());
sb.append(fieldName.substring(1));
}
return sb.toString();
}
}
}
methodName = getGetMethodName("is", propName);
try {
method = o.getClass().getMethod(methodName);
} catch (SecurityException e1) {
s_logger.error("Security exception in getting POJO " + o.getClass().getName() + " get method for property: " + propName);
} catch (NoSuchMethodException e1) {
s_logger.warn("POJO " + o.getClass().getName() + " does not have " + methodName + "() method for property: " + propName);
}
return method;
}
private static String getGetMethodName(String prefix, String fieldName) {
StringBuffer sb = new StringBuffer(prefix);
if(fieldName.length() >= prefix.length() && fieldName.substring(0, prefix.length()).equals(prefix)) {
return fieldName;
} else {
sb.append(fieldName.substring(0, 1).toUpperCase());
sb.append(fieldName.substring(1));
}
return sb.toString();
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
package com.cloud.storage;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@ -33,8 +33,8 @@ import javax.persistence.Transient;
import com.cloud.api.Identity;
import com.cloud.offering.DiskOffering;
import com.cloud.utils.db.GenericDao;
@Entity
@Entity
@Table(name="disk_offering")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32)
@ -44,26 +44,26 @@ public class DiskOfferingVO implements DiskOffering, Identity {
Service
};
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
long id;
@Column(name="domain_id")
Long domainId;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
long id;
@Column(name="domain_id")
Long domainId;
@Column(name="unique_name")
private String uniqueName;
@Column(name="name")
private String name = null;
@Column(name="display_text", length=4096)
private String displayText = null;
@Column(name="disk_size")
long diskSize;
@Column(name="name")
private String name = null;
@Column(name="display_text", length=4096)
private String displayText = null;
@Column(name="disk_size")
long diskSize;
@Column(name="tags", length=4096)
String tags;
@ -71,8 +71,8 @@ public class DiskOfferingVO implements DiskOffering, Identity {
Type type;
@Column(name=GenericDao.REMOVED)
@Temporal(TemporalType.TIMESTAMP)
private Date removed;
@Temporal(TemporalType.TIMESTAMP)
private Date removed;
@Column(name=GenericDao.CREATED_COLUMN)
private Date created;
@ -96,19 +96,19 @@ public class DiskOfferingVO implements DiskOffering, Identity {
int sortKey;
public DiskOfferingVO() {
this.uuid = UUID.randomUUID().toString();
this.uuid = UUID.randomUUID().toString();
}
public DiskOfferingVO(Long domainId, String name, String displayText, long diskSize, String tags, boolean isCustomized) {
this.domainId = domainId;
this.name = name;
this.displayText = displayText;
public DiskOfferingVO(Long domainId, String name, String displayText, long diskSize, String tags, boolean isCustomized) {
this.domainId = domainId;
this.name = name;
this.displayText = displayText;
this.diskSize = diskSize;
this.tags = tags;
this.recreatable = false;
this.type = Type.Disk;
this.useLocalStorage = false;
this.customized = isCustomized;
this.customized = isCustomized;
this.uuid = UUID.randomUUID().toString();
}
@ -123,7 +123,7 @@ public class DiskOfferingVO implements DiskOffering, Identity {
this.systemUse = systemUse;
this.customized = customized;
this.uuid = UUID.randomUUID().toString();
}
}
//domain specific offerings constructor (null domainId implies public offering)
public DiskOfferingVO(String name, String displayText, boolean mirrored, String tags, boolean recreatable, boolean useLocalStorage, boolean systemUse, boolean customized, Long domainId) {
@ -138,10 +138,10 @@ public class DiskOfferingVO implements DiskOffering, Identity {
this.domainId = domainId;
this.uuid = UUID.randomUUID().toString();
}
@Override
public long getId() {
return id;
public long getId() {
return id;
}
@Override
@ -162,10 +162,10 @@ public class DiskOfferingVO implements DiskOffering, Identity {
public boolean getUseLocalStorage() {
return useLocalStorage;
}
@Override
public Long getDomainId() {
return domainId;
public Long getDomainId() {
return domainId;
}
public Type getType() {
@ -175,18 +175,18 @@ public class DiskOfferingVO implements DiskOffering, Identity {
public boolean isRecreatable() {
return recreatable;
}
public void setDomainId(Long domainId) {
this.domainId = domainId;
}
@Override
public String getName() {
return name;
public void setDomainId(Long domainId) {
this.domainId = domainId;
}
public void setName(String name) {
this.name = name;
@Override
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ -197,28 +197,28 @@ public class DiskOfferingVO implements DiskOffering, Identity {
public void setSystemUse(boolean systemUse) {
this.systemUse = systemUse;
}
}
@Override
public String getDisplayText() {
return displayText;
}
public void setDisplayText(String displayText) {
this.displayText = displayText;
}
public String getDisplayText() {
return displayText;
}
public void setDisplayText(String displayText) {
this.displayText = displayText;
}
@Override
public long getDiskSize(){
return diskSize;
}
@Override
public void setDiskSize(long diskSize) {
this.diskSize = diskSize;
}
public Date getRemoved() {
return removed;
@Override
public void setDiskSize(long diskSize) {
this.diskSize = diskSize;
}
public Date getRemoved() {
return removed;
}
@Override
@ -305,5 +305,5 @@ public class DiskOfferingVO implements DiskOffering, Identity {
public int getSortKey() {
return sortKey;
}
}
}
}

View File

@ -10,42 +10,42 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="launch_permission")
public class LaunchPermissionVO {
@Id
@Column(name="id")
private Long id;
@Column(name="template_id")
private long templateId;
@Column(name="account_id")
private long accountId;
public LaunchPermissionVO() { }
public LaunchPermissionVO(long templateId, long accountId) {
this.templateId = templateId;
this.accountId = accountId;
}
public Long getId() {
return id;
}
public long getTemplateId() {
return templateId;
}
public long getAccountId() {
return accountId;
}
}
package com.cloud.storage;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="launch_permission")
public class LaunchPermissionVO {
@Id
@Column(name="id")
private Long id;
@Column(name="template_id")
private long templateId;
@Column(name="account_id")
private long accountId;
public LaunchPermissionVO() { }
public LaunchPermissionVO(long templateId, long accountId) {
this.templateId = templateId;
this.accountId = accountId;
}
public Long getId() {
return id;
}
public long getTemplateId() {
return templateId;
}
public long getAccountId() {
return accountId;
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
package com.cloud.storage;
import java.util.UUID;
import javax.persistence.Column;
@ -24,66 +24,66 @@ import javax.persistence.Table;
import com.cloud.api.Identity;
import com.cloud.storage.snapshot.SnapshotPolicy;
import com.cloud.utils.DateUtil.IntervalType;
@Entity
@Table(name="snapshot_policy")
public class SnapshotPolicyVO implements SnapshotPolicy, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
long id;
@Column(name="volume_id")
long volumeId;
@Column(name="schedule")
String schedule;
@Entity
@Table(name="snapshot_policy")
public class SnapshotPolicyVO implements SnapshotPolicy, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
long id;
@Column(name="volume_id")
long volumeId;
@Column(name="schedule")
String schedule;
@Column(name="timezone")
String timezone;
@Column(name="interval")
private short interval;
@Column(name="max_snaps")
@Column(name="interval")
private short interval;
@Column(name="max_snaps")
private int maxSnaps;
@Column(name="active")
boolean active = false;
boolean active = false;
@Column(name="uuid")
String uuid;
public SnapshotPolicyVO() {
this.uuid = UUID.randomUUID().toString();
}
public SnapshotPolicyVO(long volumeId, String schedule, String timezone, IntervalType intvType, int maxSnaps) {
this.volumeId = volumeId;
}
public SnapshotPolicyVO(long volumeId, String schedule, String timezone, IntervalType intvType, int maxSnaps) {
this.volumeId = volumeId;
this.schedule = schedule;
this.timezone = timezone;
this.interval = (short)intvType.ordinal();
this.timezone = timezone;
this.interval = (short)intvType.ordinal();
this.maxSnaps = maxSnaps;
this.active = true;
this.active = true;
this.uuid = UUID.randomUUID().toString();
}
public long getId() {
return id;
}
public long getVolumeId() {
return volumeId;
}
}
public long getId() {
return id;
}
public long getVolumeId() {
return volumeId;
}
public void setSchedule(String schedule) {
this.schedule = schedule;
}
public String getSchedule() {
return schedule;
}
public String getSchedule() {
return schedule;
}
public void setInterval(short interval) {
this.interval = interval;
@ -96,17 +96,17 @@ public class SnapshotPolicyVO implements SnapshotPolicy, Identity {
public String getTimezone() {
return timezone;
}
public short getInterval() {
return interval;
}
public short getInterval() {
return interval;
}
public void setMaxSnaps(int maxSnaps) {
this.maxSnaps = maxSnaps;
}
public int getMaxSnaps() {
return maxSnaps;
public int getMaxSnaps() {
return maxSnaps;
}
public boolean isActive() {
@ -124,5 +124,5 @@ public class SnapshotPolicyVO implements SnapshotPolicy, Identity {
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
package com.cloud.storage;
import java.util.Date;
import java.util.UUID;
@ -26,67 +26,67 @@ import javax.persistence.TemporalType;
import com.cloud.api.Identity;
import com.cloud.storage.snapshot.SnapshotSchedule;
@Entity
@Table(name="snapshot_schedule")
public class SnapshotScheduleVO implements SnapshotSchedule, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
long id;
@Entity
@Table(name="snapshot_schedule")
public class SnapshotScheduleVO implements SnapshotSchedule, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
long id;
// DB constraint: For a given volume and policyId, there will only be one entry in this table.
@Column(name="volume_id")
long volumeId;
@Column(name="policy_id")
long policyId;
@Column(name="scheduled_timestamp")
@Temporal(value=TemporalType.TIMESTAMP)
// DB constraint: For a given volume and policyId, there will only be one entry in this table.
@Column(name="volume_id")
long volumeId;
@Column(name="policy_id")
long policyId;
@Column(name="scheduled_timestamp")
@Temporal(value=TemporalType.TIMESTAMP)
Date scheduledTimestamp;
@Column(name="async_job_id")
Long asyncJobId;
@Column(name="snapshot_id")
Long snapshotId;
Long snapshotId;
@Column(name="uuid")
String uuid = UUID.randomUUID().toString();
public SnapshotScheduleVO() { }
public SnapshotScheduleVO(long volumeId, long policyId, Date scheduledTimestamp) {
this.volumeId = volumeId;
this.policyId = policyId;
public SnapshotScheduleVO() { }
public SnapshotScheduleVO(long volumeId, long policyId, Date scheduledTimestamp) {
this.volumeId = volumeId;
this.policyId = policyId;
this.scheduledTimestamp = scheduledTimestamp;
this.snapshotId = null;
this.asyncJobId = null;
}
public long getId() {
return id;
}
public Long getVolumeId() {
return volumeId;
}
public Long getPolicyId() {
return policyId;
}
this.asyncJobId = null;
}
public long getId() {
return id;
}
public Long getVolumeId() {
return volumeId;
}
public Long getPolicyId() {
return policyId;
}
public void setPolicyId(long policyId) {
this.policyId = policyId;
}
/**
* @return the scheduledTimestamp
*/
public Date getScheduledTimestamp() {
return scheduledTimestamp;
/**
* @return the scheduledTimestamp
*/
public Date getScheduledTimestamp() {
return scheduledTimestamp;
}
public void setScheduledTimestamp(Date scheduledTimestamp) {
@ -116,5 +116,5 @@ public class SnapshotScheduleVO implements SnapshotSchedule, Identity {
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
package com.cloud.storage;
import java.util.Date;
import java.util.UUID;
@ -28,70 +28,70 @@ import com.cloud.api.Identity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.utils.db.GenericDao;
import com.google.gson.annotations.Expose;
@Entity
@Table(name="snapshots")
public class SnapshotVO implements Snapshot, Identity {
@Id
@Entity
@Table(name="snapshots")
public class SnapshotVO implements Snapshot, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id = -1;
@Column(name="data_center_id")
long dataCenterId;
@Column(name="account_id")
long dataCenterId;
@Column(name="account_id")
long accountId;
@Column(name="domain_id")
long domainId;
@Column(name="volume_id")
long domainId;
@Column(name="volume_id")
Long volumeId;
@Column(name="disk_offering_id")
Long diskOfferingId;
@Expose
@Column(name="path")
String path;
@Expose
@Column(name="name")
Long diskOfferingId;
@Expose
@Column(name="path")
String path;
@Expose
@Column(name="name")
String name;
@Expose
@Column(name="status", updatable = true, nullable=false)
@Enumerated(value=EnumType.STRING)
private Status status;
@Column(name="snapshot_type")
short snapshotType;
@Column(name="type_description")
@Expose
@Column(name="status", updatable = true, nullable=false)
@Enumerated(value=EnumType.STRING)
private Status status;
@Column(name="snapshot_type")
short snapshotType;
@Column(name="type_description")
String typeDescription;
@Column(name="size")
long size;
@Column(name=GenericDao.CREATED_COLUMN)
Date created;
@Column(name=GenericDao.REMOVED_COLUMN)
@Column(name=GenericDao.CREATED_COLUMN)
Date created;
@Column(name=GenericDao.REMOVED_COLUMN)
Date removed;
@Column(name="backup_snap_id")
String backupSnapshotId;
@Column(name="backup_snap_id")
String backupSnapshotId;
@Column(name="swift_id")
Long swiftId;
@Column(name="sechost_id")
Long secHostId;
@Column(name="prev_snap_id")
long prevSnapshotId;
@Column(name="prev_snap_id")
long prevSnapshotId;
@Column(name="hypervisor_type")
@Enumerated(value=EnumType.STRING)
@ -106,48 +106,48 @@ public class SnapshotVO implements Snapshot, Identity {
public SnapshotVO() {
this.uuid = UUID.randomUUID().toString();
}
}
public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long diskOfferingId, String path, String name, short snapshotType, String typeDescription, long size, HypervisorType hypervisorType ) {
this.dataCenterId = dcId;
this.accountId = accountId;
this.domainId = domainId;
this.volumeId = volumeId;
this.diskOfferingId = diskOfferingId;
this.path = path;
this.name = name;
this.snapshotType = snapshotType;
this.diskOfferingId = diskOfferingId;
this.path = path;
this.name = name;
this.snapshotType = snapshotType;
this.typeDescription = typeDescription;
this.size = size;
this.size = size;
this.status = Status.Creating;
this.prevSnapshotId = 0;
this.hypervisorType = hypervisorType;
this.version = "2.2";
this.uuid = UUID.randomUUID().toString();
}
}
@Override
public Long getId() {
return id;
}
@Override
public Long getId() {
return id;
}
public long getDataCenterId() {
return dataCenterId;
}
@Override
public long getAccountId() {
return accountId;
}
@Override
public long getAccountId() {
return accountId;
}
public long getDomainId() {
return domainId;
}
@Override
public long getVolumeId() {
return volumeId;
}
@Override
public long getVolumeId() {
return volumeId;
}
public long getDiskOfferingId() {
return diskOfferingId;
@ -157,19 +157,19 @@ public class SnapshotVO implements Snapshot, Identity {
this.volumeId = volumeId;
}
@Override
public String getPath() {
return path;
}
@Override
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public void setPath(String path) {
this.path = path;
}
@Override
public String getName() {
return name;
}
@Override
public String getName() {
return name;
}
@Override
public short getsnapshotType() {
return snapshotType;
@ -181,7 +181,7 @@ public class SnapshotVO implements Snapshot, Identity {
return null;
}
return Type.values()[snapshotType];
}
}
public Long getSwiftId() {
return swiftId;
@ -203,9 +203,9 @@ public class SnapshotVO implements Snapshot, Identity {
public HypervisorType getHypervisorType() {
return hypervisorType;
}
public void setSnapshotType(short snapshotType) {
this.snapshotType = snapshotType;
public void setSnapshotType(short snapshotType) {
this.snapshotType = snapshotType;
}
@Override
@ -214,19 +214,19 @@ public class SnapshotVO implements Snapshot, Identity {
return true;
}
return false;
}
}
public long getSize() {
return size;
}
public String getTypeDescription() {
return typeDescription;
}
public void setTypeDescription(String typeDescription) {
this.typeDescription = typeDescription;
}
public String getTypeDescription() {
return typeDescription;
}
public void setTypeDescription(String typeDescription) {
this.typeDescription = typeDescription;
}
public String getVersion() {
return version;
}
@ -235,37 +235,37 @@ public class SnapshotVO implements Snapshot, Identity {
this.version = version;
}
public Date getCreated() {
return created;
}
public Date getRemoved() {
return removed;
}
@Override
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public String getBackupSnapshotId(){
return backupSnapshotId;
}
public long getPrevSnapshotId(){
return prevSnapshotId;
}
public void setBackupSnapshotId(String backUpSnapshotId){
this.backupSnapshotId = backUpSnapshotId;
}
public void setPrevSnapshotId(long prevSnapshotId){
this.prevSnapshotId = prevSnapshotId;
public Date getCreated() {
return created;
}
public Date getRemoved() {
return removed;
}
@Override
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public String getBackupSnapshotId(){
return backupSnapshotId;
}
public long getPrevSnapshotId(){
return prevSnapshotId;
}
public void setBackupSnapshotId(String backUpSnapshotId){
this.backupSnapshotId = backUpSnapshotId;
}
public void setPrevSnapshotId(long prevSnapshotId){
this.prevSnapshotId = prevSnapshotId;
}
public static Type getSnapshotType(String snapshotType) {
@ -285,4 +285,4 @@ public class SnapshotVO implements Snapshot, Identity {
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
package com.cloud.storage;
import java.util.Date;
import java.util.UUID;
@ -25,11 +25,11 @@ import javax.persistence.Table;
import com.cloud.agent.api.to.SwiftTO;
import com.cloud.api.Identity;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="swift")
public class SwiftVO implements Swift, Identity {
@Entity
@Table(name="swift")
public class SwiftVO implements Swift, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
@ -37,13 +37,13 @@ public class SwiftVO implements Swift, Identity {
@Column(name="url")
String url;
@Column(name="account")
@Column(name="account")
String account;
@Column(name="username")
String userName;
String userName;
@Column(name="key")
String key;
@ -53,8 +53,8 @@ public class SwiftVO implements Swift, Identity {
@Column(name = GenericDao.CREATED_COLUMN)
private Date created;
public SwiftVO() { }
public SwiftVO() { }
public SwiftVO(String url, String account, String userName, String key) {
this.url = url;
this.account = account;
@ -65,7 +65,7 @@ public class SwiftVO implements Swift, Identity {
@Override
public long getId() {
return id;
}
}
@Override
public String getUrl() {
return url;
@ -100,4 +100,4 @@ public class SwiftVO implements Swift, Identity {
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
}

View File

@ -10,69 +10,69 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="vm_template_details")
public class VMTemplateDetailVO {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="template_id")
private long templateId;
@Column(name="name")
private String name;
@Column(name="value", length=1024)
private String value;
public VMTemplateDetailVO() {}
public VMTemplateDetailVO(long templateId, String name, String value) {
this.templateId = templateId;
this.name = name;
this.value = value;
}
public long getId() {
return id;
}
public long getTemplateId() {
return templateId;
}
public String getName() {
return name;
}
public String getValue() {
return value;
}
public void setId(long id) {
this.id = id;
}
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
public void setName(String name) {
this.name = name;
}
public void setValue(String value) {
this.value = value;
}
}
package com.cloud.storage;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="vm_template_details")
public class VMTemplateDetailVO {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="template_id")
private long templateId;
@Column(name="name")
private String name;
@Column(name="value", length=1024)
private String value;
public VMTemplateDetailVO() {}
public VMTemplateDetailVO(long templateId, String name, String value) {
this.templateId = templateId;
this.name = name;
this.value = value;
}
public long getId() {
return id;
}
public long getTemplateId() {
return templateId;
}
public String getName() {
return name;
}
public String getValue() {
return value;
}
public void setId(long id) {
this.id = id;
}
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
public void setName(String name) {
this.name = name;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
package com.cloud.storage;
import java.util.Date;
import javax.persistence.Column;
@ -26,214 +26,214 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.cloud.utils.db.GenericDaoBase;
/**
* Join table for storage hosts and templates
* @author chiradeep
*
*/
@Entity
@Table(name="template_host_ref")
public class VMTemplateHostVO implements VMTemplateStorageResourceAssoc {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
Long id;
@Column(name="host_id")
private long hostId;
@Column(name="template_id")
private long templateId;
@Column(name=GenericDaoBase.CREATED_COLUMN)
private Date created = null;
@Column(name="last_updated")
@Temporal(value=TemporalType.TIMESTAMP)
private Date lastUpdated = null;
@Column (name="download_pct")
/**
* Join table for storage hosts and templates
* @author chiradeep
*
*/
@Entity
@Table(name="template_host_ref")
public class VMTemplateHostVO implements VMTemplateStorageResourceAssoc {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
Long id;
@Column(name="host_id")
private long hostId;
@Column(name="template_id")
private long templateId;
@Column(name=GenericDaoBase.CREATED_COLUMN)
private Date created = null;
@Column(name="last_updated")
@Temporal(value=TemporalType.TIMESTAMP)
private Date lastUpdated = null;
@Column (name="download_pct")
private int downloadPercent;
@Column (name="size")
@Column (name="size")
private long size;
@Column (name="physical_size")
private long physicalSize;
@Column (name="download_state")
@Enumerated(EnumType.STRING)
private long physicalSize;
@Column (name="download_state")
@Enumerated(EnumType.STRING)
private Status downloadState;
@Column (name="local_path")
private String localDownloadPath;
@Column (name="error_str")
private String errorString;
@Column (name="job_id")
private String jobId;
@Column (name="install_path")
@Column (name="local_path")
private String localDownloadPath;
@Column (name="error_str")
private String errorString;
@Column (name="job_id")
private String jobId;
@Column (name="install_path")
private String installPath;
@Column (name="url")
private String downloadUrl;
@Column(name="is_copy")
private boolean isCopy = false;
private boolean isCopy = false;
@Column(name="destroyed")
boolean destroyed = false;
boolean destroyed = false;
@Override
public String getInstallPath() {
return installPath;
}
public long getHostId() {
return hostId;
}
public void setHostId(long hostId) {
this.hostId = hostId;
}
public String getInstallPath() {
return installPath;
}
public long getHostId() {
return hostId;
}
public void setHostId(long hostId) {
this.hostId = hostId;
}
@Override
public long getTemplateId() {
return templateId;
}
public long getTemplateId() {
return templateId;
}
@Override
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
@Override
public int getDownloadPercent() {
return downloadPercent;
}
public int getDownloadPercent() {
return downloadPercent;
}
@Override
public void setDownloadPercent(int downloadPercent) {
this.downloadPercent = downloadPercent;
}
public void setDownloadPercent(int downloadPercent) {
this.downloadPercent = downloadPercent;
}
@Override
public void setDownloadState(Status downloadState) {
this.downloadState = downloadState;
}
public void setDownloadState(Status downloadState) {
this.downloadState = downloadState;
}
@Override
public long getId() {
return id;
}
public long getId() {
return id;
}
@Override
public Date getCreated() {
return created;
}
public Date getCreated() {
return created;
}
@Override
public Date getLastUpdated() {
return lastUpdated;
}
public Date getLastUpdated() {
return lastUpdated;
}
@Override
public void setLastUpdated(Date date) {
lastUpdated = date;
}
public void setLastUpdated(Date date) {
lastUpdated = date;
}
@Override
public void setInstallPath(String installPath) {
this.installPath = installPath;
}
public void setInstallPath(String installPath) {
this.installPath = installPath;
}
@Override
public Status getDownloadState() {
return downloadState;
}
public VMTemplateHostVO(long hostId, long templateId) {
super();
this.hostId = hostId;
this.templateId = templateId;
}
public VMTemplateHostVO(long hostId, long templateId, Date lastUpdated,
int downloadPercent, Status downloadState,
String localDownloadPath, String errorString, String jobId,
String installPath, String downloadUrl) {
super();
this.hostId = hostId;
this.templateId = templateId;
this.lastUpdated = lastUpdated;
this.downloadPercent = downloadPercent;
this.downloadState = downloadState;
this.localDownloadPath = localDownloadPath;
this.errorString = errorString;
this.jobId = jobId;
public Status getDownloadState() {
return downloadState;
}
public VMTemplateHostVO(long hostId, long templateId) {
super();
this.hostId = hostId;
this.templateId = templateId;
}
public VMTemplateHostVO(long hostId, long templateId, Date lastUpdated,
int downloadPercent, Status downloadState,
String localDownloadPath, String errorString, String jobId,
String installPath, String downloadUrl) {
super();
this.hostId = hostId;
this.templateId = templateId;
this.lastUpdated = lastUpdated;
this.downloadPercent = downloadPercent;
this.downloadState = downloadState;
this.localDownloadPath = localDownloadPath;
this.errorString = errorString;
this.jobId = jobId;
this.installPath = installPath;
this.setDownloadUrl(downloadUrl);
}
protected VMTemplateHostVO() {
}
this.setDownloadUrl(downloadUrl);
}
protected VMTemplateHostVO() {
}
@Override
public void setLocalDownloadPath(String localPath) {
this.localDownloadPath = localPath;
}
public void setLocalDownloadPath(String localPath) {
this.localDownloadPath = localPath;
}
@Override
public String getLocalDownloadPath() {
return localDownloadPath;
}
public String getLocalDownloadPath() {
return localDownloadPath;
}
@Override
public void setErrorString(String errorString) {
this.errorString = errorString;
}
public void setErrorString(String errorString) {
this.errorString = errorString;
}
@Override
public String getErrorString() {
return errorString;
}
public String getErrorString() {
return errorString;
}
@Override
public void setJobId(String jobId) {
this.jobId = jobId;
}
public void setJobId(String jobId) {
this.jobId = jobId;
}
@Override
public String getJobId() {
return jobId;
}
@Override
public boolean equals(Object obj) {
public String getJobId() {
return jobId;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof VMTemplateHostVO) {
VMTemplateHostVO other = (VMTemplateHostVO)obj;
return (this.templateId==other.getTemplateId() && this.hostId==other.getHostId());
}
return false;
}
@Override
public int hashCode() {
Long tid = new Long(templateId);
Long hid = new Long(hostId);
return tid.hashCode()+hid.hashCode();
}
public void setSize(long size) {
this.size = size;
}
public long getSize() {
return size;
}
VMTemplateHostVO other = (VMTemplateHostVO)obj;
return (this.templateId==other.getTemplateId() && this.hostId==other.getHostId());
}
return false;
}
@Override
public int hashCode() {
Long tid = new Long(templateId);
Long hid = new Long(hostId);
return tid.hashCode()+hid.hashCode();
}
public void setSize(long size) {
this.size = size;
}
public long getSize() {
return size;
}
public void setPhysicalSize(long physicalSize) {
@ -246,7 +246,7 @@ public class VMTemplateHostVO implements VMTemplateStorageResourceAssoc {
public void setDestroyed(boolean destroyed) {
this.destroyed = destroyed;
}
}
public boolean getDestroyed() {
return destroyed;
@ -277,5 +277,5 @@ public class VMTemplateHostVO implements VMTemplateStorageResourceAssoc {
public String toString() {
return new StringBuilder("TmplHost[").append(id).append("-").append(templateId).append("-").append(hostId).append(installPath).append("]").toString();
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
package com.cloud.storage;
import java.util.Date;
import javax.persistence.Column;
@ -26,209 +26,209 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.cloud.utils.db.GenericDaoBase;
/**
* Join table for storage pools and templates
* @author chiradeep
*
*/
@Entity
@Table(name="template_spool_ref")
public class VMTemplateStoragePoolVO implements VMTemplateStorageResourceAssoc{
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
long id;
@Column(name="pool_id")
private long poolId;
@Column(name="template_id") long templateId;
@Column(name=GenericDaoBase.CREATED_COLUMN) Date created = null;
@Column(name="last_updated")
@Temporal(value=TemporalType.TIMESTAMP) Date lastUpdated = null;
@Column (name="download_pct") int downloadPercent;
@Column (name="download_state")
@Enumerated(EnumType.STRING) Status downloadState;
@Column (name="local_path") String localDownloadPath;
@Column (name="error_str") String errorString;
@Column (name="job_id") String jobId;
@Column (name="install_path") String installPath;
@Column (name="template_size") long templateSize;
@Column (name="marked_for_gc") boolean markedForGC;
/**
* Join table for storage pools and templates
* @author chiradeep
*
*/
@Entity
@Table(name="template_spool_ref")
public class VMTemplateStoragePoolVO implements VMTemplateStorageResourceAssoc{
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
long id;
@Column(name="pool_id")
private long poolId;
@Column(name="template_id") long templateId;
@Column(name=GenericDaoBase.CREATED_COLUMN) Date created = null;
@Column(name="last_updated")
@Temporal(value=TemporalType.TIMESTAMP) Date lastUpdated = null;
@Column (name="download_pct") int downloadPercent;
@Column (name="download_state")
@Enumerated(EnumType.STRING) Status downloadState;
@Column (name="local_path") String localDownloadPath;
@Column (name="error_str") String errorString;
@Column (name="job_id") String jobId;
@Column (name="install_path") String installPath;
@Column (name="template_size") long templateSize;
@Column (name="marked_for_gc") boolean markedForGC;
@Override
public String getInstallPath() {
return installPath;
}
public String getInstallPath() {
return installPath;
}
@Override
public long getTemplateSize() {
return templateSize;
}
public long getPoolId() {
return poolId;
}
public void setpoolId(long poolId) {
this.poolId = poolId;
}
public long getTemplateSize() {
return templateSize;
}
public long getPoolId() {
return poolId;
}
public void setpoolId(long poolId) {
this.poolId = poolId;
}
@Override
public long getTemplateId() {
return templateId;
}
public long getTemplateId() {
return templateId;
}
@Override
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
@Override
public int getDownloadPercent() {
return downloadPercent;
}
public int getDownloadPercent() {
return downloadPercent;
}
@Override
public void setDownloadPercent(int downloadPercent) {
this.downloadPercent = downloadPercent;
}
public void setDownloadPercent(int downloadPercent) {
this.downloadPercent = downloadPercent;
}
@Override
public void setDownloadState(Status downloadState) {
this.downloadState = downloadState;
}
public void setDownloadState(Status downloadState) {
this.downloadState = downloadState;
}
@Override
public long getId() {
return id;
}
public long getId() {
return id;
}
@Override
public Date getCreated() {
return created;
}
public Date getCreated() {
return created;
}
@Override
public Date getLastUpdated() {
return lastUpdated;
}
public Date getLastUpdated() {
return lastUpdated;
}
@Override
public void setLastUpdated(Date date) {
lastUpdated = date;
}
public void setLastUpdated(Date date) {
lastUpdated = date;
}
@Override
public void setInstallPath(String installPath) {
this.installPath = installPath;
}
public void setInstallPath(String installPath) {
this.installPath = installPath;
}
@Override
public Status getDownloadState() {
return downloadState;
}
public VMTemplateStoragePoolVO(long poolId, long templateId) {
super();
this.poolId = poolId;
this.templateId = templateId;
this.downloadState = Status.NOT_DOWNLOADED;
this.markedForGC = false;
}
public VMTemplateStoragePoolVO(long poolId, long templateId, Date lastUpdated,
int downloadPercent, Status downloadState,
String localDownloadPath, String errorString, String jobId,
String installPath, long templateSize) {
super();
this.poolId = poolId;
this.templateId = templateId;
this.lastUpdated = lastUpdated;
this.downloadPercent = downloadPercent;
this.downloadState = downloadState;
this.localDownloadPath = localDownloadPath;
this.errorString = errorString;
this.jobId = jobId;
this.installPath = installPath;
this.templateSize = templateSize;
}
protected VMTemplateStoragePoolVO() {
}
public Status getDownloadState() {
return downloadState;
}
public VMTemplateStoragePoolVO(long poolId, long templateId) {
super();
this.poolId = poolId;
this.templateId = templateId;
this.downloadState = Status.NOT_DOWNLOADED;
this.markedForGC = false;
}
public VMTemplateStoragePoolVO(long poolId, long templateId, Date lastUpdated,
int downloadPercent, Status downloadState,
String localDownloadPath, String errorString, String jobId,
String installPath, long templateSize) {
super();
this.poolId = poolId;
this.templateId = templateId;
this.lastUpdated = lastUpdated;
this.downloadPercent = downloadPercent;
this.downloadState = downloadState;
this.localDownloadPath = localDownloadPath;
this.errorString = errorString;
this.jobId = jobId;
this.installPath = installPath;
this.templateSize = templateSize;
}
protected VMTemplateStoragePoolVO() {
}
@Override
public void setLocalDownloadPath(String localPath) {
this.localDownloadPath = localPath;
}
public void setLocalDownloadPath(String localPath) {
this.localDownloadPath = localPath;
}
@Override
public String getLocalDownloadPath() {
return localDownloadPath;
}
public String getLocalDownloadPath() {
return localDownloadPath;
}
@Override
public void setErrorString(String errorString) {
this.errorString = errorString;
}
public void setErrorString(String errorString) {
this.errorString = errorString;
}
@Override
public String getErrorString() {
return errorString;
}
public String getErrorString() {
return errorString;
}
@Override
public void setJobId(String jobId) {
this.jobId = jobId;
}
public void setJobId(String jobId) {
this.jobId = jobId;
}
@Override
public String getJobId() {
return jobId;
}
public void setTemplateSize(long templateSize) {
this.templateSize = templateSize;
}
public boolean getMarkedForGC() {
return markedForGC;
}
public void setMarkedForGC(boolean markedForGC) {
this.markedForGC = markedForGC;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof VMTemplateStoragePoolVO) {
VMTemplateStoragePoolVO other = (VMTemplateStoragePoolVO)obj;
return (this.templateId==other.getTemplateId() && this.poolId==other.getPoolId());
}
return false;
}
@Override
public int hashCode() {
Long tid = new Long(templateId);
Long hid = new Long(poolId);
return tid.hashCode()+hid.hashCode();
}
public String getJobId() {
return jobId;
}
public void setTemplateSize(long templateSize) {
this.templateSize = templateSize;
}
public boolean getMarkedForGC() {
return markedForGC;
}
public void setMarkedForGC(boolean markedForGC) {
this.markedForGC = markedForGC;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof VMTemplateStoragePoolVO) {
VMTemplateStoragePoolVO other = (VMTemplateStoragePoolVO)obj;
return (this.templateId==other.getTemplateId() && this.poolId==other.getPoolId());
}
return false;
}
@Override
public int hashCode() {
Long tid = new Long(templateId);
Long hid = new Long(poolId);
return tid.hashCode()+hid.hashCode();
}
@Override
public String toString() {
return new StringBuilder("TmplPool[").append(id).append("-").append(templateId).append("-").append("poolId").append("-").append(installPath).append("]").toString();
}
}
}
}

View File

@ -99,4 +99,4 @@ public class VMTemplateSwiftVO {
return new StringBuilder("TmplSwift[").append(id).append("-").append(templateId).append("-").append(swiftId).append("]").toString();
}
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage;
package com.cloud.storage;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
@ -33,66 +33,66 @@ import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.Storage.TemplateType;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="vm_template")
public class VMTemplateVO implements VirtualMachineTemplate, Identity {
@Id
@TableGenerator(name="vm_template_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_template_seq", allocationSize=1)
@Column(name="id", nullable = false)
private long id;
@Column(name="format")
private Storage.ImageFormat format;
@Column(name="unique_name")
private String uniqueName;
@Column(name="name")
private String name = null;
@Column(name="public")
@Entity
@Table(name="vm_template")
public class VMTemplateVO implements VirtualMachineTemplate, Identity {
@Id
@TableGenerator(name="vm_template_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_template_seq", allocationSize=1)
@Column(name="id", nullable = false)
private long id;
@Column(name="format")
private Storage.ImageFormat format;
@Column(name="unique_name")
private String uniqueName;
@Column(name="name")
private String name = null;
@Column(name="public")
private boolean publicTemplate = true;
@Column(name="featured")
private boolean featured;
@Column(name="type")
private Storage.TemplateType templateType;
@Column(name="url")
private String url = null;
@Column(name="hvm")
private boolean requiresHvm;
@Column(name="bits")
private int bits;
@Temporal(value=TemporalType.TIMESTAMP)
@Column(name=GenericDao.CREATED_COLUMN)
private Date created = null;
private boolean featured;
@Column(name="type")
private Storage.TemplateType templateType;
@Column(name="url")
private String url = null;
@Column(name="hvm")
private boolean requiresHvm;
@Column(name="bits")
private int bits;
@Temporal(value=TemporalType.TIMESTAMP)
@Column(name=GenericDao.CREATED_COLUMN)
private Date created = null;
@Column(name=GenericDao.REMOVED)
@Temporal(TemporalType.TIMESTAMP)
private Date removed;
@Column(name="account_id")
private long accountId;
@Column(name="checksum")
private String checksum;
@Column(name="display_text", length=4096)
private String displayText;
@Column(name="enable_password")
private boolean enablePassword;
@Column(name="guest_os_id")
private long guestOSId;
@Column(name="bootable")
@Temporal(TemporalType.TIMESTAMP)
private Date removed;
@Column(name="account_id")
private long accountId;
@Column(name="checksum")
private String checksum;
@Column(name="display_text", length=4096)
private String displayText;
@Column(name="enable_password")
private boolean enablePassword;
@Column(name="guest_os_id")
private long guestOSId;
@Column(name="bootable")
private boolean bootable = true;
@Column(name="prepopulate")
@ -104,10 +104,10 @@ public class VMTemplateVO implements VirtualMachineTemplate, Identity {
@Column(name="hypervisor_type")
@Enumerated(value=EnumType.STRING)
private HypervisorType hypervisorType;
@Column(name="extractable")
private boolean extractable = true;
@Column(name="source_template_id")
private Long sourceTemplateId;
@ -127,23 +127,23 @@ public class VMTemplateVO implements VirtualMachineTemplate, Identity {
Map details;
@Override
public String getUniqueName() {
return uniqueName;
}
public void setUniqueName(String uniqueName) {
this.uniqueName = uniqueName;
}
public String getUniqueName() {
return uniqueName;
}
public void setUniqueName(String uniqueName) {
this.uniqueName = uniqueName;
}
protected VMTemplateVO() {
this.uuid = UUID.randomUUID().toString();
}
/**
* Proper constructor for a new vm template.
*/
public VMTemplateVO(long id, String name, ImageFormat format, boolean isPublic, boolean featured, boolean isExtractable, TemplateType type, String url, boolean requiresHvm, int bits, long accountId, String cksum, String displayText, boolean enablePassword, long guestOSId, boolean bootable, HypervisorType hyperType, Map details) {
this(id, generateUniqueName(id, accountId, name), name, format, isPublic, featured, isExtractable, type, url, null, requiresHvm, bits, accountId, cksum, displayText, enablePassword, guestOSId, bootable, hyperType, details);
this.uuid = UUID.randomUUID().toString();
}
/**
* Proper constructor for a new vm template.
*/
public VMTemplateVO(long id, String name, ImageFormat format, boolean isPublic, boolean featured, boolean isExtractable, TemplateType type, String url, boolean requiresHvm, int bits, long accountId, String cksum, String displayText, boolean enablePassword, long guestOSId, boolean bootable, HypervisorType hyperType, Map details) {
this(id, generateUniqueName(id, accountId, name), name, format, isPublic, featured, isExtractable, type, url, null, requiresHvm, bits, accountId, cksum, displayText, enablePassword, guestOSId, bootable, hyperType, details);
this.uuid = UUID.randomUUID().toString();
}
@ -152,27 +152,27 @@ public class VMTemplateVO implements VirtualMachineTemplate, Identity {
this.templateTag = templateTag;
this.uuid = UUID.randomUUID().toString();
this.enableSshKey = sshKeyEnabled;
}
public VMTemplateVO(Long id, String uniqueName, String name, ImageFormat format, boolean isPublic, boolean featured, TemplateType type, String url, Date created, boolean requiresHvm, int bits, long accountId, String cksum, String displayText, boolean enablePassword, long guestOSId, boolean bootable, HypervisorType hyperType) {
this.id = id;
this.name = name;
}
public VMTemplateVO(Long id, String uniqueName, String name, ImageFormat format, boolean isPublic, boolean featured, TemplateType type, String url, Date created, boolean requiresHvm, int bits, long accountId, String cksum, String displayText, boolean enablePassword, long guestOSId, boolean bootable, HypervisorType hyperType) {
this.id = id;
this.name = name;
this.publicTemplate = isPublic;
this.featured = featured;
this.templateType = type;
this.url = url;
this.requiresHvm = requiresHvm;
this.bits = bits;
this.accountId = accountId;
this.checksum = cksum;
this.uniqueName = uniqueName;
this.displayText = displayText;
this.enablePassword = enablePassword;
this.format = format;
this.created = created;
this.guestOSId = guestOSId;
this.featured = featured;
this.templateType = type;
this.url = url;
this.requiresHvm = requiresHvm;
this.bits = bits;
this.accountId = accountId;
this.checksum = cksum;
this.uniqueName = uniqueName;
this.displayText = displayText;
this.enablePassword = enablePassword;
this.format = format;
this.created = created;
this.guestOSId = guestOSId;
this.bootable = bootable;
this.hypervisorType = hyperType;
this.hypervisorType = hyperType;
this.uuid = UUID.randomUUID().toString();
}
@ -190,81 +190,81 @@ public class VMTemplateVO implements VirtualMachineTemplate, Identity {
this.uuid = UUID.randomUUID().toString();
}
@Override
@Override
public boolean getEnablePassword() {
return enablePassword;
}
return enablePassword;
}
@Override
public Storage.ImageFormat getFormat() {
return format;
}
public void setEnablePassword(boolean enablePassword) {
this.enablePassword = enablePassword;
}
public void setFormat(ImageFormat format) {
this.format = format;
}
private static String generateUniqueName(long id, long userId, String displayName) {
StringBuilder name = new StringBuilder();
name.append(id);
name.append("-");
name.append(userId);
name.append("-");
name.append(UUID.nameUUIDFromBytes((displayName + System.currentTimeMillis()).getBytes()).toString());
return name.toString();
}
@Override
public long getId() {
return id;
}
public Storage.ImageFormat getFormat() {
return format;
}
public void setEnablePassword(boolean enablePassword) {
this.enablePassword = enablePassword;
}
public void setFormat(ImageFormat format) {
this.format = format;
}
private static String generateUniqueName(long id, long userId, String displayName) {
StringBuilder name = new StringBuilder();
name.append(id);
name.append("-");
name.append(userId);
name.append("-");
name.append(UUID.nameUUIDFromBytes((displayName + System.currentTimeMillis()).getBytes()).toString());
return name.toString();
}
@Override
public TemplateType getTemplateType() {
return templateType;
}
public void setTemplateType(TemplateType type) {
this.templateType = type;
}
public boolean requiresHvm() {
return requiresHvm;
}
public long getId() {
return id;
}
@Override
public int getBits() {
return bits;
}
public void setBits(int bits) {
this.bits = bits;
}
@Override
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getRemoved() {
return removed;
}
@Override
public boolean isPublicTemplate() {
return publicTemplate;
}
public void setPublicTemplate(boolean publicTemplate) {
this.publicTemplate = publicTemplate;
public TemplateType getTemplateType() {
return templateType;
}
public void setTemplateType(TemplateType type) {
this.templateType = type;
}
public boolean requiresHvm() {
return requiresHvm;
}
@Override
public int getBits() {
return bits;
}
public void setBits(int bits) {
this.bits = bits;
}
@Override
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getRemoved() {
return removed;
}
@Override
public boolean isPublicTemplate() {
return publicTemplate;
}
public void setPublicTemplate(boolean publicTemplate) {
this.publicTemplate = publicTemplate;
}
@Override
@ -274,70 +274,70 @@ public class VMTemplateVO implements VirtualMachineTemplate, Identity {
public void setFeatured(boolean featured) {
this.featured = featured;
}
}
@Override
public Date getCreated() {
return created;
}
public Date getCreated() {
return created;
}
@Override
public String getUrl() {
return url;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
@Override
public boolean isRequiresHvm() {
return requiresHvm;
}
public void setRequiresHvm(boolean value) {
requiresHvm = value;
}
public boolean isRequiresHvm() {
return requiresHvm;
}
public void setRequiresHvm(boolean value) {
requiresHvm = value;
}
@Override
public long getAccountId() {
return accountId;
}
public long getAccountId() {
return accountId;
}
@Override
public String getChecksum() {
return checksum;
}
public String getChecksum() {
return checksum;
}
public void setChecksum(String checksum) {
this.checksum = checksum;
}
@Override
public String getDisplayText() {
return displayText;
}
public void setDisplayText(String displayText) {
this.displayText = displayText;
}
public String getDisplayText() {
return displayText;
}
public void setDisplayText(String displayText) {
this.displayText = displayText;
}
@Override
public long getGuestOSId() {
return guestOSId;
}
public void setGuestOSId(long guestOSId) {
this.guestOSId = guestOSId;
}
public long getGuestOSId() {
return guestOSId;
}
public void setGuestOSId(long guestOSId) {
this.guestOSId = guestOSId;
}
@Override
public boolean isBootable() {
return bootable;
}
public void setBootable(boolean bootable) {
this.bootable = bootable;
public boolean isBootable() {
return bootable;
}
public void setBootable(boolean bootable) {
this.bootable = bootable;
}
public void setPrepopulate(boolean prepopulate) {
@ -463,5 +463,5 @@ public class VMTemplateVO implements VirtualMachineTemplate, Identity {
public void setEnableSshKey(boolean enable) {
enableSshKey = enable;
}
}
}

View File

@ -10,73 +10,73 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.storage.template;
import java.io.File;
import java.util.Map;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
package com.cloud.storage.template;
import java.io.File;
import java.util.Map;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.apache.log4j.Logger;
import com.cloud.exception.InternalErrorException;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.StorageLayer;
import com.cloud.utils.script.Script;
@Local(value=Processor.class)
public class VmdkProcessor implements Processor {
private static final Logger s_logger = Logger.getLogger(VmdkProcessor.class);
String _name;
StorageLayer _storage;
@Override
public FormatInfo process(String templatePath, ImageFormat format, String templateName) throws InternalErrorException {
if (format != null) {
if(s_logger.isInfoEnabled())
s_logger.info("We currently don't handle conversion from " + format + " to VMDK.");
return null;
}
s_logger.info("Template processing. templatePath: " + templatePath + ", templateName: " + templateName);
String templateFilePath = templatePath + File.separator + templateName + "." + ImageFormat.OVA.getFileExtension();
if (!_storage.exists(templateFilePath)) {
if(s_logger.isInfoEnabled())
s_logger.info("Unable to find the vmware template file: " + templateFilePath);
return null;
}
s_logger.info("Template processing - untar OVA package. templatePath: " + templatePath + ", templateName: " + templateName);
String templateFileFullPath = templatePath + templateName + "." + ImageFormat.OVA.getFileExtension();
File templateFile = new File(templateFileFullPath);
import org.apache.log4j.Logger;
import com.cloud.exception.InternalErrorException;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.StorageLayer;
import com.cloud.utils.script.Script;
@Local(value=Processor.class)
public class VmdkProcessor implements Processor {
private static final Logger s_logger = Logger.getLogger(VmdkProcessor.class);
String _name;
StorageLayer _storage;
@Override
public FormatInfo process(String templatePath, ImageFormat format, String templateName) throws InternalErrorException {
if (format != null) {
if(s_logger.isInfoEnabled())
s_logger.info("We currently don't handle conversion from " + format + " to VMDK.");
return null;
}
s_logger.info("Template processing. templatePath: " + templatePath + ", templateName: " + templateName);
String templateFilePath = templatePath + File.separator + templateName + "." + ImageFormat.OVA.getFileExtension();
if (!_storage.exists(templateFilePath)) {
if(s_logger.isInfoEnabled())
s_logger.info("Unable to find the vmware template file: " + templateFilePath);
return null;
}
s_logger.info("Template processing - untar OVA package. templatePath: " + templatePath + ", templateName: " + templateName);
String templateFileFullPath = templatePath + templateName + "." + ImageFormat.OVA.getFileExtension();
File templateFile = new File(templateFileFullPath);
Script command = new Script("tar", 0, s_logger);
command.add("--no-same-owner");
command.add("-xf", templateFileFullPath);
command.setWorkDir(templateFile.getParent());
String result = command.execute();
if (result != null) {
s_logger.info("failed to untar OVA package due to " + result + ". templatePath: " + templatePath + ", templateName: " + templateName);
return null;
}
FormatInfo info = new FormatInfo();
info.format = ImageFormat.OVA;
info.filename = templateName + "." + ImageFormat.OVA.getFileExtension();
command.add("-xf", templateFileFullPath);
command.setWorkDir(templateFile.getParent());
String result = command.execute();
if (result != null) {
s_logger.info("failed to untar OVA package due to " + result + ". templatePath: " + templatePath + ", templateName: " + templateName);
return null;
}
FormatInfo info = new FormatInfo();
info.format = ImageFormat.OVA;
info.filename = templateName + "." + ImageFormat.OVA.getFileExtension();
info.size = _storage.getSize(templateFilePath);
info.virtualSize = getTemplateVirtualSize(templatePath, info.filename);
// delete original OVA file
// templateFile.delete();
return info;
}
// delete original OVA file
// templateFile.delete();
return info;
}
public long getTemplateVirtualSize(String templatePath, String templateName) throws InternalErrorException {
// get the virtual size from the OVF file meta data
@ -130,30 +130,30 @@ public class VmdkProcessor implements Processor {
}
return null;
}
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
_storage = (StorageLayer)params.get(StorageLayer.InstanceConfigKey);
if (_storage == null) {
throw new ConfigurationException("Unable to get storage implementation");
}
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;
}
@Override
public boolean stop() {
return true;
}
}
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
_storage = (StorageLayer)params.get(StorageLayer.InstanceConfigKey);
if (_storage == null) {
throw new ConfigurationException("Unable to get storage implementation");
}
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;
}
@Override
public boolean stop() {
return true;
}
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.user;
package com.cloud.user;
import java.util.Date;
import java.util.UUID;
@ -26,32 +26,32 @@ import javax.persistence.Table;
import com.cloud.api.Identity;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="account")
public class AccountVO implements Account, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="account_name")
private String accountName = null;
@Column(name="type")
private short type = ACCOUNT_TYPE_NORMAL;
@Column(name="domain_id")
private long domainId;
@Entity
@Table(name="account")
public class AccountVO implements Account, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private long id;
@Column(name="account_name")
private String accountName = null;
@Column(name="type")
private short type = ACCOUNT_TYPE_NORMAL;
@Column(name="domain_id")
private long domainId;
@Column(name="state")
@Enumerated(value=EnumType.STRING)
private State state;
@Column(name=GenericDao.REMOVED_COLUMN)
private Date removed;
@Column(name="cleanup_needed")
@Enumerated(value=EnumType.STRING)
private State state;
@Column(name=GenericDao.REMOVED_COLUMN)
private Date removed;
@Column(name="cleanup_needed")
private boolean needsCleanup = false;
@Column(name="network_domain")
@ -59,13 +59,13 @@ public class AccountVO implements Account, Identity {
@Column(name="uuid")
private String uuid;
public AccountVO() {
this.uuid = UUID.randomUUID().toString();
}
public AccountVO(long id) {
this.id = id;
public AccountVO(long id) {
this.id = id;
this.uuid = UUID.randomUUID().toString();
}
@ -76,60 +76,60 @@ public class AccountVO implements Account, Identity {
this.type = type;
this.state = State.enabled;
this.uuid = UUID.randomUUID().toString();
}
public void setNeedsCleanup(boolean value) {
needsCleanup = value;
}
public boolean getNeedsCleanup() {
return needsCleanup;
}
@Override
public long getId() {
return id;
}
@Override
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
public void setNeedsCleanup(boolean value) {
needsCleanup = value;
}
@Override
public short getType() {
return type;
public boolean getNeedsCleanup() {
return needsCleanup;
}
public void setType(short type) {
this.type = type;
}
@Override
public long getDomainId() {
return domainId;
}
public void setDomainId(long domainId) {
this.domainId = domainId;
}
@Override
public State getState() {
return state;
}
public void setState(State state) {
this.state = state;
}
@Override
public Date getRemoved() {
return removed;
public long getId() {
return id;
}
@Override
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
@Override
public short getType() {
return type;
}
public void setType(short type) {
this.type = type;
}
@Override
public long getDomainId() {
return domainId;
}
public void setDomainId(long domainId) {
this.domainId = domainId;
}
@Override
public State getState() {
return state;
}
public void setState(State state) {
this.state = state;
}
@Override
public Date getRemoved() {
return removed;
}
@Override
@ -158,5 +158,5 @@ public class AccountVO implements Account, Identity {
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
}
}

View File

@ -10,64 +10,64 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.user;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SecondaryTable;
import javax.persistence.Table;
package com.cloud.user;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SecondaryTable;
import javax.persistence.Table;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name="user")
@SecondaryTable(name="account",
pkJoinColumns={@PrimaryKeyJoinColumn(name="account_id", referencedColumnName="id")})
public class UserAccountVO implements UserAccount {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id = null;
@Column(name="username")
private String username = null;
@Column(name="password")
private String password = null;
@Column(name="firstname")
private String firstname = null;
@Column(name="lastname")
private String lastname = null;
@Column(name="account_id")
private long accountId;
@Column(name="email")
private String email = null;
@Column(name="state")
private String state;
@Column(name="api_key")
private String apiKey = null;
@Column(name="secret_key", encryptable=true)
private String secretKey = null;
@Column(name=GenericDao.CREATED_COLUMN)
private Date created;
@Column(name=GenericDao.REMOVED_COLUMN)
@Entity
@Table(name="user")
@SecondaryTable(name="account",
pkJoinColumns={@PrimaryKeyJoinColumn(name="account_id", referencedColumnName="id")})
public class UserAccountVO implements UserAccount {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id = null;
@Column(name="username")
private String username = null;
@Column(name="password")
private String password = null;
@Column(name="firstname")
private String firstname = null;
@Column(name="lastname")
private String lastname = null;
@Column(name="account_id")
private long accountId;
@Column(name="email")
private String email = null;
@Column(name="state")
private String state;
@Column(name="api_key")
private String apiKey = null;
@Column(name="secret_key", encryptable=true)
private String secretKey = null;
@Column(name=GenericDao.CREATED_COLUMN)
private Date created;
@Column(name=GenericDao.REMOVED_COLUMN)
private Date removed;
@Column(name="timezone")
private String timezone;
@ -76,166 +76,166 @@ public class UserAccountVO implements UserAccount {
@Column(name="is_registered")
boolean registered;
@Column(name="account_name", table="account", insertable=false, updatable=false)
private String accountName = null;
@Column(name="type", table="account", insertable=false, updatable=false)
private short type;
@Column(name="domain_id", table="account", insertable=false, updatable=false)
private Long domainId = null;
@Column(name="state", table="account", insertable=false, updatable=false)
private String accountState;
public UserAccountVO() {}
@Override
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Override
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
@Override
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
@Override
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
@Override
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
@Override
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@Override
public String getSecretKey() {
return secretKey;
}
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
@Override
public Date getCreated() {
return created;
}
// public void setCreated(Date created) {
// this.created = created;
// }
@Override
public Date getRemoved() {
return removed;
}
public void setRemoved(Date removed) {
this.removed = removed;
}
@Override
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
@Override
public short getType() {
return type;
}
public void setType(short type) {
this.type = type;
}
@Override
public Long getDomainId() {
return domainId;
}
public void setDomainId(Long domainId) {
this.domainId = domainId;
}
@Override
public String getAccountState() {
return accountState;
}
public void setAccountDisabled(String accountState) {
this.accountState = accountState;
}
@Column(name="account_name", table="account", insertable=false, updatable=false)
private String accountName = null;
@Column(name="type", table="account", insertable=false, updatable=false)
private short type;
@Column(name="domain_id", table="account", insertable=false, updatable=false)
private Long domainId = null;
@Column(name="state", table="account", insertable=false, updatable=false)
private String accountState;
public UserAccountVO() {}
@Override
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Override
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
@Override
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
@Override
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
@Override
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
@Override
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@Override
public String getSecretKey() {
return secretKey;
}
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
@Override
public Date getCreated() {
return created;
}
// public void setCreated(Date created) {
// this.created = created;
// }
@Override
public Date getRemoved() {
return removed;
}
public void setRemoved(Date removed) {
this.removed = removed;
}
@Override
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
@Override
public short getType() {
return type;
}
public void setType(short type) {
this.type = type;
}
@Override
public Long getDomainId() {
return domainId;
}
public void setDomainId(Long domainId) {
this.domainId = domainId;
}
@Override
public String getAccountState() {
return accountState;
}
public void setAccountDisabled(String accountState) {
this.accountState = accountState;
}
@Override
@Override
public String getTimezone(){
return timezone;
}
@ -262,5 +262,5 @@ public class UserAccountVO implements UserAccount {
public void setRegistered(boolean registered) {
this.registered = registered;
}
}
}

View File

@ -10,27 +10,27 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.user;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="user_statistics")
public class UserStatisticsVO {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id;
@Column(name="data_center_id", updatable=false)
private long dataCenterId;
@Column(name="account_id", updatable=false)
package com.cloud.user;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="user_statistics")
public class UserStatisticsVO {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long id;
@Column(name="data_center_id", updatable=false)
private long dataCenterId;
@Column(name="account_id", updatable=false)
private long accountId;
@Column(name="public_ip_address")
@ -44,52 +44,52 @@ public class UserStatisticsVO {
@Column(name="network_id")
private Long networkId;
@Column(name="net_bytes_received")
private long netBytesReceived;
@Column(name="net_bytes_sent")
private long netBytesSent;
@Column(name="current_bytes_received")
private long currentBytesReceived;
@Column(name="current_bytes_sent")
@Column(name="net_bytes_received")
private long netBytesReceived;
@Column(name="net_bytes_sent")
private long netBytesSent;
@Column(name="current_bytes_received")
private long currentBytesReceived;
@Column(name="current_bytes_sent")
private long currentBytesSent;
@Column(name="agg_bytes_received")
private long aggBytesReceived;
@Column(name="agg_bytes_sent")
private long aggBytesSent;
protected UserStatisticsVO() {
}
public UserStatisticsVO(long accountId, long dcId, String publicIpAddress, Long deviceId, String deviceType, Long networkId) {
private long aggBytesSent;
protected UserStatisticsVO() {
}
public UserStatisticsVO(long accountId, long dcId, String publicIpAddress, Long deviceId, String deviceType, Long networkId) {
this.accountId = accountId;
this.dataCenterId = dcId;
this.publicIpAddress = publicIpAddress;
this.deviceId = deviceId;
this.deviceType = deviceType;
this.networkId = networkId;
this.netBytesReceived = 0;
this.netBytesSent = 0;
this.currentBytesReceived = 0;
this.networkId = networkId;
this.netBytesReceived = 0;
this.netBytesSent = 0;
this.currentBytesReceived = 0;
this.currentBytesSent = 0;
}
public long getAccountId() {
return accountId;
}
public Long getId() {
return id;
}
public long getDataCenterId() {
return dataCenterId;
}
public long getAccountId() {
return accountId;
}
public Long getId() {
return id;
}
public long getDataCenterId() {
return dataCenterId;
}
public String getPublicIpAddress() {
@ -98,7 +98,7 @@ public class UserStatisticsVO {
public Long getDeviceId() {
return deviceId;
}
}
public String getDeviceType() {
return deviceType;
@ -107,37 +107,37 @@ public class UserStatisticsVO {
public Long getNetworkId() {
return networkId;
}
public long getCurrentBytesReceived() {
return currentBytesReceived;
}
public void setCurrentBytesReceived(long currentBytesReceived) {
this.currentBytesReceived = currentBytesReceived;
}
public long getCurrentBytesSent() {
return currentBytesSent;
}
public void setCurrentBytesSent(long currentBytesSent) {
this.currentBytesSent = currentBytesSent;
}
public long getNetBytesReceived() {
return netBytesReceived;
}
public long getNetBytesSent() {
return netBytesSent;
}
public void setNetBytesReceived(long netBytesReceived) {
this.netBytesReceived = netBytesReceived;
}
public void setNetBytesSent(long netBytesSent) {
this.netBytesSent = netBytesSent;
public long getCurrentBytesReceived() {
return currentBytesReceived;
}
public void setCurrentBytesReceived(long currentBytesReceived) {
this.currentBytesReceived = currentBytesReceived;
}
public long getCurrentBytesSent() {
return currentBytesSent;
}
public void setCurrentBytesSent(long currentBytesSent) {
this.currentBytesSent = currentBytesSent;
}
public long getNetBytesReceived() {
return netBytesReceived;
}
public long getNetBytesSent() {
return netBytesSent;
}
public void setNetBytesReceived(long netBytesReceived) {
this.netBytesReceived = netBytesReceived;
}
public void setNetBytesSent(long netBytesSent) {
this.netBytesSent = netBytesSent;
}
public long getAggBytesReceived() {
@ -155,5 +155,5 @@ public class UserStatisticsVO {
public void setAggBytesSent(long aggBytesSent) {
this.aggBytesSent = aggBytesSent;
}
}
}

View File

@ -10,41 +10,41 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.user;
package com.cloud.user;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
@Table(name="op_user_stats_log")
public class UserStatsLogVO {
@Id
@Column(name="user_stats_id")
private long userStatsId;
@Column(name="net_bytes_received")
private long netBytesReceived;
@Column(name="net_bytes_sent")
private long netBytesSent;
@Column(name="current_bytes_received")
private long currentBytesReceived;
@Column(name="current_bytes_sent")
@Entity
@Table(name="op_user_stats_log")
public class UserStatsLogVO {
@Id
@Column(name="user_stats_id")
private long userStatsId;
@Column(name="net_bytes_received")
private long netBytesReceived;
@Column(name="net_bytes_sent")
private long netBytesSent;
@Column(name="current_bytes_received")
private long currentBytesReceived;
@Column(name="current_bytes_sent")
private long currentBytesSent;
@Column(name="agg_bytes_received")
private long aggBytesReceived;
@Column(name="agg_bytes_sent")
private long aggBytesSent;
private long aggBytesSent;
@Column(name="updated")
@Temporal(value=TemporalType.TIMESTAMP)
@ -52,7 +52,7 @@ public class UserStatsLogVO {
public UserStatsLogVO(){
}
public UserStatsLogVO(long userStatsId, long netBytesReceived, long netBytesSent, long currentBytesReceived, long currentBytesSent,
long aggBytesReceived, long aggBytesSent, Date updatedTime) {
this.userStatsId = userStatsId;
@ -62,43 +62,43 @@ public class UserStatsLogVO {
this.currentBytesSent = currentBytesSent;
this.aggBytesReceived = aggBytesReceived;
this.aggBytesSent = aggBytesSent;
this.updatedTime = updatedTime;
}
public Long getUserStatsId() {
return userStatsId;
}
this.updatedTime = updatedTime;
}
public Long getUserStatsId() {
return userStatsId;
}
public long getCurrentBytesReceived() {
return currentBytesReceived;
}
public void setCurrentBytesReceived(long currentBytesReceived) {
this.currentBytesReceived = currentBytesReceived;
}
public long getCurrentBytesSent() {
return currentBytesSent;
}
public void setCurrentBytesSent(long currentBytesSent) {
this.currentBytesSent = currentBytesSent;
}
public long getNetBytesReceived() {
return netBytesReceived;
}
public long getNetBytesSent() {
return netBytesSent;
}
public void setNetBytesReceived(long netBytesReceived) {
this.netBytesReceived = netBytesReceived;
}
public void setNetBytesSent(long netBytesSent) {
this.netBytesSent = netBytesSent;
public long getCurrentBytesReceived() {
return currentBytesReceived;
}
public void setCurrentBytesReceived(long currentBytesReceived) {
this.currentBytesReceived = currentBytesReceived;
}
public long getCurrentBytesSent() {
return currentBytesSent;
}
public void setCurrentBytesSent(long currentBytesSent) {
this.currentBytesSent = currentBytesSent;
}
public long getNetBytesReceived() {
return netBytesReceived;
}
public long getNetBytesSent() {
return netBytesSent;
}
public void setNetBytesReceived(long netBytesReceived) {
this.netBytesReceived = netBytesReceived;
}
public void setNetBytesSent(long netBytesSent) {
this.netBytesSent = netBytesSent;
}
public long getAggBytesReceived() {
@ -124,5 +124,5 @@ public class UserStatsLogVO {
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
}
}

View File

@ -10,14 +10,14 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.vm;
/**
* ConsoleProxy is a system VM instance that is used
* to proxy VNC traffic
*/
package com.cloud.vm;
/**
* ConsoleProxy is a system VM instance that is used
* to proxy VNC traffic
*/
public interface ConsoleProxy extends SystemVm {
public int getActiveSession();
public byte[] getSessionDetails();
}
public byte[] getSessionDetails();
}

View File

@ -10,13 +10,13 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.vm;
/**
* Secondary Storage VM is a system VM instance that is used
* to interface the management server to secondary storage
*/
package com.cloud.vm;
/**
* Secondary Storage VM is a system VM instance that is used
* to interface the management server to secondary storage
*/
public interface SecondaryStorageVm extends SystemVm {
enum Role { templateProcessor, commandExecutor }
}
enum Role { templateProcessor, commandExecutor }
}

View File

@ -10,8 +10,8 @@
// limitations under the License.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.vm;
package com.cloud.vm;
import java.util.Date;
import java.util.Map;
import java.util.Random;
@ -37,20 +37,20 @@ import com.cloud.utils.db.GenericDao;
import com.cloud.utils.db.StateMachine;
import com.cloud.utils.fsm.FiniteStateObject;
import com.cloud.vm.VirtualMachine.State;
@Entity
@Table(name="vm_instance")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32)
@Entity
@Table(name="vm_instance")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32)
public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, VirtualMachine.Event> {
@Id
@TableGenerator(name="vm_instance_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_instance_seq", allocationSize=1)
@Column(name="id", updatable=false, nullable = false)
protected long id;
@Column(name="name", updatable=false, nullable=false, length=255)
protected String hostName = null;
@Id
@TableGenerator(name="vm_instance_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_instance_seq", allocationSize=1)
@Column(name="id", updatable=false, nullable = false)
protected long id;
@Column(name="name", updatable=false, nullable=false, length=255)
protected String hostName = null;
@Column(name="vnc_password", updatable=true, nullable=false, length=255, encryptable=true)
protected String vncPassword;
@ -60,65 +60,65 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
@Temporal(TemporalType.TIMESTAMP)
@Column(name="proxy_assign_time", updatable=true, nullable=true)
protected Date proxyAssignTime;
/**
* Note that state is intentionally missing the setter. Any updates to
* the state machine needs to go through the DAO object because someone
* else could be updating it as well.
*/
/**
* Note that state is intentionally missing the setter. Any updates to
* the state machine needs to go through the DAO object because someone
* else could be updating it as well.
*/
@Enumerated(value=EnumType.STRING)
@StateMachine(state=State.class, event=Event.class)
@Column(name="state", updatable=true, nullable=false, length=32)
protected State state = null;
@Column(name="private_ip_address", updatable=true)
protected String privateIpAddress;
@Column(name="instance_name", updatable=true, nullable=false)
protected String instanceName;
@Column(name="vm_template_id", updatable=true, nullable=true, length=17)
protected Long templateId = new Long(-1);
@Column(name="guest_os_id", nullable=false, length=17)
protected long guestOSId;
@Column(name="host_id", updatable=true, nullable=true)
@StateMachine(state=State.class, event=Event.class)
@Column(name="state", updatable=true, nullable=false, length=32)
protected State state = null;
@Column(name="private_ip_address", updatable=true)
protected String privateIpAddress;
@Column(name="instance_name", updatable=true, nullable=false)
protected String instanceName;
@Column(name="vm_template_id", updatable=true, nullable=true, length=17)
protected Long templateId = new Long(-1);
@Column(name="guest_os_id", nullable=false, length=17)
protected long guestOSId;
@Column(name="host_id", updatable=true, nullable=true)
protected Long hostId;
@Column(name="last_host_id", updatable=true, nullable=true)
protected Long lastHostId;
@Column(name="pod_id", updatable=true, nullable=false)
protected Long podIdToDeployIn;
@Column(name="private_mac_address", updatable=true, nullable=true)
protected String privateMacAddress;
@Column(name="data_center_id", updatable=true, nullable=false)
protected long dataCenterIdToDeployIn;
@Column(name="vm_type", updatable=false, nullable=false, length=32)
@Enumerated(value=EnumType.STRING)
protected Type type;
@Column(name="ha_enabled", updatable=true, nullable=true)
protected boolean haEnabled;
protected Long lastHostId;
@Column(name="pod_id", updatable=true, nullable=false)
protected Long podIdToDeployIn;
@Column(name="private_mac_address", updatable=true, nullable=true)
protected String privateMacAddress;
@Column(name="data_center_id", updatable=true, nullable=false)
protected long dataCenterIdToDeployIn;
@Column(name="vm_type", updatable=false, nullable=false, length=32)
@Enumerated(value=EnumType.STRING)
protected Type type;
@Column(name="ha_enabled", updatable=true, nullable=true)
protected boolean haEnabled;
@Column(name="limit_cpu_use", updatable=true, nullable=true)
private boolean limitCpuUse;
@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.
@Column(name=GenericDao.CREATED_COLUMN)
protected Date created;
@Column(name=GenericDao.REMOVED_COLUMN)
protected Date removed;
@Column(name="update_time", updatable=true)
@Temporal(value=TemporalType.TIMESTAMP)
@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.
@Column(name=GenericDao.CREATED_COLUMN)
protected Date created;
@Column(name=GenericDao.REMOVED_COLUMN)
protected Date removed;
@Column(name="update_time", updatable=true)
@Temporal(value=TemporalType.TIMESTAMP)
protected Date updateTime;
@Column(name="domain_id")
@ -188,12 +188,12 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
this(id, serviceOfferingId, name, instanceName, type, vmTemplateId, hypervisorType, guestOSId, domainId, accountId, haEnabled);
this.limitCpuUse = limitResourceUse;
}
protected VMInstanceVO() {
}
public Date getRemoved() {
return removed;
protected VMInstanceVO() {
}
public Date getRemoved() {
return removed;
}
@Override
@ -204,20 +204,20 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
@Override
public long getAccountId() {
return accountId;
}
@Override
public Type getType() {
return type;
}
public long getUpdated() {
return updated;
}
}
@Override
public Type getType() {
return type;
}
public long getUpdated() {
return updated;
}
@Override
public long getId() {
return id;
public long getId() {
return id;
}
@Override
@ -232,50 +232,50 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
@Override
public HypervisorType getHypervisorType() {
return hypervisorType;
}
}
@Override
public Date getCreated() {
return created;
}
public Date getUpdateTime() {
return updateTime;
}
public Date getCreated() {
return created;
}
public Date getUpdateTime() {
return updateTime;
}
@Override
public long getDataCenterIdToDeployIn() {
return dataCenterIdToDeployIn;
}
@Override
public String getHostName() {
return hostName;
}
@Override
public String getInstanceName() {
return instanceName;
}
@Override
public State getState() {
return state;
public long getDataCenterIdToDeployIn() {
return dataCenterIdToDeployIn;
}
@Override
public String getHostName() {
return hostName;
}
@Override
public String getInstanceName() {
return instanceName;
}
@Override
public State getState() {
return state;
}
// don't use this directly, use VM state machine instead, this method is added for migration tool only
@Override
public void setState(State state) {
this.state = state;
}
@Override
public String getPrivateIpAddress() {
return privateIpAddress;
}
public void setPrivateIpAddress(String address) {
privateIpAddress = address;
}
@Override
public String getPrivateIpAddress() {
return privateIpAddress;
}
public void setPrivateIpAddress(String address) {
privateIpAddress = address;
}
public void setVncPassword(String vncPassword) {
@ -307,40 +307,40 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
public void setProxyAssignTime(Date time) {
this.proxyAssignTime = time;
}
@Override
public long getTemplateId() {
@Override
public long getTemplateId() {
if (templateId == null) {
return -1;
} else {
return templateId;
}
}
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
}
}
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
@Override
public long getGuestOSId() {
return guestOSId;
}
public void setGuestOSId(long guestOSId) {
this.guestOSId = guestOSId;
}
public void incrUpdated() {
updated++;
public long getGuestOSId() {
return guestOSId;
}
public void setGuestOSId(long guestOSId) {
this.guestOSId = guestOSId;
}
public void incrUpdated() {
updated++;
}
public void decrUpdated() {
updated--;
}
@Override
public Long getHostId() {
return hostId;
}
@Override
public Long getHostId() {
return hostId;
}
@Override
@ -354,13 +354,13 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
public void setHostId(Long hostId) {
this.hostId = hostId;
}
@Override
public boolean isHaEnabled() {
return haEnabled;
}
@Override
public boolean isHaEnabled() {
return haEnabled;
}
@Override
public boolean limitCpuUse() {
return limitCpuUse;
@ -369,37 +369,37 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
public void setLimitCpuUse(boolean value) {
limitCpuUse = value;
}
@Override
public String getPrivateMacAddress() {
return privateMacAddress;
}
@Override
public Long getPodIdToDeployIn() {
return podIdToDeployIn;
}
public void setPodId(long podId) {
this.podIdToDeployIn = podId;
}
public void setPrivateMacAddress(String privateMacAddress) {
this.privateMacAddress = privateMacAddress;
}
public void setDataCenterId(long dataCenterId) {
this.dataCenterIdToDeployIn = dataCenterId;
}
public boolean isRemoved() {
return removed != null;
}
public void setHaEnabled(boolean value) {
haEnabled = value;
}
@Override
public String getPrivateMacAddress() {
return privateMacAddress;
}
@Override
public Long getPodIdToDeployIn() {
return podIdToDeployIn;
}
public void setPodId(long podId) {
this.podIdToDeployIn = podId;
}
public void setPrivateMacAddress(String privateMacAddress) {
this.privateMacAddress = privateMacAddress;
}
public void setDataCenterId(long dataCenterId) {
this.dataCenterIdToDeployIn = dataCenterId;
}
public boolean isRemoved() {
return removed != null;
}
public void setHaEnabled(boolean value) {
haEnabled = value;
}
public void setReservationId(String reservationId) {
this.reservationId = reservationId;
}
@ -422,13 +422,13 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
this.details = details;
}
transient String toString;
@Override
transient String toString;
@Override
public String toString() {
if (toString == null) {
toString = new StringBuilder("VM[").append(type.toString()).append("|").append(hostName).append("]").toString();
}
return toString;
return toString;
}
@ -458,5 +458,5 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
public void setServiceOfferingId(long serviceOfferingId) {
this.serviceOfferingId = serviceOfferingId;
}
}
}