Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-06-07 00:07:57 -0400
committerRoberto E. Escobar2014-06-18 16:17:47 -0400
commitab5a36cc2784a25d838d4761e740f0925b24bd17 (patch)
tree04215a52e3add3dc36e948f08fb137c1005a667f /plugins/org.eclipse.osee.account.rest.model
parent3f0b3f1feb61e00cf2100396b233f6b819d883ee (diff)
downloadorg.eclipse.osee-ab5a36cc2784a25d838d4761e740f0925b24bd17.tar.gz
org.eclipse.osee-ab5a36cc2784a25d838d4761e740f0925b24bd17.tar.xz
org.eclipse.osee-ab5a36cc2784a25d838d4761e740f0925b24bd17.zip
feature[ats_ATS64153]: Create Account Subscriptions REST API
Diffstat (limited to 'plugins/org.eclipse.osee.account.rest.model')
-rw-r--r--plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionData.java97
-rw-r--r--plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupData.java88
2 files changed, 185 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionData.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionData.java
new file mode 100644
index 0000000000..ed9e27ab2b
--- /dev/null
+++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionData.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.account.rest.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import org.eclipse.osee.framework.jdk.core.type.Identifiable;
+import org.eclipse.osee.framework.jdk.core.type.Identity;
+
+/**
+ * @author Roberto E. Escobar
+ */
+@XmlRootElement
+public class SubscriptionData implements Identifiable<String> {
+
+ private String uuid;
+ private String name;
+ private boolean isActive;
+ private String accountName;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getGuid() {
+ return uuid;
+ }
+
+ public void setGuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public boolean isActive() {
+ return isActive;
+ }
+
+ public void setActive(boolean isActive) {
+ this.isActive = isActive;
+ }
+
+ public String getAccountName() {
+ return accountName;
+ }
+
+ public void setAccountName(String accountName) {
+ this.accountName = accountName;
+ }
+
+ @Override
+ public int hashCode() {
+ return getGuid().hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ boolean equal = false;
+ if (obj instanceof Identity) {
+ @SuppressWarnings("unchecked")
+ Identity<String> identity = (Identity<String>) obj;
+ if (getGuid() == identity.getGuid()) {
+ equal = true;
+ } else if (getGuid() != null) {
+ equal = getGuid().equals(identity.getGuid());
+ }
+ }
+ return equal;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(getGuid());
+ }
+
+ @Override
+ public boolean matches(Identity<?>... identities) {
+ for (Identity<?> identity : identities) {
+ if (equals(identity)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupData.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupData.java
new file mode 100644
index 0000000000..d1e160b3ea
--- /dev/null
+++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupData.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.account.rest.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import org.eclipse.osee.framework.jdk.core.type.Identifiable;
+import org.eclipse.osee.framework.jdk.core.type.Identity;
+
+/**
+ * @author Roberto E. Escobar
+ */
+@XmlRootElement
+public class SubscriptionGroupData implements Identifiable<String> {
+
+ private String uuid;
+ private String name;
+ private long id;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getGuid() {
+ return uuid;
+ }
+
+ public void setGuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ @Override
+ public int hashCode() {
+ return getGuid().hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ boolean equal = false;
+ if (obj instanceof Identity) {
+ @SuppressWarnings("unchecked")
+ Identity<String> identity = (Identity<String>) obj;
+ if (getGuid() == identity.getGuid()) {
+ equal = true;
+ } else if (getGuid() != null) {
+ equal = getGuid().equals(identity.getGuid());
+ }
+ }
+ return equal;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(getGuid());
+ }
+
+ @Override
+ public boolean matches(Identity<?>... identities) {
+ for (Identity<?> identity : identities) {
+ if (equals(identity)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}

Back to the top