Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BD62111A46 for ; Sat, 11 May 2013 09:59:44 +0000 (UTC) Received: (qmail 6349 invoked by uid 500); 11 May 2013 09:59:33 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 5463 invoked by uid 500); 11 May 2013 09:59:32 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 4721 invoked by uid 99); 11 May 2013 09:59:30 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 May 2013 09:59:30 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9475888C0EF; Sat, 11 May 2013 09:59:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nitin@apache.org To: commits@cloudstack.apache.org Date: Sat, 11 May 2013 09:59:51 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [26/51] [partial] merge master http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/alert/AlertVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/alert/AlertVO.java b/core/src/com/cloud/alert/AlertVO.java deleted file mode 100755 index 3f014aa..0000000 --- a/core/src/com/cloud/alert/AlertVO.java +++ /dev/null @@ -1,183 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.alert; - -import java.util.Date; -import java.util.UUID; - -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; - -import com.cloud.utils.db.GenericDao; - -@Entity -@Table(name="alert") -public class AlertVO implements Alert { - @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) - private Date resolved; - - @Column(name="uuid") - private String uuid; - - @Column(name="archived") - private boolean archived; - - public AlertVO() { - this.uuid = UUID.randomUUID().toString(); - } - public AlertVO(Long id) { - this.id = id; - this.uuid = UUID.randomUUID().toString(); - } - - @Override - public long getId() { - return id; - } - @Override - 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 Long getClusterId() { - return clusterId; - } - public void setClusterId(Long clusterId) { - this.clusterId = clusterId; - } - @Override - 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; - } - - @Override - 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; - } - - @Override - 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; - } - - @Override - public String getUuid() { - return this.uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - @Override - public boolean getArchived() { - return archived; - } - - public void setArchived(Boolean archived) { - this.archived = archived; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/async/AsyncJobVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/async/AsyncJobVO.java b/core/src/com/cloud/async/AsyncJobVO.java deleted file mode 100644 index ad482b0..0000000 --- a/core/src/com/cloud/async/AsyncJobVO.java +++ /dev/null @@ -1,400 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.async; - -import java.util.Date; -import java.util.UUID; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.Transient; - -import com.cloud.utils.db.GenericDao; -import org.apache.cloudstack.api.InternalIdentity; - -@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; - - @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") - private String uuid; - - @Transient - private SyncQueueItemVO syncSource = null; - - @Transient - private boolean fromPreviousSession = false; - - - public AsyncJobVO() { - this.uuid = UUID.randomUUID().toString(); - } - - public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, Long instanceId, Type instanceType) { - this.userId = userId; - this.accountId = accountId; - this.cmd = cmd; - this.cmdInfo = cmdInfo; - this.callbackType = CALLBACK_POLLING; - this.uuid = UUID.randomUUID().toString(); - this.instanceId = instanceId; - } - - public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, - int callbackType, String callbackAddress, Long instanceId, Type instanceType) { - - this(userId, accountId, cmd, cmdInfo, instanceId, instanceType); - 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; - } - - @Override - 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 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; - } - - @Override - public SyncQueueItemVO getSyncSource() { - return syncSource; - } - - public void setSyncSource(SyncQueueItemVO syncSource) { - this.syncSource = syncSource; - } - - @Override - public boolean isFromPreviousSession() { - return fromPreviousSession; - } - - public void setFromPreviousSession(boolean fromPreviousSession) { - this.fromPreviousSession = fromPreviousSession; - } - - @Override - public String getUuid() { - return this.uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - @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(); - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/async/SyncQueueItemVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/async/SyncQueueItemVO.java b/core/src/com/cloud/async/SyncQueueItemVO.java deleted file mode 100644 index b0546a7..0000000 --- a/core/src/com/cloud/async/SyncQueueItemVO.java +++ /dev/null @@ -1,141 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.async; - -import org.apache.cloudstack.api.InternalIdentity; - -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_item") -public class SyncQueueItemVO implements SyncQueueItem, InternalIdentity { - - @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="queue_proc_time") - @Temporal(TemporalType.TIMESTAMP) - private Date lastProcessTime; - - @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(", lastProcessTime: ").append(getLastProcessTime()); - sb.append(", created: ").append(getCreated()); - sb.append("}"); - return sb.toString(); - } - - public Date getLastProcessTime() { - return lastProcessTime; - } - - public void setLastProcessTime(Date lastProcessTime) { - this.lastProcessTime = lastProcessTime; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/async/SyncQueueVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/async/SyncQueueVO.java b/core/src/com/cloud/async/SyncQueueVO.java deleted file mode 100644 index 4f2bc4f..0000000 --- a/core/src/com/cloud/async/SyncQueueVO.java +++ /dev/null @@ -1,137 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package com.cloud.async; - -import org.apache.cloudstack.api.InternalIdentity; - -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 implements InternalIdentity { - - @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="created") - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Column(name="last_updated") - @Temporal(TemporalType.TIMESTAMP) - private Date lastUpdated; - - @Column(name="queue_size") - private long queueSize = 0; - - @Column(name="queue_size_limit") - private long queueSizeLimit = 0; - - public long getId() { - return 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 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(", lastProcessNumber: ").append(getLastProcessNumber()); - sb.append(", lastUpdated: ").append(getLastUpdated()); - sb.append(", created: ").append(getCreated()); - sb.append(", count: ").append(getQueueSize()); - sb.append("}"); - return sb.toString(); - } - - public long getQueueSize() { - return queueSize; - } - - public void setQueueSize(long queueSize) { - this.queueSize = queueSize; - } - - public long getQueueSizeLimit() { - return queueSizeLimit; - } - - public void setQueueSizeLimit(long queueSizeLimit) { - this.queueSizeLimit = queueSizeLimit; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/capacity/CapacityVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/capacity/CapacityVO.java b/core/src/com/cloud/capacity/CapacityVO.java deleted file mode 100755 index d34e9d3..0000000 --- a/core/src/com/cloud/capacity/CapacityVO.java +++ /dev/null @@ -1,204 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.capacity; - -import javax.persistence.Transient; -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; - -import com.cloud.utils.db.GenericDao; -import org.apache.cloudstack.api.InternalIdentity; - -@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="reserved_capacity") - private long reservedCapacity; - - @Column(name="total_capacity") - private long totalCapacity; - - @Column(name="capacity_type") - private short capacityType; - - @Column(name="capacity_state") - private CapacityState capacityState; - - @Column(name=GenericDao.CREATED_COLUMN) - protected Date created; - - @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; - this.podId = podId; - this.clusterId = clusterId; - this.usedCapacity = usedCapacity; - this.totalCapacity = totalCapacity; - this.capacityType = capacityType; - this.updateTime = new Date(); - this.capacityState = CapacityState.Enabled; - } - - public CapacityVO(Long dataCenterId, Long podId, Long clusterId, short capacityType, float usedPercentage) { - this.dataCenterId = dataCenterId; - this.podId = podId; - this.clusterId = clusterId; - this.capacityType = capacityType; - this.usedPercentage = usedPercentage; - this.capacityState = CapacityState.Enabled; - } - - @Override - public long getId() { - return id; - } - - @Override - 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; - } - - @Override - public Long getPodId() { - return podId; - } - public void setPodId(long podId) { - this.podId = new Long(podId); - } - - @Override - public Long getClusterId() { - return clusterId; - } - public void setClusterId(long clusterId) { - this.clusterId = new Long(clusterId); - } - - @Override - public long getUsedCapacity() { - return usedCapacity; - } - public void setUsedCapacity(long usedCapacity) { - this.usedCapacity = usedCapacity; - this.setUpdateTime (new Date()); - } - @Override - public long getReservedCapacity() { - return reservedCapacity; - } - public void setReservedCapacity(long reservedCapacity) { - this.reservedCapacity = reservedCapacity; - this.setUpdateTime (new Date()); - } - @Override - public long getTotalCapacity() { - return totalCapacity; - } - public void setTotalCapacity(long totalCapacity) { - this.totalCapacity = totalCapacity; - this.setUpdateTime (new Date()); - } - @Override - public short getCapacityType() { - return capacityType; - } - public void setCapacityType(short capacityType) { - this.capacityType = capacityType; - } - - public CapacityState getCapacityState() { - return capacityState; - } - - public void setCapacityState(CapacityState capacityState) { - this.capacityState = capacityState; - } - - public Date getCreated() { - return created; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - @Override - public Float getUsedPercentage() { - return usedPercentage; - } - - public void setUsedPercentage(float usedPercentage) { - this.usedPercentage = usedPercentage; - } - - @Override - public String getUuid() { - return null; //To change body of implemented methods use File | Settings | File Templates. - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/certificate/CertificateVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/certificate/CertificateVO.java b/core/src/com/cloud/certificate/CertificateVO.java deleted file mode 100644 index 4f04760..0000000 --- a/core/src/com/cloud/certificate/CertificateVO.java +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.certificate; - -import org.apache.cloudstack.api.InternalIdentity; - -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="certificate") -public class CertificateVO implements InternalIdentity { - - @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) - @Column(name="id") - private Long id = null; - - @Column(name="certificate",length=65535) - private String certificate; - - @Column(name="updated") - private String updated; - - public CertificateVO() {} - - public long getId() { - return id; - } - - public String getCertificate() { - return certificate; - } - public void setCertificate(String certificate) { - this.certificate = certificate; - } - - public String getUpdated(){ - return this.updated; - } - - public void setUpdated(String updated){ - this.updated = updated; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/configuration/ConfigurationVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/configuration/ConfigurationVO.java b/core/src/com/cloud/configuration/ConfigurationVO.java deleted file mode 100644 index 6cd87b0..0000000 --- a/core/src/com/cloud/configuration/ConfigurationVO.java +++ /dev/null @@ -1,107 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -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; - } - - 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; - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/configuration/ResourceCountVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/configuration/ResourceCountVO.java b/core/src/com/cloud/configuration/ResourceCountVO.java deleted file mode 100644 index b87f55c..0000000 --- a/core/src/com/cloud/configuration/ResourceCountVO.java +++ /dev/null @@ -1,131 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.configuration; - -import org.apache.cloudstack.api.InternalIdentity; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; - -@Entity -@Table(name="resource_count") -public class ResourceCountVO implements ResourceCount { - - @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) - @Column(name="id") - private Long id = null; - - @Column(name="type") - @Enumerated(EnumType.STRING) - private ResourceType type; - - @Column(name="account_id") - private Long accountId; - - @Column(name="domain_id") - private Long domainId; - - @Column(name="count") - private long count; - - - public ResourceCountVO(){} - - public ResourceCountVO(ResourceType type, long count, long ownerId, ResourceOwnerType ownerType) { - this.type = type; - this.count = count; - - if (ownerType == ResourceOwnerType.Account) { - this.accountId = ownerId; - } else if (ownerType == ResourceOwnerType.Domain) { - this.domainId = ownerId; - } - } - - @Override - public long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - @Override - public ResourceType getType() { - return type; - } - - public void setType(ResourceType type) { - this.type = type; - } - - @Override - public long getCount() { - return count; - } - @Override - public void setCount(long count) { - this.count = count; - } - - public Long getDomainId() { - return domainId; - } - - public Long getAccountId() { - return accountId; - } - - @Override - public String toString() { - return new StringBuilder("REsourceCount[").append("-").append(id).append("-").append(type).append("-").append(accountId).append("-").append(domainId).append("]").toString(); - } - - @Override - public long getOwnerId() { - if (accountId != null) { - return accountId; - } - - return domainId; - } - - @Override - public ResourceOwnerType getResourceOwnerType() { - if (accountId != null) { - return ResourceOwnerType.Account; - } else { - return ResourceOwnerType.Domain; - } - } - - public void setDomainId(Long domainId) { - this.domainId = domainId; - } - - public void setAccountId(Long accountId) { - this.accountId = accountId; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/configuration/ResourceLimitVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/configuration/ResourceLimitVO.java b/core/src/com/cloud/configuration/ResourceLimitVO.java deleted file mode 100644 index c131495..0000000 --- a/core/src/com/cloud/configuration/ResourceLimitVO.java +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.configuration; - -import org.apache.cloudstack.api.InternalIdentity; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; - -@Entity -@Table(name = "resource_limit") -public class ResourceLimitVO implements ResourceLimit { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id = null; - - @Column(name = "type") - @Enumerated(EnumType.STRING) - private ResourceCount.ResourceType type; - - @Column(name = "domain_id") - private Long domainId; - - @Column(name = "account_id") - private Long accountId; - - @Column(name = "max") - private Long max; - - public ResourceLimitVO() { - } - - public ResourceLimitVO(ResourceCount.ResourceType type, Long max, long ownerId, ResourceOwnerType ownerType) { - this.type = type; - this.max = max; - - if (ownerType == ResourceOwnerType.Account) { - this.accountId = ownerId; - } else if (ownerType == ResourceOwnerType.Domain) { - this.domainId = ownerId; - } - } - - @Override - public long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - @Override - public ResourceType getType() { - return type; - } - - public void setType(ResourceCount.ResourceType type) { - this.type = type; - } - - public Long getDomainId() { - return domainId; - } - - public Long getAccountId() { - return accountId; - } - - @Override - public Long getMax() { - return max; - } - - @Override - public void setMax(Long max) { - this.max = max; - } - - @Override - public long getOwnerId() { - if (accountId != null) { - return accountId; - } - - return domainId; - } - - @Override - public ResourceOwnerType getResourceOwnerType() { - if (accountId != null) { - return ResourceOwnerType.Account; - } else { - return ResourceOwnerType.Domain; - } - } - - public void setDomainId(Long domainId) { - this.domainId = domainId; - } - - public void setAccountId(Long accountId) { - this.accountId = accountId; - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/event/EventVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/event/EventVO.java b/core/src/com/cloud/event/EventVO.java deleted file mode 100644 index 2c30ead..0000000 --- a/core/src/com/cloud/event/EventVO.java +++ /dev/null @@ -1,194 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.event; - -import java.util.Date; -import java.util.UUID; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Transient; - -import com.cloud.utils.db.GenericDao; - -@Entity -@Table(name="event") -public class EventVO implements Event { - @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 String level = LEVEL_INFO; - - @Column(name="start_id") - private long startId; - - @Column(name="parameters", length=1024) - private String parameters; - - @Column(name="uuid") - private String uuid; - - @Column(name="archived") - private boolean archived; - - @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; - } - @Override - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - @Override - public State getState() { - return state; - } - - public void setState(State state) { - this.state = state; - } - - @Override - 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; - } - @Override - 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 void setDomainId(long domainId) { - this.domainId = domainId; - } - - @Override - 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; - } - @Override - public long getStartId() { - return startId; - } - - public void setStartId(long startId) { - this.startId = startId; - } - - @Override - public String getParameters() { - return parameters; - } - public void setParameters(String parameters) { - this.parameters = parameters; - } - - @Override - public String getUuid() { - return this.uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - @Override - public boolean getArchived() { - return archived; - } - - public void setArchived(Boolean archived) { - this.archived = archived; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/event/UsageEvent.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/event/UsageEvent.java b/core/src/com/cloud/event/UsageEvent.java deleted file mode 100644 index 0d4ef17..0000000 --- a/core/src/com/cloud/event/UsageEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.event; - -import org.apache.cloudstack.api.InternalIdentity; - -import java.util.Date; - -public interface UsageEvent extends InternalIdentity { - String getType(); - - Date getCreateDate(); - long getAccountId(); - Long getSize(); - Long getTemplateId(); - Long getOfferingId(); - long getResourceId(); - long getZoneId(); -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/event/UsageEventVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/event/UsageEventVO.java b/core/src/com/cloud/event/UsageEventVO.java deleted file mode 100644 index c92972b..0000000 --- a/core/src/com/cloud/event/UsageEventVO.java +++ /dev/null @@ -1,216 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.event; - -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 com.cloud.utils.db.GenericDao; -import org.apache.cloudstack.api.InternalIdentity; - -@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="zone_id") - private long zoneId; - - @Column(name="resource_id") - private long resourceId; - - @Column(name="resource_name") - private String resourceName; - - @Column(name="offering_id") - private Long offeringId; - - @Column(name="template_id") - private Long templateId; - - @Column(name="size") - private Long size; - - @Column(name="resource_type") - private String resourceType; - - @Column(name="processed") - boolean processed; - - - public UsageEventVO() { - } - - public UsageEventVO(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, Long size) { - this.type = usageType; - this.accountId = accountId; - this.zoneId = zoneId; - this.resourceId = resourceId; - this.resourceName = resourceName; - this.offeringId = offeringId; - this.templateId = templateId; - this.size = size; - } - - public UsageEventVO(String usageType, long accountId, long zoneId, long resourceId, String resourceName) { - this.type = usageType; - this.accountId = accountId; - this.zoneId = zoneId; - this.resourceId = resourceId; - this.resourceName = resourceName; - } - - //IPAddress usage event - public UsageEventVO(String usageType, long accountId, long zoneId, long ipAddressId, String ipAddress, boolean isSourceNat, String guestType, boolean isSystem) { - this.type = usageType; - this.accountId = accountId; - this.zoneId = zoneId; - this.resourceId = ipAddressId; - this.resourceName = ipAddress; - this.size = (isSourceNat ? 1L : 0L); - this.resourceType = guestType; - this.templateId = (isSystem ? 1L : 0L); - } - - public UsageEventVO(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, String resourceType) { - this.type = usageType; - this.accountId = accountId; - this.zoneId = zoneId; - this.resourceId = resourceId; - this.resourceName = resourceName; - this.offeringId = offeringId; - this.templateId = templateId; - this.resourceType = resourceType; - } - - //Security Group usage event - public UsageEventVO(String usageType, long accountId, - long zoneId, long vmId, long securityGroupId) { - this.type = usageType; - this.accountId = accountId; - this.zoneId = zoneId; - this.resourceId = vmId; - this.offeringId = securityGroupId; - } - - @Override - public long getId() { - return id; - } - @Override - 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; - } - - @Override - public long getAccountId() { - return accountId; - } - public void setAccountId(long accountId) { - this.accountId = accountId; - } - - public void setZoneId(long zoneId) { - this.zoneId = zoneId; - } - @Override - public long getZoneId() { - return zoneId; - } - - public void setResourceId(long resourceId) { - this.resourceId = resourceId; - } - @Override - public long getResourceId() { - return resourceId; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - - public String getResourceName() { - return resourceName; - } - - public void setOfferingId(long offeringId) { - this.offeringId = offeringId; - } - @Override - public Long getOfferingId() { - return offeringId; - } - - public void setTemplateId(long templateId) { - this.templateId = templateId; - } - @Override - public Long getTemplateId() { - return templateId; - } - - public void setSize(long size) { - this.size = size; - } - @Override - public Long getSize() { - return size; - } - - public boolean isProcessed() { - return processed; - } - - public void setProcessed(boolean processed) { - this.processed = processed; - } - - public String getResourceType() { - return resourceType; - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/event/dao/EventDao.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/event/dao/EventDao.java b/core/src/com/cloud/event/dao/EventDao.java deleted file mode 100644 index da5f47a..0000000 --- a/core/src/com/cloud/event/dao/EventDao.java +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.event.dao; - -import java.util.Date; -import java.util.List; - -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 { - public List searchAllEvents(SearchCriteria sc, Filter filter); - - public List listOlderEvents(Date oldTime); - - EventVO findCompletedEvent(long startId); - - public List listToArchiveOrDeleteEvents(List ids, String type, Date olderThan, Long accountId); - - public void archiveEvents(List events); - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/event/dao/EventDaoImpl.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/event/dao/EventDaoImpl.java b/core/src/com/cloud/event/dao/EventDaoImpl.java deleted file mode 100644 index 6ba59c5..0000000 --- a/core/src/com/cloud/event/dao/EventDaoImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.event.dao; - -import java.util.Date; -import java.util.List; - -import javax.ejb.Local; - -import org.apache.log4j.Logger; -import org.springframework.stereotype.Component; - -import com.cloud.event.Event.State; -import com.cloud.event.EventVO; -import com.cloud.utils.db.Filter; -import com.cloud.utils.db.GenericDaoBase; -import com.cloud.utils.db.SearchBuilder; -import com.cloud.utils.db.SearchCriteria; -import com.cloud.utils.db.Transaction; -import com.cloud.utils.db.SearchCriteria.Op; - -@Component -@Local(value={EventDao.class}) -public class EventDaoImpl extends GenericDaoBase implements EventDao { - public static final Logger s_logger = Logger.getLogger(EventDaoImpl.class.getName()); - protected final SearchBuilder CompletedEventSearch; - protected final SearchBuilder ToArchiveOrDeleteEventSearch; - - public EventDaoImpl () { - CompletedEventSearch = createSearchBuilder(); - CompletedEventSearch.and("state",CompletedEventSearch.entity().getState(),SearchCriteria.Op.EQ); - CompletedEventSearch.and("startId", CompletedEventSearch.entity().getStartId(), SearchCriteria.Op.EQ); - CompletedEventSearch.done(); - - ToArchiveOrDeleteEventSearch = createSearchBuilder(); - ToArchiveOrDeleteEventSearch.and("id", ToArchiveOrDeleteEventSearch.entity().getId(), Op.IN); - ToArchiveOrDeleteEventSearch.and("type", ToArchiveOrDeleteEventSearch.entity().getType(), Op.EQ); - ToArchiveOrDeleteEventSearch.and("accountId", ToArchiveOrDeleteEventSearch.entity().getAccountId(), Op.EQ); - ToArchiveOrDeleteEventSearch.and("createDateL", ToArchiveOrDeleteEventSearch.entity().getCreateDate(), Op.LT); - ToArchiveOrDeleteEventSearch.done(); - } - - @Override - public List searchAllEvents(SearchCriteria sc, Filter filter) { - return listIncludingRemovedBy(sc, filter); - } - - @Override - public List listOlderEvents(Date oldTime) { - if (oldTime == null) return null; - SearchCriteria sc = createSearchCriteria(); - sc.addAnd("createDate", SearchCriteria.Op.LT, oldTime); - return listIncludingRemovedBy(sc, null); - } - - @Override - public EventVO findCompletedEvent(long startId) { - SearchCriteria sc = CompletedEventSearch.create(); - sc.setParameters("state", State.Completed); - sc.setParameters("startId", startId); - return findOneIncludingRemovedBy(sc); - } - - @Override - public List listToArchiveOrDeleteEvents(List ids, String type, Date olderThan, Long accountId) { - SearchCriteria sc = ToArchiveOrDeleteEventSearch.create(); - if (ids != null) { - sc.setParameters("id", ids.toArray(new Object[ids.size()])); - } - if (type != null) { - sc.setParameters("type", type); - } - if (olderThan != null) { - sc.setParameters("createDateL", olderThan); - } - if (accountId != null) { - sc.setParameters("accountId", accountId); - } - return search(sc, null); - } - - @Override - public void archiveEvents(List events) { - - Transaction txn = Transaction.currentTxn(); - txn.start(); - for (EventVO event : events) { - event = lockRow(event.getId(), true); - event.setArchived(true); - update(event.getId(), event); - txn.commit(); - } - txn.close(); - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/event/dao/UsageEventDao.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/event/dao/UsageEventDao.java b/core/src/com/cloud/event/dao/UsageEventDao.java deleted file mode 100644 index 52fa01d..0000000 --- a/core/src/com/cloud/event/dao/UsageEventDao.java +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -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 { - - public List listLatestEvents(Date endDate); - - public List getLatestEvent(); - - List getRecentEvents(Date endDate) throws UsageServerException; - - List listDirectIpEvents(Date startDate, Date endDate, long zoneId); - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/event/dao/UsageEventDaoImpl.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/event/dao/UsageEventDaoImpl.java b/core/src/com/cloud/event/dao/UsageEventDaoImpl.java deleted file mode 100644 index dafc8d4..0000000 --- a/core/src/com/cloud/event/dao/UsageEventDaoImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.event.dao; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.Date; -import java.util.List; -import java.util.TimeZone; - -import javax.ejb.Local; - -import org.apache.log4j.Logger; -import org.springframework.stereotype.Component; - -import com.cloud.dc.Vlan; -import com.cloud.event.EventTypes; -import com.cloud.event.UsageEventVO; -import com.cloud.exception.UsageServerException; -import com.cloud.utils.DateUtil; -import com.cloud.utils.db.DB; -import com.cloud.utils.db.Filter; -import com.cloud.utils.db.GenericDaoBase; -import com.cloud.utils.db.SearchBuilder; -import com.cloud.utils.db.SearchCriteria; -import com.cloud.utils.db.Transaction; - -@Component -@Local(value={UsageEventDao.class}) -public class UsageEventDaoImpl extends GenericDaoBase implements UsageEventDao { - public static final Logger s_logger = Logger.getLogger(UsageEventDaoImpl.class.getName()); - - private final SearchBuilder latestEventsSearch; - private final SearchBuilder IpeventsSearch; - private static final String COPY_EVENTS = "INSERT INTO cloud_usage.usage_event (id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type) " + - "SELECT id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type FROM cloud.usage_event vmevt WHERE vmevt.id > ? and vmevt.id <= ? "; - private static final String COPY_ALL_EVENTS = "INSERT INTO cloud_usage.usage_event (id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type) " + - "SELECT id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type FROM cloud.usage_event vmevt WHERE vmevt.id <= ?"; - private static final String MAX_EVENT = "select max(id) from cloud.usage_event where created <= ?"; - - - public UsageEventDaoImpl () { - latestEventsSearch = createSearchBuilder(); - latestEventsSearch.and("processed", latestEventsSearch.entity().isProcessed(), SearchCriteria.Op.EQ); - latestEventsSearch.and("enddate", latestEventsSearch.entity().getCreateDate(), SearchCriteria.Op.LTEQ); - latestEventsSearch.done(); - - IpeventsSearch = createSearchBuilder(); - IpeventsSearch.and("startdate", IpeventsSearch.entity().getCreateDate(), SearchCriteria.Op.GTEQ); - IpeventsSearch.and("enddate", IpeventsSearch.entity().getCreateDate(), SearchCriteria.Op.LTEQ); - IpeventsSearch.and("zoneid", IpeventsSearch.entity().getZoneId(), SearchCriteria.Op.EQ); - IpeventsSearch.and("networktype", IpeventsSearch.entity().getResourceType(), SearchCriteria.Op.EQ); - IpeventsSearch.and().op("assignEvent", IpeventsSearch.entity().getType(), SearchCriteria.Op.EQ); - IpeventsSearch.or("releaseEvent", IpeventsSearch.entity().getType(), SearchCriteria.Op.EQ); - IpeventsSearch.closeParen(); - IpeventsSearch.done(); - } - - @Override - public List listLatestEvents(Date endDate) { - Filter filter = new Filter(UsageEventVO.class, "createDate", Boolean.TRUE, null, null); - SearchCriteria sc = latestEventsSearch.create(); - sc.setParameters("processed", false); - sc.setParameters("enddate", endDate); - return listBy(sc, filter); - } - - @Override - public List getLatestEvent() { - Filter filter = new Filter(UsageEventVO.class, "id", Boolean.FALSE, Long.valueOf(0), Long.valueOf(1)); - return listAll(filter); - } - - @Override - @DB - public synchronized List getRecentEvents(Date endDate) throws UsageServerException { - long recentEventId = getMostRecentEventId(); - long maxEventId = getMaxEventId(endDate); - Transaction txn = Transaction.open(Transaction.USAGE_DB); - String sql = COPY_EVENTS; - if (recentEventId == 0) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("no recent event date, copying all events"); - } - sql = COPY_ALL_EVENTS; - } - - PreparedStatement pstmt = null; - try { - txn.start(); - pstmt = txn.prepareAutoCloseStatement(sql); - int i = 1; - if (recentEventId != 0) { - pstmt.setLong(i++, recentEventId); - } - pstmt.setLong(i++, maxEventId); - pstmt.executeUpdate(); - txn.commit(); - return findRecentEvents(endDate); - } catch (Exception ex) { - txn.rollback(); - s_logger.error("error copying events from cloud db to usage db", ex); - throw new UsageServerException(ex.getMessage()); - } - } - - @DB - private long getMostRecentEventId() throws UsageServerException { - Transaction txn = Transaction.open(Transaction.USAGE_DB); - try { - List latestEvents = getLatestEvent(); - - if(latestEvents !=null && latestEvents.size() == 1){ - UsageEventVO latestEvent = latestEvents.get(0); - if(latestEvent != null){ - return latestEvent.getId(); - } - } - return 0; - } catch (Exception ex) { - s_logger.error("error getting most recent event id", ex); - throw new UsageServerException(ex.getMessage()); - } finally { - txn.close(); - } - } - - private List findRecentEvents(Date endDate) throws UsageServerException { - Transaction txn = Transaction.open(Transaction.USAGE_DB); - try { - return listLatestEvents(endDate); - } catch (Exception ex) { - s_logger.error("error getting most recent event date", ex); - throw new UsageServerException(ex.getMessage()); - } finally { - txn.close(); - } - } - - private long getMaxEventId(Date endDate) throws UsageServerException { - Transaction txn = Transaction.currentTxn(); - PreparedStatement pstmt = null; - try { - String sql = MAX_EVENT; - pstmt = txn.prepareAutoCloseStatement(sql); - pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), endDate)); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) { - return Long.valueOf(rs.getLong(1)); - } - return 0; - } catch (Exception ex) { - s_logger.error("error getting max event id", ex); - throw new UsageServerException(ex.getMessage()); - } finally { - txn.close(); - } - } - - @Override - public List listDirectIpEvents(Date startDate, Date endDate, long zoneId) { - Filter filter = new Filter(UsageEventVO.class, "createDate", Boolean.TRUE, null, null); - SearchCriteria sc = IpeventsSearch.create(); - sc.setParameters("startdate", startDate); - sc.setParameters("enddate", endDate); - sc.setParameters("assignEvent", EventTypes.EVENT_NET_IP_ASSIGN); - sc.setParameters("releaseEvent", EventTypes.EVENT_NET_IP_RELEASE); - sc.setParameters("zoneid", zoneId); - sc.setParameters("networktype", Vlan.VlanType.DirectAttached.toString()); - return listBy(sc, filter); - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/exception/AgentControlChannelException.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/exception/AgentControlChannelException.java b/core/src/com/cloud/exception/AgentControlChannelException.java deleted file mode 100644 index 50b84d4..0000000 --- a/core/src/com/cloud/exception/AgentControlChannelException.java +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -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); - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/host/DetailVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/host/DetailVO.java b/core/src/com/cloud/host/DetailVO.java deleted file mode 100644 index 4e62490..0000000 --- a/core/src/com/cloud/host/DetailVO.java +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.host; - -import org.apache.cloudstack.api.InternalIdentity; - -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_details") -public class DetailVO implements InternalIdentity { - @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) - @Column(name="id") - private long id; - - @Column(name="host_id") - private long hostId; - - @Column(name="name") - private String name; - - @Column(name="value") - private String value; - - protected DetailVO() { - } - - public DetailVO(long hostId, String name, String value) { - this.hostId = hostId; - this.name = name; - this.value = value; - } - - public long getHostId() { - return hostId; - } - - public String getName() { - return name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public long getId() { - return id; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/core/src/com/cloud/host/HostTagVO.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/host/HostTagVO.java b/core/src/com/cloud/host/HostTagVO.java deleted file mode 100644 index b1f5ace..0000000 --- a/core/src/com/cloud/host/HostTagVO.java +++ /dev/null @@ -1,65 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.host; - -import org.apache.cloudstack.api.InternalIdentity; - -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 implements InternalIdentity { - @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; - } -}