Yair Zaslavsky has uploaded a new change for review.

Change subject: [WIP] core: Introducing AsyncTaskEntity
......................................................................

[WIP] core: Introducing AsyncTaskEntity

This class will represent an association between entity and task

Change-Id: Icc1b12ce96177372bb86e28ceebf6460e1806924
Signed-off-by: Yair Zaslavsky <yzasl...@redhat.com>
---
A 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskEntity.java
1 file changed, 84 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/46/16446/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskEntity.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskEntity.java
new file mode 100644
index 0000000..11af752
--- /dev/null
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskEntity.java
@@ -0,0 +1,84 @@
+package org.ovirt.engine.core.common.businessentities;
+
+import org.ovirt.engine.core.common.VdcObjectType;
+import org.ovirt.engine.core.common.utils.ObjectUtils;
+import org.ovirt.engine.core.compat.Guid;
+
+public class AsyncTaskEntity implements BusinessEntity<Guid> {
+
+    private static final long serialVersionUID = -5368929756190062327L;
+    private Guid taskId;
+    private VdcObjectType entityType;
+    private Guid entityId;
+
+    public AsyncTaskEntity() {
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                + ((entityId == null) ? 0 : entityId.hashCode());
+        result = prime * result
+                + ((entityType == null) ? 0 : entityType.hashCode());
+        result = prime * result + ((taskId == null) ? 0 : taskId.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+
+        AsyncTaskEntity other = (AsyncTaskEntity) obj;
+        return ObjectUtils.objectsEqual(taskId, other.taskId) &&
+                ObjectUtils.objectsEqual(entityId, other.entityId) &&
+                ObjectUtils.objectsEqual(entityType, other.entityType);
+    }
+
+    public AsyncTaskEntity(Guid taskId, VdcObjectType entityType, Guid 
entityId) {
+        this.taskId = taskId;
+        this.entityType = entityType;
+        this.entityId = entityId;
+    }
+
+    public Guid getEntityId() {
+        return entityId;
+    }
+
+    public void setEntityId(Guid entityId) {
+        this.entityId = entityId;
+    }
+
+    public Guid getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(Guid taskId) {
+        this.taskId = taskId;
+    }
+
+    public VdcObjectType getEntityType() {
+        return entityType;
+    }
+
+    public void setEntityType(VdcObjectType entityType) {
+        this.entityType = entityType;
+    }
+
+    @Override
+    public Guid getId() {
+        return taskId;
+    }
+
+    @Override
+    public void setId(Guid id) {
+        this.taskId = id;
+    }
+
+}


-- 
To view, visit http://gerrit.ovirt.org/16446
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc1b12ce96177372bb86e28ceebf6460e1806924
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to