Gilad Chaplik has uploaded a new change for review. Change subject: common: Introduce CPU profile ......................................................................
common: Introduce CPU profile CpuProfile contains common profile fields (extends profile base: qos, name, desc, etc.) and cluster which its attached to. Change-Id: I4d4a1926d0ad99557d4752bc81e572b499577c9d Signed-off-by: Gilad Chaplik <gchap...@redhat.com> --- A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/CpuProfile.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/ProfileType.java M frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml 3 files changed, 62 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/22/31622/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/CpuProfile.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/CpuProfile.java new file mode 100644 index 0000000..b0658b5 --- /dev/null +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/CpuProfile.java @@ -0,0 +1,59 @@ +package org.ovirt.engine.core.common.businessentities.profiles; + +import java.io.Serializable; + +import javax.validation.constraints.NotNull; + +import org.ovirt.engine.core.common.validation.group.CreateEntity; +import org.ovirt.engine.core.common.validation.group.UpdateEntity; +import org.ovirt.engine.core.compat.Guid; + +public class CpuProfile extends ProfileBase implements Serializable { + private static final long serialVersionUID = -7873671967250011737L; + + @NotNull(groups = { CreateEntity.class, UpdateEntity.class }) + private Guid clusterId; + + public CpuProfile() { + super(ProfileType.CPU); + } + + public Guid getClusterId() { + return clusterId; + } + + public void setClusterId(Guid storageDomainId) { + this.clusterId = storageDomainId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((clusterId == null) ? 0 : clusterId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + CpuProfile other = (CpuProfile) obj; + if (clusterId == null) { + if (other.clusterId != null) + return false; + } else if (!clusterId.equals(other.clusterId)) + return false; + return true; + } + + @Override + public String toString() { + return super.toString() + ", cluster id=" + getClusterId() + "}"; + } + +} diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/ProfileType.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/ProfileType.java index f207049..d5ad57b 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/ProfileType.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/profiles/ProfileType.java @@ -6,7 +6,8 @@ import org.ovirt.engine.core.common.businessentities.Identifiable; public enum ProfileType implements Identifiable { - DISK(1); + DISK(1), + CPU(2); private final int value; private static final Map<Integer, ProfileType> valueToStatus = new HashMap<Integer, ProfileType>(); diff --git a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml index 65e64d7..eae76a2 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml +++ b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml @@ -199,6 +199,7 @@ <!-- Profiles --> <include name="common/businessentities/profiles/DiskProfile.java" /> + <include name="common/businessentities/profiles/CpuProfile.java" /> <include name="common/businessentities/profiles/ProfileBase.java" /> <include name="common/businessentities/profiles/ProfileType.java" /> -- To view, visit http://gerrit.ovirt.org/31622 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d4a1926d0ad99557d4752bc81e572b499577c9d Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches