Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-03-28 17:37:29 -0400
committerAngel Avila2016-10-04 21:34:59 -0400
commite8cbe2b7edccec149f9989e3a56a7f5ca51719c8 (patch)
treef7e6c3272110ac7ebba466cb7d4ad6cdbe16c622
parent4d6770d1b40e6f1139beceba0bbd65b2c7035321 (diff)
downloadorg.eclipse.osee-e8cbe2b7edccec149f9989e3a56a7f5ca51719c8.tar.gz
org.eclipse.osee-e8cbe2b7edccec149f9989e3a56a7f5ca51719c8.tar.xz
org.eclipse.osee-e8cbe2b7edccec149f9989e3a56a7f5ca51719c8.zip
refactor: Base ActivityEntryId on BaseId
-rw-r--r--plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntry.java6
-rw-r--r--plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntryId.java42
-rw-r--r--plugins/org.eclipse.osee.activity/src/org/eclipse/osee/activity/internal/jaxrs/ActivityLogResource.java6
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseId.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ActivityLogJaxRsService.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/ActivityLogJaxRsService.java2
6 files changed, 21 insertions, 45 deletions
diff --git a/plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntry.java b/plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntry.java
index 2014a53dfef..db745f3a50e 100644
--- a/plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntry.java
+++ b/plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntry.java
@@ -27,6 +27,10 @@ public class ActivityEntry extends ActivityEntryId {
private Integer status;
private String messageArgs;
+ public ActivityEntry(Long id) {
+ super(id);
+ }
+
public Long getParentId() {
return parentId;
}
@@ -101,7 +105,7 @@ public class ActivityEntry extends ActivityEntryId {
@Override
public String toString() {
- return "ActivityEntry [" + super.getGuid() + ", parentId=" + parentId + ", typeId=" + typeId + ", accountId=" + accountId + ", serverId=" + serverId + ", clientId=" + clientId + ", startTime=" + startTime + ", duration=" + duration + ", status=" + status + ", messageArgs=" + messageArgs + "]";
+ return "ActivityEntry [" + getId() + ", parentId=" + parentId + ", typeId=" + typeId + ", accountId=" + accountId + ", serverId=" + serverId + ", clientId=" + clientId + ", startTime=" + startTime + ", duration=" + duration + ", status=" + status + ", messageArgs=" + messageArgs + "]";
}
}
diff --git a/plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntryId.java b/plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntryId.java
index 03264be1689..a47343280a8 100644
--- a/plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntryId.java
+++ b/plugins/org.eclipse.osee.activity.api/src/org/eclipse/osee/activity/api/ActivityEntryId.java
@@ -11,47 +11,15 @@
package org.eclipse.osee.activity.api;
import javax.xml.bind.annotation.XmlRootElement;
-import org.eclipse.osee.framework.jdk.core.type.Identity;
+import org.eclipse.osee.framework.jdk.core.type.BaseId;
/**
* @author Ryan D. Brooks
*/
@XmlRootElement
-public class ActivityEntryId implements Identity<Long> {
+public class ActivityEntryId extends BaseId {
- private Long id;
-
- public void setGuid(long id) {
- this.id = id;
- }
-
- @Override
- public Long getGuid() {
- return id;
- }
-
- @Override
- public int hashCode() {
- return getGuid().hashCode();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public boolean equals(Object obj) {
- boolean equal = false;
- if (obj instanceof Identity) {
- Identity<Long> identity = (Identity<Long>) obj;
- if (getGuid() == identity.getGuid()) {
- equal = true;
- } else if (getGuid() != null) {
- equal = getGuid().equals(identity.getGuid());
- }
- }
- return equal;
- }
-
- @Override
- public String toString() {
- return "ActivityEntryId [id=" + id + "]";
+ public ActivityEntryId(Long id) {
+ super(id);
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.activity/src/org/eclipse/osee/activity/internal/jaxrs/ActivityLogResource.java b/plugins/org.eclipse.osee.activity/src/org/eclipse/osee/activity/internal/jaxrs/ActivityLogResource.java
index b58c277190e..cd658fff916 100644
--- a/plugins/org.eclipse.osee.activity/src/org/eclipse/osee/activity/internal/jaxrs/ActivityLogResource.java
+++ b/plugins/org.eclipse.osee.activity/src/org/eclipse/osee/activity/internal/jaxrs/ActivityLogResource.java
@@ -39,7 +39,7 @@ public final class ActivityLogResource implements ActivityLogEndpoint {
@Override
public ActivityEntry getEntry(Long entryId) {
Conditions.checkNotNull(entryId, "activity entry id");
- final ActivityEntry entry = new ActivityEntry();
+ final ActivityEntry entry = new ActivityEntry(entryId);
final MutableBoolean found = new MutableBoolean(false);
activityLog.queryEntry(entryId, new ActivityDataHandler() {
@@ -49,7 +49,6 @@ public final class ActivityLogResource implements ActivityLogEndpoint {
entry.setAccountId(accountId);
entry.setClientId(clientId);
entry.setDuration(duration);
- entry.setGuid(entryId);
entry.setMessageArgs(messageArgs);
entry.setParentId(parentId);
entry.setServerId(serverId);
@@ -67,8 +66,7 @@ public final class ActivityLogResource implements ActivityLogEndpoint {
@Override
public ActivityEntryId createEntry(Long typeId, Long parentId, Integer status, String message) {
Long entryId = activityLog.createEntry(typeId, parentId, status, message);
- ActivityEntryId entity = new ActivityEntryId();
- entity.setGuid(entryId);
+ ActivityEntryId entity = new ActivityEntryId(entryId);
return entity;
}
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseId.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseId.java
index 70389af20f6..0956160b318 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseId.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseId.java
@@ -11,13 +11,18 @@
package org.eclipse.osee.framework.jdk.core.type;
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.annotate.JsonValue;
+
/**
* @author Ryan D. Brooks
*/
public class BaseId implements Id, Cloneable {
private Long id;
- public BaseId(Long id) {
+ @JsonCreator
+ public BaseId(@JsonProperty("id") Long id) {
this.id = id;
}
@@ -45,6 +50,7 @@ public class BaseId implements Id, Cloneable {
return String.valueOf(id);
}
+ @JsonValue
@Override
public Long getId() {
return id;
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ActivityLogJaxRsService.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ActivityLogJaxRsService.java
index f02a83906c0..cbf81eefa67 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ActivityLogJaxRsService.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ActivityLogJaxRsService.java
@@ -55,7 +55,7 @@ public class ActivityLogJaxRsService {
public static void update(ActivityEntryId entryId, Integer statusId) {
ActivityLogEndpoint activityEp = get();
if (activityEp != null) {
- activityEp.updateEntry(entryId.getGuid(), statusId);
+ activityEp.updateEntry(entryId.getId(), statusId);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/ActivityLogJaxRsService.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/ActivityLogJaxRsService.java
index 8c14704336c..023e308683a 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/ActivityLogJaxRsService.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/ActivityLogJaxRsService.java
@@ -55,7 +55,7 @@ public class ActivityLogJaxRsService {
public static void update(ActivityEntryId entryId, Integer statusId) {
ActivityLogEndpoint activityEp = get();
if (activityEp != null) {
- activityEp.updateEntry(entryId.getGuid(), statusId);
+ activityEp.updateEntry(entryId.getId(), statusId);
}
}

Back to the top