diff options
Diffstat (limited to 'plugins/org.eclipse.osee.account.rest.model')
15 files changed, 686 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.account.rest.model/.classpath b/plugins/org.eclipse.osee.account.rest.model/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.osee.account.rest.model/.project b/plugins/org.eclipse.osee.account.rest.model/.project new file mode 100644 index 00000000000..ec36c4c7265 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.osee.account.rest.model</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/org.eclipse.osee.account.rest.model/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.account.rest.model/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..4a6f6b83233 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: OSEE Account REST Model (Incubation) +Bundle-SymbolicName: org.eclipse.osee.account.rest.model +Bundle-Version: 0.17.0.qualifier +Bundle-Vendor: Eclipse Open System Engineering Environment +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Export-Package: org.eclipse.osee.account.rest.model +Import-Package: org.eclipse.osee.framework.jdk.core.type diff --git a/plugins/org.eclipse.osee.account.rest.model/build.properties b/plugins/org.eclipse.osee.account.rest.model/build.properties new file mode 100644 index 00000000000..34d2e4d2dad --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/plugins/org.eclipse.osee.account.rest.model/pom.xml b/plugins/org.eclipse.osee.account.rest.model/pom.xml new file mode 100644 index 00000000000..2aee7bde9a0 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/pom.xml @@ -0,0 +1,34 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.eclipse.osee</groupId> + <artifactId>org.eclipse.osee.x.core.parent</artifactId> + <version>0.17.0-SNAPSHOT</version> + <relativePath>../../plugins/org.eclipse.osee.x.core.parent</relativePath> + </parent> + + <artifactId>org.eclipse.osee.account.rest.model</artifactId> + <packaging>eclipse-plugin</packaging> + <name>OSEE Account REST Model - (Incubation)</name> + + <build> + <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 --> + <resources> + <resource> + <directory>src</directory> + <excludes> + <exclude>**/*.java</exclude> + </excludes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-source-plugin</artifactId> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountAccessData.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountAccessData.java new file mode 100644 index 00000000000..8d3198945d6 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountAccessData.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * 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 java.util.Date; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @author Roberto E. Escobar + */ +@XmlRootElement +public class AccountAccessData { + + private long accountId; + private Date createdOn; + private Date lastAccessedOn; + private String accessedFrom; + private String accessDetails; + + public long getAccountId() { + return accountId; + } + + public void setAccountId(long accountId) { + this.accountId = accountId; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public Date getLastAccessedOn() { + return lastAccessedOn; + } + + public void setLastAccessedOn(Date lastAccessedOn) { + this.lastAccessedOn = lastAccessedOn; + } + + public String getAccessedFrom() { + return accessedFrom; + } + + public void setAccessedFrom(String accessedFrom) { + this.accessedFrom = accessedFrom; + } + + public String getAccessDetails() { + return accessDetails; + } + + public void setAccessDetails(String accessDetails) { + this.accessDetails = accessDetails; + } + +} diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountActiveData.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountActiveData.java new file mode 100644 index 00000000000..204744b0522 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountActiveData.java @@ -0,0 +1,85 @@ +/******************************************************************************* + * 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.Identity; + +/** + * @author Roberto E. Escobar + */ +@XmlRootElement +public class AccountActiveData implements Identity<String> { + + private long accountId; + private boolean isActive; + private String uuid; + + public long getAccountId() { + return accountId; + } + + public void setAccountId(long accountId) { + this.accountId = accountId; + } + + public boolean isActive() { + return isActive; + } + + public void setActive(boolean isActive) { + this.isActive = isActive; + } + + @Override + public String getGuid() { + return uuid; + } + + public void setGuid(String uuid) { + this.uuid = uuid; + } + + @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/AccountContexts.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountContexts.java new file mode 100644 index 00000000000..e97a0e31962 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountContexts.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * 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; + +/** + * @author Roberto E. Escobar + */ +public final class AccountContexts { + + private AccountContexts() { + // Constants Class + } + + public static final String ACCOUNTS_BASE = "oseex"; + public static final String ACCOUNTS = "accounts"; + public static final String ACCOUNT_PREFERENCES = "preferences"; + public static final String ACCOUNT_ACTIVE = "active"; + + public static final String ACCOUNT_ID_PARAM = "account-id"; + public static final String ACCOUNT_ID_TEMPLATE = "{" + ACCOUNT_ID_PARAM + "}"; + + public static final String ACCOUNT_USERNAME = "username"; + public static final String ACCOUNT_USERNAME_TEMPLATE = "{" + ACCOUNT_USERNAME + "}"; + + public static final String ACCOUNT_LOGIN = "login"; + public static final String ACCOUNT_SESSSIONS = "sessions"; + + public static final String ACCOUNT_LOGOUT = "logout"; + +} diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountDetailsData.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountDetailsData.java new file mode 100644 index 00000000000..814ed30021a --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountDetailsData.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * 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; + +/** + * @author Roberto E. Escobar + */ +@XmlRootElement +public class AccountDetailsData extends AccountInfoData { + + private AccountPreferencesData preferences; + + public void setPreferences(AccountPreferencesData preferences) { + this.preferences = preferences; + } + + public AccountPreferencesData getPreferences() { + if (preferences == null) { + preferences = new AccountPreferencesData(); + } + return preferences; + } + +} diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountInfoData.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountInfoData.java new file mode 100644 index 00000000000..072b3688125 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountInfoData.java @@ -0,0 +1,113 @@ +/******************************************************************************* + * 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.Identity; + +/** + * @author Roberto E. Escobar + */ +@XmlRootElement +public class AccountInfoData implements Identity<String> { + + private String name; + private String userName; + private String email; + private String uuid; + private long accountId; + private boolean isActive; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public long getAccountId() { + return accountId; + } + + public void setAccountId(long accountId) { + this.accountId = accountId; + } + + public boolean isActive() { + return isActive; + } + + public void setActive(boolean isActive) { + this.isActive = isActive; + } + + @Override + public String getGuid() { + return uuid; + } + + public void setGuid(String uuid) { + this.uuid = uuid; + } + + @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/AccountInput.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountInput.java new file mode 100644 index 00000000000..604df783997 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountInput.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * 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 java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @author Roberto E. Escobar + */ +@XmlRootElement +public class AccountInput { + + private String name; + private String email; + private boolean active; + private Map<String, String> preferences; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public boolean isActive() { + return active; + } + + public void setActive(boolean active) { + this.active = active; + } + + public Map<String, String> getPreferences() { + if (preferences == null) { + preferences = new HashMap<String, String>(); + } + return preferences; + } + + public void setPreferences(Map<String, String> preferences) { + this.preferences = preferences; + } +} diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountLoginData.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountLoginData.java new file mode 100644 index 00000000000..93d9bd5760a --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountLoginData.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * 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; + +/** + * @author Roberto E. Escobar + */ +@XmlRootElement +public class AccountLoginData { + + private String username; + private String password; + private String scheme; + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountPreferencesData.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountPreferencesData.java new file mode 100644 index 00000000000..f8c4c5db943 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountPreferencesData.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * 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 java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @author Roberto E. Escobar + */ +@XmlRootElement +public class AccountPreferencesData { + + private long id; + private Map<String, String> preferences; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public Map<String, String> getMap() { + if (preferences == null) { + preferences = new HashMap<String, String>(); + } + return preferences; + } + + public void setMap(Map<String, String> preferences) { + this.preferences = preferences; + } + +} diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountPreferencesInput.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountPreferencesInput.java new file mode 100644 index 00000000000..442cd5977b1 --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountPreferencesInput.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * 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 java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @author Roberto E. Escobar + */ +@XmlRootElement +public class AccountPreferencesInput { + + private Map<String, String> preferences; + + public Map<String, String> getMap() { + if (preferences == null) { + preferences = new HashMap<String, String>(); + } + return preferences; + } + + public void setMap(Map<String, String> preferences) { + this.preferences = preferences; + } + +} diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountSessionData.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountSessionData.java new file mode 100644 index 00000000000..43b63c8c90c --- /dev/null +++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/AccountSessionData.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * 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; + +/** + * @author Roberto E. Escobar + */ +@XmlRootElement +public class AccountSessionData { + + private long accountId; + private String token; + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public long getAccountId() { + return accountId; + } + + public void setAccountId(long accountId) { + this.accountId = accountId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (int) (accountId ^ (accountId >>> 32)); + result = prime * result + ((token == null) ? 0 : token.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; + } + AccountSessionData other = (AccountSessionData) obj; + if (accountId != other.accountId) { + return false; + } + if (token == null) { + if (other.token != null) { + return false; + } + } else if (!token.equals(other.token)) { + return false; + } + return true; + } + +} |