Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2017-04-27 14:32:34 -0400
committerMegumi Telles2017-05-03 10:07:40 -0400
commit07dbd59edb4ddab8bf27a5835be95c085df4e1fd (patch)
tree7253f410a833df3c3808dc3788ff74956c1bf741
parenta2065c6f7be563f9a6a78e853c22411bcf5290f4 (diff)
downloadorg.eclipse.osee-fix_tests.tar.gz
org.eclipse.osee-fix_tests.tar.xz
org.eclipse.osee-fix_tests.zip
refactor: Remove TokenFactory.createUserTokenfix_tests
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java4
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsUserServiceClient.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AtsUser.java4
-rw-r--r--plugins/org.eclipse.osee.ats.demo.api/src/org/eclipse/osee/ats/demo/api/DemoUsers.java17
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java6
-rw-r--r--plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddDemoUsers.java4
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/UserManagerTest.java4
-rw-r--r--plugins/org.eclipse.osee.framework.authentication.ldap.core/src/org/eclipse/osee/framework/authentication/ldap/core/LDAPAuthenticationProvider.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/ClientSessionManager.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/AbstractAuthenticationProvider.java12
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationProvider.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/DemoAuthenticationProvider.java31
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/TrustAllAuthenticationProvider.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IUserToken.java30
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java74
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/UserToken.java101
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/SystemUser.java14
-rw-r--r--plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/AddCommonBranch.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserAdmin.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/CurrentUserProvider.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserAdminImpl.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserDataWriter.java6
30 files changed, 195 insertions, 200 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java
index bb98967b44..a0f206b2f7 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java
@@ -15,7 +15,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.ats.core.client.util.AtsGroup;
import org.eclipse.osee.ats.demo.api.DemoUsers;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.database.init.IDbInitializationTask;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.SystemGroup;
@@ -34,7 +34,7 @@ public class AtsConfigAddDemoUsers implements IDbInitializationTask {
List<User> admins = new ArrayList<>();
SkynetTransaction transaction = TransactionManager.createTransaction(COMMON, "Add Dev Users");
- for (IUserToken userEnum : DemoUsers.values()) {
+ for (UserToken userEnum : DemoUsers.values()) {
User user = UserManager.createUser(userEnum, transaction);
if (userEnum.isAdmin()) {
admins.add(user);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java
index 41162b920f..335a526807 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java
@@ -44,7 +44,7 @@ import org.eclipse.osee.ats.demo.api.DemoTeam;
import org.eclipse.osee.ats.demo.api.DemoWorkType;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.exception.OseeAuthenticationException;
@@ -93,7 +93,7 @@ public class DemoTestUtil {
return getTaskTitles(false).size() + getTaskTitles(true).size();
}
- public static User getDemoUser(IUserToken demoUser) throws OseeCoreException {
+ public static User getDemoUser(UserToken demoUser) throws OseeCoreException {
return UserManager.getUserByName(demoUser.getName());
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsUserServiceClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsUserServiceClient.java
index 811610a2de..53ace0c727 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsUserServiceClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsUserServiceClient.java
@@ -15,7 +15,7 @@ import java.util.List;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.user.IAtsUserService;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
@@ -40,7 +40,7 @@ public interface IAtsUserServiceClient extends IAtsUserService {
Collection<User> getOseeUsers(Collection<? extends IAtsUser> users) throws OseeCoreException;
- IAtsUser getUserFromToken(IUserToken userToken);
+ IAtsUser getUserFromToken(UserToken userToken);
List<User> getOseeUsersSorted(Active active);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java
index 58b5230024..9d2d07c127 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUserService.java
@@ -20,7 +20,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.user.IAtsUserService;
import org.eclipse.osee.ats.api.util.AtsUserNameComparator;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -131,7 +131,7 @@ public abstract class AbstractAtsUserService implements IAtsUserService {
return users;
}
- public IAtsUser getUserFromToken(IUserToken userToken) {
+ public IAtsUser getUserFromToken(UserToken userToken) {
return getUserById(userToken.getUserId());
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AtsUser.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AtsUser.java
index 4ebe430cc9..2bb6221630 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AtsUser.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AtsUser.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.ats.core.users;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.jdk.core.type.NamedIdBase;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -25,7 +25,7 @@ public class AtsUser extends NamedIdBase implements IAtsUser {
private String userId;
- public AtsUser(IUserToken user) {
+ public AtsUser(UserToken user) {
this(user.getId(), user.getName(), user.getUserId());
}
diff --git a/plugins/org.eclipse.osee.ats.demo.api/src/org/eclipse/osee/ats/demo/api/DemoUsers.java b/plugins/org.eclipse.osee.ats.demo.api/src/org/eclipse/osee/ats/demo/api/DemoUsers.java
index 12bb0ae462..ae82261348 100644
--- a/plugins/org.eclipse.osee.ats.demo.api/src/org/eclipse/osee/ats/demo/api/DemoUsers.java
+++ b/plugins/org.eclipse.osee.ats.demo.api/src/org/eclipse/osee/ats/demo/api/DemoUsers.java
@@ -12,8 +12,7 @@ package org.eclipse.osee.ats.demo.api;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.osee.framework.core.data.IUserToken;
-import org.eclipse.osee.framework.core.data.TokenFactory;
+import org.eclipse.osee.framework.core.data.UserToken;
/**
* @author Donald G. Dunne
@@ -21,19 +20,19 @@ import org.eclipse.osee.framework.core.data.TokenFactory;
public final class DemoUsers {
// @formatter:off
- public static final IUserToken Joe_Smith = TokenFactory.createUserToken(61106791L, "ABNRvbZxXHICYklfslwA", "Joe Smith", "", "3333", true, false, false);
- public static final IUserToken Kay_Jones = TokenFactory.createUserToken(5896672L, "ABNRvuB8x3VARkkn3YAA", "Kay Jones", "", "4444", true, false, false);
- public static final IUserToken Jason_Michael = TokenFactory.createUserToken(277990, "ABNRvuHWtXAdxbG3mUAA", "Jason Michael", "", "5555", true, false, false);
- public static final IUserToken Alex_Kay = TokenFactory.createUserToken(8006939L, "ABNRvuKDIWOcPDe4X0wA", "Alex Kay", "", "6666", true, false, false);
- public static final IUserToken Inactive_Steve = TokenFactory.createUserToken(5808093, "ABNRvuRG6jKwKnEoX4gA", "Inactive Steve", "", "7777", false, false, false);
- public static List<IUserToken> values = Arrays.asList(Joe_Smith, Kay_Jones, Jason_Michael, Alex_Kay, Inactive_Steve);
+ public static final UserToken Joe_Smith = UserToken.create(61106791L, "ABNRvbZxXHICYklfslwA", "Joe Smith", "", "3333", true, false, false);
+ public static final UserToken Kay_Jones = UserToken.create(5896672L, "ABNRvuB8x3VARkkn3YAA", "Kay Jones", "", "4444", true, false, false);
+ public static final UserToken Jason_Michael = UserToken.create(277990, "ABNRvuHWtXAdxbG3mUAA", "Jason Michael", "", "5555", true, false, false);
+ public static final UserToken Alex_Kay = UserToken.create(8006939L, "ABNRvuKDIWOcPDe4X0wA", "Alex Kay", "", "6666", true, false, false);
+ public static final UserToken Inactive_Steve = UserToken.create(5808093, "ABNRvuRG6jKwKnEoX4gA", "Inactive Steve", "", "7777", false, false, false);
+ public static List<UserToken> values = Arrays.asList(Joe_Smith, Kay_Jones, Jason_Michael, Alex_Kay, Inactive_Steve);
// @formatter:on
private DemoUsers() {
// Constants
}
- public static List<IUserToken> values() {
+ public static List<UserToken> values() {
return values;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
index 6962466a37..0850951c04 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
@@ -37,7 +37,7 @@ import org.eclipse.osee.ats.dsl.atsDsl.UserRef;
import org.eclipse.osee.ats.dsl.atsDsl.VersionDef;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -107,8 +107,8 @@ public class ImportAIsAndTeamDefinitionsToDb {
}
}
- private IUserToken getOseeUser(final UserDef dslUserDef) {
- return TokenFactory.createUserToken(Lib.generateArtifactIdAsInt(), GUID.create(),
+ private UserToken getOseeUser(final UserDef dslUserDef) {
+ return UserToken.create(Lib.generateArtifactIdAsInt(), GUID.create(),
Strings.unquote(dslUserDef.getName()),
Strings.isValid(dslUserDef.getEmail()) ? dslUserDef.getEmail() : Strings.unquote(dslUserDef.getName()),
Strings.isValid(dslUserDef.getUserId()) ? dslUserDef.getUserId() : Strings.unquote(dslUserDef.getName()),
diff --git a/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddDemoUsers.java b/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddDemoUsers.java
index 2b17ee0b9d..51eb6a1be3 100644
--- a/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddDemoUsers.java
+++ b/plugins/org.eclipse.osee.client.demo/src/org/eclipse/osee/client/demo/internal/AddDemoUsers.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.client.demo.internal;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.ats.demo.api.DemoUsers;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.database.init.IDbInitializationTask;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -33,7 +33,7 @@ public class AddDemoUsers implements IDbInitializationTask {
List<User> admins = new ArrayList<>();
SkynetTransaction transaction = TransactionManager.createTransaction(CoreBranches.COMMON, "Add Dev Users");
- for (IUserToken userEnum : DemoUsers.values()) {
+ for (UserToken userEnum : DemoUsers.values()) {
User user = UserManager.createUser(userEnum, transaction);
if (userEnum.isAdmin()) {
admins.add(user);
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/UserManagerTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/UserManagerTest.java
index 5374a1cbcf..fde73da8d8 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/UserManagerTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/UserManagerTest.java
@@ -17,7 +17,7 @@ import java.util.Set;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -98,7 +98,7 @@ public final class UserManagerTest {
}
private User createUser(SkynetTransaction transaction, int index) throws OseeCoreException {
- IUserToken token = TokenFactory.createUserToken(Lib.generateArtifactIdAsInt(), GUID.create(),
+ UserToken token = UserToken.create(Lib.generateArtifactIdAsInt(), GUID.create(),
NEW_USER_NAMES[index], "this" + index + "@that.com", "9999999" + index, true, index % 2 == 0, true);
User user = UserManager.createUser(token, transaction);
user.persist(transaction);
diff --git a/plugins/org.eclipse.osee.framework.authentication.ldap.core/src/org/eclipse/osee/framework/authentication/ldap/core/LDAPAuthenticationProvider.java b/plugins/org.eclipse.osee.framework.authentication.ldap.core/src/org/eclipse/osee/framework/authentication/ldap/core/LDAPAuthenticationProvider.java
index 631aac4b15..b1f90fca6d 100644
--- a/plugins/org.eclipse.osee.framework.authentication.ldap.core/src/org/eclipse/osee/framework/authentication/ldap/core/LDAPAuthenticationProvider.java
+++ b/plugins/org.eclipse.osee.framework.authentication.ldap.core/src/org/eclipse/osee/framework/authentication/ldap/core/LDAPAuthenticationProvider.java
@@ -11,7 +11,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.osee.framework.authentication.ldap.core.internal.LDAPConnector;
import org.eclipse.osee.framework.authentication.ldap.core.service.ILDAPService;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.OseeCredential;
import org.eclipse.osee.framework.core.server.AbstractAuthenticationProvider;
import org.osgi.framework.Bundle;
@@ -46,9 +46,9 @@ public class LDAPAuthenticationProvider extends AbstractAuthenticationProvider {
* @return Returns IUserToken created for the given OSeeCrendtial.
*/
@Override
- public IUserToken asOseeUserId(final OseeCredential credential) {
+ public UserToken asOseeUserId(final OseeCredential credential) {
String userName = credential.getUserName();
- IUserToken userToken = getUserTokenFromOseeDb(userName);
+ UserToken userToken = getUserTokenFromOseeDb(userName);
return userToken != null ? userToken : createUserToken(true, userName, userName, "", true);
}
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/ClientSessionManager.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/ClientSessionManager.java
index 4051e2819d..c098654e75 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/ClientSessionManager.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/ClientSessionManager.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.framework.core.client;
import java.util.List;
import java.util.Properties;
import org.eclipse.osee.framework.core.client.internal.InternalClientSessionManager;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.IdeClientSession;
import org.eclipse.osee.framework.core.data.OseeSessionGrant;
import org.eclipse.osee.framework.core.exception.OseeAuthenticationRequiredException;
@@ -56,7 +56,7 @@ public class ClientSessionManager {
getSessionGrant().setCreationRequired(false);
}
- public static IUserToken getCurrentUserToken() throws OseeAuthenticationRequiredException {
+ public static UserToken getCurrentUserToken() throws OseeAuthenticationRequiredException {
return getSessionGrant().getUserToken();
}
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/AbstractAuthenticationProvider.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/AbstractAuthenticationProvider.java
index 50cd62e815..3a96093335 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/AbstractAuthenticationProvider.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/AbstractAuthenticationProvider.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.server;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -48,8 +48,8 @@ public abstract class AbstractAuthenticationProvider implements IAuthenticationP
return orcsApi;
}
- protected IUserToken getUserTokenFromOseeDb(String userId) {
- IUserToken toReturn = null;
+ protected UserToken getUserTokenFromOseeDb(String userId) {
+ UserToken toReturn = null;
try {
QueryFactory queryFactory = orcsApi.getQueryFactory();
QueryBuilder query = queryFactory.fromBranch(CoreBranches.COMMON).andIsOfType(CoreArtifactTypes.User).and(
@@ -57,7 +57,7 @@ public abstract class AbstractAuthenticationProvider implements IAuthenticationP
ArtifactReadable artifact = query.getResults().getOneOrNull();
if (artifact != null) {
- toReturn = TokenFactory.createUserToken(artifact.getUuid(), artifact.getGuid(), artifact.getName(),
+ toReturn = UserToken.create(artifact.getUuid(), artifact.getGuid(), artifact.getName(),
artifact.getSoleAttributeAsString(CoreAttributeTypes.Email, ""), userId, true, false, false);
} else {
getLogger().info("Unable to find userId:[%s] on [%s]", userId, CoreBranches.COMMON);
@@ -68,8 +68,8 @@ public abstract class AbstractAuthenticationProvider implements IAuthenticationP
return toReturn;
}
- protected IUserToken createUserToken(boolean isCreationRequired, String userName, String userId, String userEmail, boolean isActive) {
- return TokenFactory.createUserToken(Lib.generateArtifactIdAsInt(), GUID.create(), userName, userEmail, userId,
+ protected UserToken createUserToken(boolean isCreationRequired, String userName, String userId, String userEmail, boolean isActive) {
+ return UserToken.create(Lib.generateArtifactIdAsInt(), GUID.create(), userName, userEmail, userId,
isActive, false, isCreationRequired);
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java
index 3c616048a2..a6fd4a5a9b 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.server;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.OseeCredential;
import org.eclipse.osee.framework.core.exception.OseeAuthenticationException;
@@ -29,7 +29,7 @@ public interface IAuthenticationManager {
*
* @return OSEE user info
*/
- public IUserToken asUserToken(OseeCredential credential) throws OseeAuthenticationException;
+ public UserToken asUserToken(OseeCredential credential) throws OseeAuthenticationException;
/**
* Gets an array of available authentication protocols
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationProvider.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationProvider.java
index 277a5a635c..d03276654a 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationProvider.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationProvider.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.server;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.OseeCredential;
import org.eclipse.osee.framework.core.exception.OseeAuthenticationException;
@@ -23,6 +23,6 @@ public interface IAuthenticationProvider {
public boolean authenticate(OseeCredential credential) throws OseeAuthenticationException;
- public IUserToken asOseeUserId(OseeCredential credential) throws OseeAuthenticationException;
+ public UserToken asOseeUserId(OseeCredential credential) throws OseeAuthenticationException;
}
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java
index 3d9e81274f..de84324b3e 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.framework.core.server.internal;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.OseeCredential;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.exception.OseeAuthenticationException;
@@ -60,8 +60,8 @@ public class AuthenticationManager implements IAuthenticationManager {
}
@Override
- public IUserToken asUserToken(OseeCredential credential) throws OseeAuthenticationException {
- IUserToken toReturn = null;
+ public UserToken asUserToken(OseeCredential credential) throws OseeAuthenticationException {
+ UserToken toReturn = null;
if (isGuestLogin(credential)) {
toReturn = SystemUser.Anonymous;
} else if (isBootStrap(credential)) {
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/DemoAuthenticationProvider.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/DemoAuthenticationProvider.java
index 83efd5481d..f393eb7fd5 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/DemoAuthenticationProvider.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/DemoAuthenticationProvider.java
@@ -12,9 +12,8 @@ package org.eclipse.osee.framework.core.server.internal.authentication;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.OseeCredential;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.server.AbstractAuthenticationProvider;
/**
@@ -23,23 +22,23 @@ import org.eclipse.osee.framework.core.server.AbstractAuthenticationProvider;
public class DemoAuthenticationProvider extends AbstractAuthenticationProvider {
private final boolean autoAuthenticate = true;
- public static final IUserToken Joe_Smith =
- TokenFactory.createUserToken(61106791L, "ABNRvbZxXHICYklfslwA", "Joe Smith", "", "3333", true, false, false);
- public static final IUserToken Kay_Jones =
- TokenFactory.createUserToken(5896672L, "ABNRvuB8x3VARkkn3YAA", "Kay Jones", "", "4444", true, false, false);
- public static final IUserToken Jason_Michael =
- TokenFactory.createUserToken(277990, "ABNRvuHWtXAdxbG3mUAA", "Jason Michael", "", "5555", true, false, false);
- public static final IUserToken Alex_Kay =
- TokenFactory.createUserToken(8006939L, "ABNRvuKDIWOcPDe4X0wA", "Alex Kay", "", "6666", true, false, false);
- public static final IUserToken Inactive_Steve =
- TokenFactory.createUserToken(5808093, "ABNRvuRG6jKwKnEoX4gA", "Inactive Steve", "", "7777", false, false, false);
- public static List<IUserToken> values = Arrays.asList(Joe_Smith, Kay_Jones, Jason_Michael, Alex_Kay, Inactive_Steve);
+ public static final UserToken Joe_Smith =
+ UserToken.create(61106791L, "ABNRvbZxXHICYklfslwA", "Joe Smith", "", "3333", true, false, false);
+ public static final UserToken Kay_Jones =
+ UserToken.create(5896672L, "ABNRvuB8x3VARkkn3YAA", "Kay Jones", "", "4444", true, false, false);
+ public static final UserToken Jason_Michael =
+ UserToken.create(277990, "ABNRvuHWtXAdxbG3mUAA", "Jason Michael", "", "5555", true, false, false);
+ public static final UserToken Alex_Kay =
+ UserToken.create(8006939L, "ABNRvuKDIWOcPDe4X0wA", "Alex Kay", "", "6666", true, false, false);
+ public static final UserToken Inactive_Steve =
+ UserToken.create(5808093, "ABNRvuRG6jKwKnEoX4gA", "Inactive Steve", "", "7777", false, false, false);
+ public static List<UserToken> values = Arrays.asList(Joe_Smith, Kay_Jones, Jason_Michael, Alex_Kay, Inactive_Steve);
@Override
- public IUserToken asOseeUserId(OseeCredential credential) {
- for (IUserToken token : values) {
+ public UserToken asOseeUserId(OseeCredential credential) {
+ for (UserToken token : values) {
if (credential.getUserName().equals(token.getName().toLowerCase())) {
- IUserToken userToken = getUserTokenFromOseeDb(token.getName());
+ UserToken userToken = getUserTokenFromOseeDb(token.getName());
if (userToken != null) {
return userToken;
} else {
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/TrustAllAuthenticationProvider.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/TrustAllAuthenticationProvider.java
index 2168e4c7dd..5423f4a8e3 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/TrustAllAuthenticationProvider.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/authentication/TrustAllAuthenticationProvider.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.server.internal.authentication;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.OseeCredential;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.server.AbstractAuthenticationProvider;
@@ -32,8 +32,8 @@ public class TrustAllAuthenticationProvider extends AbstractAuthenticationProvid
}
@Override
- public IUserToken asOseeUserId(OseeCredential credential) {
- IUserToken userToken = SystemUser.Anonymous;
+ public UserToken asOseeUserId(OseeCredential credential) {
+ UserToken userToken = SystemUser.Anonymous;
String userName = credential.getUserName();
if (Strings.isValid(userName)) {
userToken = getUserTokenFromOseeDb(userName);
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java
index aefd91ede7..df6a75d63d 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.framework.core.server.internal.session;
import java.util.Date;
import java.util.Properties;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.OseeSessionGrant;
import org.eclipse.osee.framework.core.model.cache.IOseeTypeFactory;
import org.eclipse.osee.framework.core.server.OseeServerProperties;
@@ -47,7 +47,7 @@ public final class SessionFactory implements IOseeTypeFactory {
return toReturn;
}
- public OseeSessionGrant createSessionGrant(Session session, IUserToken userToken, String authenticationType) throws OseeCoreException {
+ public OseeSessionGrant createSessionGrant(Session session, UserToken userToken, String authenticationType) throws OseeCoreException {
Conditions.checkNotNull(session, "Session");
Conditions.checkNotNull(userToken, "IUserToken");
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java
index 1277498f45..5af26d6200 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java
@@ -18,7 +18,7 @@ import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Callable;
import org.eclipse.osee.cache.admin.Cache;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.OseeCredential;
import org.eclipse.osee.framework.core.data.OseeSessionGrant;
import org.eclipse.osee.framework.core.enums.SystemUser;
@@ -54,7 +54,7 @@ public final class SessionManagerImpl implements ISessionManager {
final String newSessionId = GUID.create();
boolean isAuthenticated = authenticationManager.authenticate(credential);
if (isAuthenticated) {
- final IUserToken userToken = authenticationManager.asUserToken(credential);
+ final UserToken userToken = authenticationManager.asUserToken(credential);
Callable<Session> callable = new Callable<Session>() {
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IUserToken.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IUserToken.java
deleted file mode 100644
index a7ac6d6171..0000000000
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IUserToken.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.framework.core.data;
-
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Donald G. Dunne
- */
-public interface IUserToken extends ArtifactToken {
-
- public String getUserId() throws OseeCoreException;
-
- public boolean isActive() throws OseeCoreException;
-
- public boolean isAdmin() throws OseeCoreException;
-
- public String getEmail() throws OseeCoreException;
-
- public boolean isCreationRequired();
-
-}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java
index 9af1c1c10f..e00ac7842a 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java
@@ -77,7 +77,7 @@ public class OseeSessionGrant {
return oseeApplicationServerDataPath;
}
- public IUserToken getUserToken() {
+ public UserToken getUserToken() {
return getGrantedUserToken();
}
@@ -89,8 +89,8 @@ public class OseeSessionGrant {
this.oseeAuthenticationProtocol = protocol;
}
- private IUserToken getGrantedUserToken() {
- return TokenFactory.createUserToken(Lib.generateArtifactIdAsInt(), GUID.create(), oseeUserName, oseeUserEmail,
+ private UserToken getGrantedUserToken() {
+ return UserToken.create(Lib.generateArtifactIdAsInt(), GUID.create(), oseeUserName, oseeUserEmail,
oseeUserId, isOseeUserActive, false, false);
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java
index 545706263c..e196b18ce5 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java
@@ -12,11 +12,8 @@ package org.eclipse.osee.framework.core.data;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.jdk.core.type.NamedIdBase;
import org.eclipse.osee.framework.jdk.core.type.NamedIdentity;
-import org.eclipse.osee.framework.jdk.core.util.Conditions;
public final class TokenFactory {
@@ -55,11 +52,6 @@ public final class TokenFactory {
return ArtifactToken.valueOf(id, guid, name, BranchId.SENTINEL, artifactType);
}
- public static IUserToken createUserToken(long uuid, String guid, String name, String email, String userId, boolean active, boolean admin, boolean creationRequired) {
- Conditions.checkExpressionFailOnTrue(uuid <= 0, "User Token Uuid must be > 0 for userId [%s]", userId);
- return new UserToken(uuid, guid, name, userId, active, admin, email, creationRequired);
- }
-
private final static class ArtifactTypeToken extends NamedIdBase implements IArtifactType {
public ArtifactTypeToken(Long id, String name) {
super(id, name);
@@ -71,72 +63,6 @@ public final class TokenFactory {
}
}
- private static class UserToken extends NamedIdBase implements IUserToken {
- private final String userId;
- private final boolean active;
- private final boolean admin;
- private final String email;
- private final String guid;
- private final boolean creationRequired;
-
- public UserToken(long id, String guid, String name, String userId, boolean active, boolean admin, String email, boolean creationRequired) {
- super(id, name);
- this.guid = guid;
- this.userId = userId;
- this.active = active;
- this.admin = admin;
- this.email = email;
- this.creationRequired = creationRequired;
- }
-
- @Override
- public IArtifactType getArtifactType() {
- return CoreArtifactTypes.User;
- }
-
- @Override
- public String getUserId() {
- return userId;
- }
-
- @Override
- public boolean isActive() {
- return active;
- }
-
- @Override
- public boolean isAdmin() {
- return admin;
- }
-
- @Override
- public String getEmail() {
- return email;
- }
-
- @Override
- public boolean isCreationRequired() {
- return creationRequired;
- }
-
- @Override
- public String toString() {
- return String.format(
- "UserToken [name [%s], userId=[%s], active=[%s], admin=[%s], email=[%s], creationRequired=[%s]", getName(),
- userId, active, admin, email, creationRequired);
- }
-
- @Override
- public String getGuid() {
- return guid;
- }
-
- @Override
- public BranchId getBranch() {
- return CoreBranches.COMMON;
- }
- }
-
private final static class AccessContextIdToken extends NamedIdentity<String> implements IAccessContextId {
public AccessContextIdToken(String guid, String name) {
super(guid, name);
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/UserToken.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/UserToken.java
new file mode 100644
index 0000000000..9ab08ec072
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/UserToken.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.framework.core.data;
+
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.framework.jdk.core.type.NamedIdBase;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface UserToken extends ArtifactToken {
+
+ public String getUserId() throws OseeCoreException;
+
+ public boolean isActive() throws OseeCoreException;
+
+ public boolean isAdmin() throws OseeCoreException;
+
+ public String getEmail() throws OseeCoreException;
+
+ public boolean isCreationRequired();
+
+ public static UserToken create(long id, String guid, String name, String email, String userId, boolean active, boolean admin, boolean creationRequired) {
+ final class UserTokenImpl extends NamedIdBase implements UserToken {
+ private final String userId;
+ private final boolean active;
+ private final boolean admin;
+ private final String email;
+ private final String guid;
+ private final boolean creationRequired;
+
+ public UserTokenImpl(long id, String guid, String name, String userId, boolean active, boolean admin, String email, boolean creationRequired) {
+ super(id, name);
+ this.guid = guid;
+ this.userId = userId;
+ this.active = active;
+ this.admin = admin;
+ this.email = email;
+ this.creationRequired = creationRequired;
+ }
+
+ @Override
+ public IArtifactType getArtifactType() {
+ return CoreArtifactTypes.User;
+ }
+
+ @Override
+ public String getUserId() {
+ return userId;
+ }
+
+ @Override
+ public boolean isActive() {
+ return active;
+ }
+
+ @Override
+ public boolean isAdmin() {
+ return admin;
+ }
+
+ @Override
+ public String getEmail() {
+ return email;
+ }
+
+ @Override
+ public boolean isCreationRequired() {
+ return creationRequired;
+ }
+
+ @Override
+ public String toString() {
+ return String.format(
+ "UserToken [name [%s], userId=[%s], active=[%s], admin=[%s], email=[%s], creationRequired=[%s]",
+ getName(), userId, active, admin, email, creationRequired);
+ }
+
+ @Override
+ public String getGuid() {
+ return guid;
+ }
+
+ @Override
+ public BranchId getBranch() {
+ return CoreBranches.COMMON;
+ }
+ }
+ return new UserTokenImpl(id, guid, name, userId, active, admin, email, creationRequired);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/SystemUser.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/SystemUser.java
index af77896c9a..8df75a54db 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/SystemUser.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/SystemUser.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.framework.core.enums;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.Identity;
@@ -22,18 +22,18 @@ import org.eclipse.osee.framework.jdk.core.type.Identity;
public final class SystemUser {
// @formatter:off
- public static final IUserToken OseeSystem = TokenFactory.createUserToken(11, "AAABDBYPet4AGJyrc9dY1w", "OSEE System", "", "99999999", false, false, false);
- public static final IUserToken Anonymous = TokenFactory.createUserToken(1896, "AAABDi35uzwAxJLISLBZdA", "Anonymous", "", "99999998", false, false, false);
- public static final IUserToken BootStrap = TokenFactory.createUserToken(2184322, "noguid", "Boot Strap", "bootstrap@osee.org", "bootstrap", true, false, false);
- public static final IUserToken UnAssigned = TokenFactory.createUserToken(33429, "AAABDi1tMx8Al92YWMjeRw", "UnAssigned", "", "99999997", true, false, false);
- public static final List<IUserToken> values = Arrays.asList(OseeSystem, Anonymous, BootStrap, UnAssigned);
+ public static final UserToken OseeSystem = UserToken.create(11, "AAABDBYPet4AGJyrc9dY1w", "OSEE System", "", "99999999", false, false, false);
+ public static final UserToken Anonymous = UserToken.create(1896, "AAABDi35uzwAxJLISLBZdA", "Anonymous", "", "99999998", false, false, false);
+ public static final UserToken BootStrap = UserToken.create(2184322, "noguid", "Boot Strap", "bootstrap@osee.org", "bootstrap", true, false, false);
+ public static final UserToken UnAssigned = UserToken.create(33429, "AAABDi1tMx8Al92YWMjeRw", "UnAssigned", "", "99999997", true, false, false);
+ public static final List<UserToken> values = Arrays.asList(OseeSystem, Anonymous, BootStrap, UnAssigned);
// @formatter:on
private SystemUser() {
// Constants
}
- public static List<IUserToken> values() {
+ public static List<UserToken> values() {
return values;
}
diff --git a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/AddCommonBranch.java b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/AddCommonBranch.java
index 585f3c2fed..8ac949bc4f 100644
--- a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/AddCommonBranch.java
+++ b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/AddCommonBranch.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.framework.database.init;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.List;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.OrcsTypeSheet;
import org.eclipse.osee.framework.core.data.OrcsTypesData;
import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
@@ -92,7 +92,7 @@ public abstract class AddCommonBranch implements IDbInitializationTask {
everyonGroup.persist(transaction);
// Create Default Users
- for (IUserToken userToken : SystemUser.values()) {
+ for (UserToken userToken : SystemUser.values()) {
UserManager.createUser(userToken, transaction);
}
// Create Global Preferences artifact that lives on common branch
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserAdmin.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserAdmin.java
index abb429d544..b429c0ac33 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserAdmin.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserAdmin.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.framework.skynet.core;
import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
@@ -41,7 +41,7 @@ public interface UserAdmin {
User getUserByName(String name) throws OseeCoreException;
- User getUser(IUserToken user) throws OseeCoreException;
+ User getUser(UserToken user) throws OseeCoreException;
String getSafeUserNameById(ArtifactId userArtifactId);
@@ -49,9 +49,9 @@ public interface UserAdmin {
User getUserByArtId(ArtifactId userArtifactId) throws OseeCoreException;
- User createUser(IUserToken userToken, String comment) throws OseeCoreException;
+ User createUser(UserToken userToken, String comment) throws OseeCoreException;
- User createUser(IUserToken userToken, SkynetTransaction transaction) throws OseeCoreException;
+ User createUser(UserToken userToken, SkynetTransaction transaction) throws OseeCoreException;
boolean isDuringCurrentUserCreation();
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java
index f8db4feab9..964a26842d 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java
@@ -18,7 +18,7 @@ import java.util.concurrent.FutureTask;
import java.util.logging.Level;
import org.eclipse.osee.cache.admin.CacheAdmin;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.exception.UserNotInDatabase;
import org.eclipse.osee.framework.jdk.core.type.LazyObject;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -158,7 +158,7 @@ public final class UserManager {
return getUserAdmin().getUserByName(name);
}
- public static User getUser(IUserToken user) throws OseeCoreException {
+ public static User getUser(UserToken user) throws OseeCoreException {
return getUserAdmin().getUser(user);
}
@@ -174,7 +174,7 @@ public final class UserManager {
return getUserAdmin().isDuringCurrentUserCreation();
}
- public static User createUser(IUserToken userToken, SkynetTransaction transaction) throws OseeCoreException {
+ public static User createUser(UserToken userToken, SkynetTransaction transaction) throws OseeCoreException {
return getUserAdmin().createUser(userToken, transaction);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/CurrentUserProvider.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/CurrentUserProvider.java
index 12cc0f4ae1..e784077e3e 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/CurrentUserProvider.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/CurrentUserProvider.java
@@ -16,7 +16,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import org.eclipse.osee.cache.admin.Cache;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.data.IdeClientSession;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.exception.UserNotInDatabase;
@@ -67,7 +67,7 @@ public class CurrentUserProvider extends LazyObject<User> {
if (SystemUser.BootStrap.getUserId().equals(userId)) {
currentUser = BootStrapUser.getInstance();
} else {
- IUserToken currentUserToken = ClientSessionManager.getCurrentUserToken();
+ UserToken currentUserToken = ClientSessionManager.getCurrentUserToken();
if (ClientSessionManager.isUserCreationRequired()) {
try {
duringCreateUser.set(true);
@@ -129,7 +129,7 @@ public class CurrentUserProvider extends LazyObject<User> {
return currentUser;
}
- private User getUser(IUserToken token) throws OseeCoreException {
+ private User getUser(UserToken token) throws OseeCoreException {
User user = null;
try {
user = cacheProvider.get().get(token.getUserId());
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserAdminImpl.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserAdminImpl.java
index 9ab9c1de2a..f6c6974af2 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserAdminImpl.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserAdminImpl.java
@@ -17,7 +17,7 @@ import org.eclipse.osee.cache.admin.Cache;
import org.eclipse.osee.cache.admin.CacheAdmin;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.exception.UserDataStoreException;
import org.eclipse.osee.framework.core.exception.UserNotInDatabase;
@@ -244,7 +244,7 @@ public class UserAdminImpl implements UserAdmin {
}
@Override
- public User getUser(IUserToken user) throws OseeCoreException {
+ public User getUser(UserToken user) throws OseeCoreException {
Conditions.checkNotNull(user, "user data");
return getUserByUserId(user.getUserId());
}
@@ -297,12 +297,12 @@ public class UserAdminImpl implements UserAdmin {
}
@Override
- public User createUser(IUserToken userToken, String comment) throws OseeCoreException {
+ public User createUser(UserToken userToken, String comment) throws OseeCoreException {
return userWriteAccessor.createUser(userToken, comment);
}
@Override
- public User createUser(IUserToken userToken, SkynetTransaction transaction) throws OseeCoreException {
+ public User createUser(UserToken userToken, SkynetTransaction transaction) throws OseeCoreException {
return userWriteAccessor.createUser(userToken, transaction);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserDataWriter.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserDataWriter.java
index defaa495a2..800f59e7cb 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserDataWriter.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserDataWriter.java
@@ -14,7 +14,7 @@ import java.util.Collection;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import org.eclipse.osee.cache.admin.Cache;
-import org.eclipse.osee.framework.core.data.IUserToken;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
@@ -45,14 +45,14 @@ public class UserDataWriter {
this.cacheProvider = cacheProvider;
}
- public User createUser(IUserToken userToken, String comment) throws OseeCoreException {
+ public User createUser(UserToken userToken, String comment) throws OseeCoreException {
SkynetTransaction transaction = TransactionManager.createTransaction(CoreBranches.COMMON, comment);
User user = createUser(userToken, transaction);
Operations.executeWorkAndCheckStatus(transaction);
return user;
}
- public User createUser(IUserToken userToken, SkynetTransaction transaction) throws OseeCoreException {
+ public User createUser(UserToken userToken, SkynetTransaction transaction) throws OseeCoreException {
// Determine if user with id has already been created; boot strap issue with dbInit
User user = cacheProvider.get().getIfPresent(userToken.getUserId());
if (user != null) {

Back to the top