Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-07-02 22:16:14 +0000
committerRyan D. Brooks2016-07-12 16:21:10 +0000
commit45b28b0508c364098cfcdb3892951c21c36acc6e (patch)
treef785484ed27e846d548e7d13895bc05d56bf37dd
parentfc9d7c9e9f4b99af674b3591224cc7a8615e322e (diff)
downloadorg.eclipse.osee-45b28b0508c364098cfcdb3892951c21c36acc6e.tar.gz
org.eclipse.osee-45b28b0508c364098cfcdb3892951c21c36acc6e.tar.xz
org.eclipse.osee-45b28b0508c364098cfcdb3892951c21c36acc6e.zip
refactor: Extend ArtifactId from Id
-rw-r--r--plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/AccountAdminImplTest.java28
-rw-r--r--plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/SubscriptionAdminImplTest.java3
-rw-r--r--plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/CreateAccountRequestBuilder.java2
-rw-r--r--plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/Subscription.java3
-rw-r--r--plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/SubscriptionGroup.java6
-rw-r--r--plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupData.java8
-rw-r--r--plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupId.java44
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java9
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java40
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java3
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java3
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java3
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java9
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java3
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java2
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java7
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/SubscriptionsResource.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactId.java42
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactToken.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactType.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IAttributeType.java8
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseIdentity.java3
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Identity.java11
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/AccessTopicEventPayload.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtilTest.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSubscriptionGroupImpl.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsSubscriptionStorage.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java3
38 files changed, 173 insertions, 183 deletions
diff --git a/plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/AccountAdminImplTest.java b/plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/AccountAdminImplTest.java
index 0ce1dca0c6..0d98453280 100644
--- a/plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/AccountAdminImplTest.java
+++ b/plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/AccountAdminImplTest.java
@@ -42,7 +42,6 @@ import org.eclipse.osee.authentication.admin.AuthenticatedUser;
import org.eclipse.osee.authentication.admin.AuthenticationAdmin;
import org.eclipse.osee.authentication.admin.AuthenticationRequest;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
@@ -63,7 +62,6 @@ import org.mockito.Mockito;
*/
public class AccountAdminImplTest {
- private static final long ID = 123121412L;
private static final String USERNAME = "atest";
private static final String EMAIL = "atest@email.com";
private static final String NAME = "myName";
@@ -86,7 +84,7 @@ public class AccountAdminImplTest {
@Captor private ArgumentCaptor<AuthenticationRequest> authenticationRequestCaptor;
// @formatter:on
- private final ArtifactId newAccountId = TokenFactory.createArtifactId(123121412L);
+ private final ArtifactId newAccountId = ArtifactId.valueOf(123121412);
private AccountAdminImpl accountAdmin;
@@ -390,12 +388,12 @@ public class AccountAdminImplTest {
when(storage.getAccountByEmail(EMAIL)).thenReturn(resultSet);
AccountLoginRequest request = AccountLoginRequestBuilder.newBuilder()//
- .userName(userName)//
- .password(password)//
- .scheme(scheme)//
- .remoteAddress(remoteAddress)//
- .accessedBy(accessDetails)//
- .build();
+ .userName(userName)//
+ .password(password)//
+ .scheme(scheme)//
+ .remoteAddress(remoteAddress)//
+ .accessedBy(accessDetails)//
+ .build();
when(authenticationAdmin.authenticate(any(AuthenticationRequest.class))).thenReturn(authenticatedUser);
when(authenticatedUser.getEmailAddress()).thenReturn(EMAIL);
@@ -431,12 +429,12 @@ public class AccountAdminImplTest {
when(authenticatedUser.getEmailAddress()).thenReturn(EMAIL);
AccountLoginRequest request = AccountLoginRequestBuilder.newBuilder()//
- .userName(userName)//
- .password(password)//
- .scheme(scheme)//
- .remoteAddress(remoteAddress)//
- .accessedBy(accessDetails)//
- .build();
+ .userName(userName)//
+ .password(password)//
+ .scheme(scheme)//
+ .remoteAddress(remoteAddress)//
+ .accessedBy(accessDetails)//
+ .build();
AccountSession actual = accountAdmin.login(request);
assertEquals(session, actual);
diff --git a/plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/SubscriptionAdminImplTest.java b/plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/SubscriptionAdminImplTest.java
index 0b1c55edd0..caef879ec3 100644
--- a/plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/SubscriptionAdminImplTest.java
+++ b/plugins/org.eclipse.osee.account.admin.test/src/org/eclipse/osee/account/admin/internal/SubscriptionAdminImplTest.java
@@ -30,7 +30,6 @@ import org.eclipse.osee.account.admin.ds.SubscriptionStorage;
import org.eclipse.osee.account.admin.internal.validator.Validator;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.logger.Log;
import org.junit.Before;
import org.junit.Rule;
@@ -47,7 +46,7 @@ public class SubscriptionAdminImplTest {
private static final String GROUP_NAME = "group-name";
private static final String ENCODED_UUID = "D1jfajgjoiasdajv32";
- private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(21231L);
+ private static final ArtifactId ACCOUNT_ID = ArtifactId.valueOf(21231);
private static final SubscriptionGroupId GROUP_ID = new SubscriptionGroupId(7885741L);
@Rule
diff --git a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/CreateAccountRequestBuilder.java b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/CreateAccountRequestBuilder.java
index a3ca6ae637..4ecb792dc4 100644
--- a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/CreateAccountRequestBuilder.java
+++ b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/CreateAccountRequestBuilder.java
@@ -69,7 +69,7 @@ public final class CreateAccountRequestBuilder {
return new CreateAccountRequestImpl(active, userName, email, displayName, prefs);
}
- private static final class CreateAccountRequestImpl implements CreateAccountRequest {
+ public static final class CreateAccountRequestImpl implements CreateAccountRequest {
private final boolean active;
private final String userName;
diff --git a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/Subscription.java b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/Subscription.java
index 361d48e1c7..9667918ce9 100644
--- a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/Subscription.java
+++ b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/Subscription.java
@@ -12,13 +12,14 @@ package org.eclipse.osee.account.admin;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.Identity;
import org.eclipse.osee.framework.jdk.core.type.Named;
/**
* @author Roberto E. Escobar
*/
-public interface Subscription extends Identity<String>, Named {
+public interface Subscription extends Identity<String>, Named, Id {
ArtifactId getAccountId();
diff --git a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/SubscriptionGroup.java b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/SubscriptionGroup.java
index b95dd70b70..8fa5adabf0 100644
--- a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/SubscriptionGroup.java
+++ b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/SubscriptionGroup.java
@@ -11,13 +11,13 @@
package org.eclipse.osee.account.admin;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
/**
* @author Roberto E. Escobar
*/
-public interface SubscriptionGroup extends Identifiable<String> {
-
- SubscriptionGroupId getId();
+public interface SubscriptionGroup extends Identifiable<String>, Id {
+ SubscriptionGroupId getGroupId();
} \ No newline at end of file
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
index 0ba12a3fac..b65ec2ff86 100644
--- 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
@@ -11,6 +11,7 @@
package org.eclipse.osee.account.rest.model;
import javax.xml.bind.annotation.XmlRootElement;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
import org.eclipse.osee.framework.jdk.core.type.Identity;
@@ -18,7 +19,7 @@ import org.eclipse.osee.framework.jdk.core.type.Identity;
* @author Roberto E. Escobar
*/
@XmlRootElement
-public class SubscriptionGroupData implements Identifiable<String> {
+public class SubscriptionGroupData implements Identifiable<String>, Id {
private String uuid;
private String name;
@@ -56,6 +57,11 @@ public class SubscriptionGroupData implements Identifiable<String> {
}
@Override
+ public Long getId() {
+ return null;
+ }
+
+ @Override
public boolean equals(Object obj) {
boolean equal = false;
if (obj instanceof Identity) {
diff --git a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupId.java b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupId.java
index b03dfdf931..3b2d214e8e 100644
--- a/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupId.java
+++ b/plugins/org.eclipse.osee.account.rest.model/src/org/eclipse/osee/account/rest/model/SubscriptionGroupId.java
@@ -10,48 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.account.rest.model;
-import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.jdk.core.type.Named;
-import org.eclipse.osee.framework.jdk.core.type.NamedIdentity;
+import org.eclipse.osee.framework.jdk.core.type.NamedId;
/**
* @author Angel Avila
*/
-public class SubscriptionGroupId extends NamedIdentity<String> implements ArtifactId {
+public class SubscriptionGroupId extends NamedId {
- private final Long uuid;
-
- public SubscriptionGroupId(Long uuid) {
- super(null, String.valueOf(uuid));
- this.uuid = uuid;
- }
-
- @Override
- public Long getUuid() {
- return uuid;
- }
-
- @Override
- public boolean equals(Object other) {
- boolean toReturn = false;
- if (other instanceof SubscriptionGroupId) {
- toReturn = this.getUuid().equals(((SubscriptionGroupId) other).getUuid());
- }
- return toReturn;
- }
-
- @Override
- public int hashCode() {
- return getUuid().hashCode();
- }
-
- @Override
- public int compareTo(Named arg0) {
- return getName().compareTo(arg0.getName());
- }
-
- @Override
- public String toStringWithId() {
- return String.format("[%s][%s]", getName(), getUuid());
+ public SubscriptionGroupId(Long id) {
+ super(id, String.valueOf(id));
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java
index af4ebdcba1..bf6380918a 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java
@@ -22,7 +22,7 @@ import org.eclipse.osee.account.rest.model.AccountSessionDetailsData;
import org.eclipse.osee.account.rest.model.SubscriptionData;
import org.eclipse.osee.account.rest.model.SubscriptionGroupData;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.junit.Test;
import org.mockito.Mockito;
@@ -63,7 +63,7 @@ public class AccountDataUtilTest {
when(subscription.getGuid()).thenReturn("ABCDE");
when(subscription.getName()).thenReturn("group-1");
when(subscription.getGroupId()).thenReturn(new SubscriptionGroupId(98765L));
- when(subscription.getAccountId()).thenReturn(TokenFactory.createArtifactId(123145L));
+ when(subscription.getAccountId()).thenReturn(ArtifactId.valueOf(123145));
when(subscription.getAccountName()).thenReturn("account-1");
when(subscription.isActive()).thenReturn(true);
@@ -74,7 +74,6 @@ public class AccountDataUtilTest {
assertEquals("account-1", actual.getAccountName());
assertEquals(true, actual.isActive());
- assertEquals(true, actual.matches(subscription));
assertEquals(true, actual.equals(subscription));
}
@@ -83,13 +82,13 @@ public class AccountDataUtilTest {
SubscriptionGroup group = Mockito.mock(SubscriptionGroup.class);
when(group.getGuid()).thenReturn("ABCDE");
when(group.getName()).thenReturn("group-1");
- when(group.getId()).thenReturn(new SubscriptionGroupId(98765L));
+ when(group.getGroupId()).thenReturn(new SubscriptionGroupId(98765L));
SubscriptionGroupData actual = AccountDataUtil.asSubscriptionGroupData(group);
assertEquals("ABCDE", actual.getGuid());
assertEquals("group-1", actual.getName());
- assertEquals((Long) 98765L, actual.getSubscriptionGroupId().getUuid());
+ assertEquals((Long) 98765L, actual.getSubscriptionGroupId().getId());
assertEquals(true, actual.matches(group));
assertEquals(true, actual.equals(group));
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java
index 059d7de519..88b44e6ad0 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.account.rest.internal;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -41,7 +42,6 @@ import org.eclipse.osee.account.rest.model.AccountPreferencesInput;
import org.eclipse.osee.account.rest.model.AccountSessionData;
import org.eclipse.osee.account.rest.model.AccountSessionDetailsData;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
import org.eclipse.osee.framework.jdk.core.util.GUID;
@@ -59,7 +59,7 @@ import org.mockito.MockitoAnnotations;
*/
public class AccountOpsTest {
- private static final ArtifactId ACCOUNT_UID = TokenFactory.createArtifactId(235622L);
+ private static final ArtifactId ACCOUNT_UID = ArtifactId.valueOf(235622);
//@formatter:off
@Mock private AccountAdmin accountAdmin;
@@ -96,7 +96,7 @@ public class AccountOpsTest {
ArgumentCaptor<CreateAccountRequest> captor = ArgumentCaptor.forClass(CreateAccountRequest.class);
- ArtifactId newAccountId = TokenFactory.createArtifactId(235151L);
+ ArtifactId newAccountId = ArtifactId.valueOf(235151);
when(accountAdmin.createAccount(any(CreateAccountRequest.class))).thenReturn(newAccountId);
@@ -224,19 +224,21 @@ public class AccountOpsTest {
@Test
public void testGetAccountData() {
- Account account = mockAccount(TokenFactory.createArtifactId(456L), "DEF", "acc2", "acc2@email.com", "u2", true);
+ ArtifactId artId = ArtifactId.valueOf(456);
+ Account account = mockAccount(artId, "DEF", "acc2", "acc2@email.com", "u2", true);
ResultSet<Account> accounts = ResultSets.singleton(account);
when(accountAdmin.getAccountById(ACCOUNT_UID)).thenReturn(accounts);
AccountInfoData actual = ops.getAccountData(ACCOUNT_UID);
- assertAccount(actual, TokenFactory.createArtifactId(456L), "DEF", "acc2", "acc2@email.com", "u2", true);
+ assertAccount(actual, artId, "DEF", "acc2", "acc2@email.com", "u2", true);
verify(accountAdmin).getAccountById(ACCOUNT_UID);
}
@Test
public void testGetAccountDetailsData() {
- Account account = mockAccount(TokenFactory.createArtifactId(789L), "GHI", "acc3", "acc3@email.com", "u3", true);
+ ArtifactId artId = ArtifactId.valueOf(789);
+ Account account = mockAccount(artId, "GHI", "acc3", "acc3@email.com", "u3", true);
Map<String, String> map = new HashMap<>();
map.put("a", "1");
map.put("b", "2");
@@ -244,7 +246,7 @@ public class AccountOpsTest {
AccountPreferences preferences = mock(AccountPreferences.class);
when(preferences.asMap()).thenReturn(map);
- when(preferences.getId()).thenReturn(789L);
+ when(preferences.getId()).thenReturn(artId.getId());
when(account.getPreferences()).thenReturn(preferences);
ResultSet<Account> accounts = ResultSets.singleton(account);
@@ -252,7 +254,7 @@ public class AccountOpsTest {
AccountDetailsData actual = ops.getAccountDetailsData(ACCOUNT_UID);
- assertAccount(actual, TokenFactory.createArtifactId(789L), "GHI", "acc3", "acc3@email.com", "u3", true);
+ assertAccount(actual, artId, "GHI", "acc3", "acc3@email.com", "u3", true);
AccountPreferencesData actualPrefs = actual.getPreferences();
Map<String, String> actualMap = actualPrefs.getMap();
@@ -296,9 +298,13 @@ public class AccountOpsTest {
@Test
public void testGetAllAccounts() {
- Account account1 = mockAccount(TokenFactory.createArtifactId(123L), "ABC", "acc1", "acc1@email.com", "u1", true);
- Account account2 = mockAccount(TokenFactory.createArtifactId(456L), "DEF", "acc2", "acc2@email.com", "u2", false);
- Account account3 = mockAccount(TokenFactory.createArtifactId(789L), "GHI", "acc3", "acc3@email.com", "u3", true);
+ ArtifactId artId1 = ArtifactId.valueOf(123);
+ ArtifactId artId2 = ArtifactId.valueOf(456);
+ ArtifactId artId3 = ArtifactId.valueOf(789);
+
+ Account account1 = mockAccount(artId1, "ABC", "acc1", "acc1@email.com", "u1", true);
+ Account account2 = mockAccount(artId2, "DEF", "acc2", "acc2@email.com", "u2", false);
+ Account account3 = mockAccount(artId3, "GHI", "acc3", "acc3@email.com", "u3", true);
ResultSet<Account> accounts = ResultSets.newResultSet(account1, account2, account3);
@@ -309,9 +315,9 @@ public class AccountOpsTest {
assertEquals(3, actual.size());
Iterator<AccountInfoData> iterator = actual.iterator();
- assertAccount(iterator.next(), TokenFactory.createArtifactId(123L), "ABC", "acc1", "acc1@email.com", "u1", true);
- assertAccount(iterator.next(), TokenFactory.createArtifactId(456L), "DEF", "acc2", "acc2@email.com", "u2", false);
- assertAccount(iterator.next(), TokenFactory.createArtifactId(789L), "GHI", "acc3", "acc3@email.com", "u3", true);
+ assertAccount(iterator.next(), artId1, "ABC", "acc1", "acc1@email.com", "u1", true);
+ assertAccount(iterator.next(), artId2, "DEF", "acc2", "acc2@email.com", "u2", false);
+ assertAccount(iterator.next(), artId3, "GHI", "acc3", "acc3@email.com", "u3", true);
verify(accountAdmin).getAllAccounts();
}
@@ -319,7 +325,7 @@ public class AccountOpsTest {
@Test
public void testIsActive() {
String guid = GUID.create();
- ArtifactId accountId = TokenFactory.createArtifactId(23127916023214L);
+ ArtifactId accountId = ArtifactId.valueOf(23127916023214L);
Account account = mock(Account.class);
ResultSet<Account> result = ResultSets.singleton(account);
@@ -358,9 +364,7 @@ public class AccountOpsTest {
when(input.getMap()).thenReturn(map);
when(accountAdmin.setAccountPreferences(ACCOUNT_UID, map)).thenReturn(true);
- boolean actual = ops.setAccountPreferences(ACCOUNT_UID, input);
-
- assertEquals(true, actual);
+ assertTrue(ops.setAccountPreferences(ACCOUNT_UID, input));
verify(accountAdmin).setAccountPreferences(ACCOUNT_UID, map);
}
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java
index 71c7fead70..07460560c7 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java
@@ -21,7 +21,6 @@ import javax.ws.rs.core.Response.Status;
import org.eclipse.osee.account.rest.model.AccountPreferencesData;
import org.eclipse.osee.account.rest.model.AccountPreferencesInput;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -33,7 +32,7 @@ import org.mockito.Mock;
*/
public class AccountPreferencesResourceTest {
- private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(134522L);
+ private static final ArtifactId ACCOUNT_ID = ArtifactId.valueOf(134522);
//@formatter:off
@Mock private AccountOps accountOps;
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java
index 8da724baf5..e0513afede 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java
@@ -25,7 +25,6 @@ import org.eclipse.osee.account.rest.model.AccountDetailsData;
import org.eclipse.osee.account.rest.model.AccountInfoData;
import org.eclipse.osee.account.rest.model.AccountInput;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -37,7 +36,7 @@ import org.mockito.Mock;
*/
public class AccountResourceTest {
- private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(93253L);
+ private static final ArtifactId ACCOUNT_ID = ArtifactId.valueOf(93253);
//@formatter:off
@Mock private AccountOps accountOps;
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java
index 42486f4885..6fa1beee75 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java
@@ -18,7 +18,6 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.account.rest.model.AccountSessionDetailsData;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -30,7 +29,7 @@ import org.mockito.Mock;
*/
public class AccountSessionsResourceTest {
- private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(823952L);
+ private static final ArtifactId ACCOUNT_ID = ArtifactId.valueOf(823952);
//@formatter:off
@Mock private AccountOps accountOps;
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java
index b2c4d641a3..951a3c915b 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java
@@ -25,7 +25,6 @@ import org.eclipse.osee.account.rest.model.SubscriptionData;
import org.eclipse.osee.account.rest.model.SubscriptionGroupData;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
import org.junit.Before;
@@ -47,7 +46,7 @@ public class SubscriptionsResourceTest {
private static final String ACCOUNT_UUID = "asdksa";
private static final String ACCOUNT_NAME = "account-1";
- private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(3129303L);
+ private static final ArtifactId ACCOUNT_ID = ArtifactId.valueOf(3129303);
private static final String ACCOUNT_USERNAME = "sadfaa";
private static final String ACCOUNT_EMAIL = "hello@hello.com";
private static final boolean ACCOUNT_IS_ACTIVE = true;
@@ -83,7 +82,7 @@ public class SubscriptionsResourceTest {
when(group.getGuid()).thenReturn(GROUP_UUID);
when(group.getName()).thenReturn(GROUP_NAME);
- when(group.getId()).thenReturn(GROUP_ID);
+ when(group.getGroupId()).thenReturn(GROUP_ID);
when(account.getGuid()).thenReturn(ACCOUNT_UUID);
when(account.getName()).thenReturn(ACCOUNT_NAME);
@@ -199,7 +198,7 @@ public class SubscriptionsResourceTest {
public void testDeleteSubscriptionGroup() {
when(manager.deleteSubscriptionById(GROUP_ID)).thenReturn(true);
- Response actual = resource.deleteSubscriptionGroup(GROUP_ID.getUuid());
+ Response actual = resource.deleteSubscriptionGroup(GROUP_ID.getId());
assertEquals(Status.OK.getStatusCode(), actual.getStatus());
verify(manager).deleteSubscriptionById(GROUP_ID);
@@ -210,7 +209,7 @@ public class SubscriptionsResourceTest {
ResultSet<Account> results = ResultSets.singleton(account);
when(manager.getSubscriptionMembersOfSubscriptionById(GROUP_ID)).thenReturn(results);
- AccountInfoData[] actual = resource.getSubscriptionGroupMembers(GROUP_ID.getUuid());
+ AccountInfoData[] actual = resource.getSubscriptionGroupMembers(GROUP_ID.getId());
assertEquals(1, actual.length);
AccountInfoData data = actual[0];
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java
index 43c011fc63..a939b1a55c 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java
@@ -26,7 +26,6 @@ import org.eclipse.osee.account.admin.Subscription;
import org.eclipse.osee.account.admin.SubscriptionAdmin;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ViewModel;
import org.junit.Before;
import org.junit.Test;
@@ -44,7 +43,7 @@ public class UnsubscribeResourceTest {
private static final String GROUP_UUID = "sadjha322";
private static final SubscriptionGroupId GROUP_ID = new SubscriptionGroupId(37219891L);
private static final String GROUP_NAME = "group-1";
- private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(3129303L);
+ private static final ArtifactId ACCOUNT_ID = ArtifactId.valueOf(3129303);
private static final String ACCOUNT_NAME = "account-1";
//@formatter:off
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java
index c2ac742721..239e702823 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java
+++ b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java
@@ -102,7 +102,7 @@ public final class AccountDataUtil {
SubscriptionGroupData data = new SubscriptionGroupData();
data.setGuid(src.getGuid());
data.setName(src.getName());
- data.setSubscriptionGroupId(src.getId());
+ data.setSubscriptionGroupId(src.getGroupId());
return data;
}
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java
index f47a229da2..516c4f5e5d 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java
+++ b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java
@@ -26,7 +26,6 @@ import org.eclipse.osee.account.rest.model.AccountContexts;
import org.eclipse.osee.account.rest.model.AccountInfoData;
import org.eclipse.osee.account.rest.model.AccountInput;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
/**
@@ -60,7 +59,7 @@ public class AccountsResource {
@PermitAll
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getPreferences(@PathParam("id") Long id) {
- ArtifactId artifactId = TokenFactory.createArtifactId(id);
+ ArtifactId artifactId = ArtifactId.valueOf(id);
return Response.ok().entity(accountOps.getAccountWebPreferencesData(artifactId)).build();
}
@@ -69,7 +68,7 @@ public class AccountsResource {
@PermitAll
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response editPreferences(@PathParam("id") String userUuid, @QueryParam("key") String key, @QueryParam("itemId") String itemId, String newValue) {
- ArtifactId artifactId = TokenFactory.createArtifactId(Long.valueOf(userUuid));
+ ArtifactId artifactId = ArtifactId.valueOf(userUuid);
return Response.ok().entity(accountOps.editAccountWebPreferencesData(artifactId, key, itemId, newValue)).build();
}
@@ -101,7 +100,7 @@ public class AccountsResource {
@Path(AccountContexts.ACCOUNT_ID_TEMPLATE)
public AccountResource getAccount(@PathParam(AccountContexts.ACCOUNT_ID_PARAM) Long accountId) {
- ArtifactId artifactId = TokenFactory.createArtifactId(accountId);
+ ArtifactId artifactId = ArtifactId.valueOf(accountId);
return new AccountResource(accountOps, artifactId);
}
}
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/SubscriptionsResource.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/SubscriptionsResource.java
index 8268ac7eb3..09e38c8e35 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/SubscriptionsResource.java
+++ b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/SubscriptionsResource.java
@@ -30,7 +30,6 @@ import org.eclipse.osee.account.rest.model.SubscriptionData;
import org.eclipse.osee.account.rest.model.SubscriptionGroupData;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.SystemRoles;
@@ -56,7 +55,7 @@ public class SubscriptionsResource {
@GET
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public SubscriptionData[] getSubscriptions(@PathParam("account-id") Long accountId) {
- ArtifactId artId = TokenFactory.createArtifactId(accountId);
+ ArtifactId artId = ArtifactId.valueOf(accountId);
ResultSet<Subscription> subscriptions = manager.getSubscriptionsByAccountId(artId);
SubscriptionData[] toReturn = new SubscriptionData[subscriptions.size()];
int index = 0;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java
index 4e2f2550a8..3e1a265b6f 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java
@@ -21,7 +21,7 @@ import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider;
import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.RelationType;
-import org.eclipse.osee.framework.jdk.core.type.Identity;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
@@ -106,7 +106,7 @@ public final class ArtifactDataProviderImpl implements ArtifactDataProvider {
}
@Override
- public boolean matches(Identity<?>... identities) {
+ public boolean matches(Id... identities) {
return self.matches(identities);
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactId.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactId.java
index 6a5bbb8fc5..8811af501c 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactId.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactId.java
@@ -10,16 +10,54 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.data;
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.eclipse.osee.framework.jdk.core.type.BaseId;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
/**
* @author Megumi Telles
*/
-public interface ArtifactId extends Identifiable<String>, HasBranch {
+public interface ArtifactId extends Identifiable<String>, Id {
public Long getUuid();
+ public static ArtifactId valueOf(String id) {
+
+ return valueOf(Long.valueOf(id));
+ }
+
+ @JsonCreator
+ public static ArtifactId valueOf(long id) {
+ final class ArtifactIdImpl extends BaseId implements ArtifactId {
+ public ArtifactIdImpl(Long artId) {
+ super(artId);
+ }
+
+ @Override
+ public String getGuid() {
+ return null;
+ }
+
+ @Override
+ public Long getUuid() {
+ return getId();
+ }
+
+ @Override
+ public String getName() {
+ return null;
+ }
+ }
+ return new ArtifactIdImpl(id);
+ }
+
default String toStringWithId() {
return String.format("[%s][%s]", getName(), getUuid());
}
-}
+
+ @Override
+ default Long getId() {
+ return getUuid();
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactToken.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactToken.java
index 7100c5b717..27c1aa4fe3 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactToken.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactToken.java
@@ -14,7 +14,7 @@ package org.eclipse.osee.framework.core.data;
* @author Ryan D. Brooks
* @author Donald G. Dunne
*/
-public interface IArtifactToken extends ArtifactId, HasArtifactType {
+public interface IArtifactToken extends ArtifactId, HasArtifactType, HasBranch {
// composition interface requires no additional methods,fields
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactType.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactType.java
index d1d229aeca..2f4e5d463f 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactType.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IArtifactType.java
@@ -10,11 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.data;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
/**
* @author Ryan D. Brooks
*/
-public interface IArtifactType extends Identifiable<Long> {
+public interface IArtifactType extends Identifiable<Long>, Id {
// composition interface requires no additional methods,fields
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IAttributeType.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IAttributeType.java
index 951a120227..1d7654e854 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IAttributeType.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/IAttributeType.java
@@ -12,10 +12,16 @@ package org.eclipse.osee.framework.core.data;
import org.eclipse.osee.framework.jdk.core.type.FullyNamed;
import org.eclipse.osee.framework.jdk.core.type.HasDescription;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
/**
* @author Ryan D. Brooks
*/
-public interface IAttributeType extends Identifiable<Long>, FullyNamed, HasDescription {
+public interface IAttributeType extends Identifiable<Long>, FullyNamed, HasDescription, Id {
+
+ @Override
+ default Long getId() {
+ return getGuid();
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseIdentity.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseIdentity.java
index dd339cfbbb..ce54f24d7f 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseIdentity.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/BaseIdentity.java
@@ -42,8 +42,7 @@ public class BaseIdentity<T> implements Identity<T> {
} else if (getGuid() != null) {
equal = getGuid().equals(identity.getGuid());
}
- }
- if (obj instanceof Id) {
+ } else if (obj instanceof Id) {
equal = ((Id) obj).getId().equals(id);
}
return equal;
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Identity.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Identity.java
index 9a3d89c45a..9a3b20682b 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Identity.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Identity.java
@@ -15,16 +15,5 @@ package org.eclipse.osee.framework.jdk.core.type;
* @author Ryan D. Brooks
*/
public interface Identity<T> {
-
T getGuid();
-
- default boolean matches(Identity<?>... identities) {
- for (Identity<?> identity : identities) {
- if (equals(identity)) {
- return true;
- }
- }
- return false;
- }
-
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/AccessTopicEventPayload.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/AccessTopicEventPayload.java
index de51e1d315..e30f021331 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/AccessTopicEventPayload.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/AccessTopicEventPayload.java
@@ -16,6 +16,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.ser.std.ToStringSerializer;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.IArtifactToken;
/**
* Payload for the Access Topic Event
@@ -60,7 +61,7 @@ public class AccessTopicEventPayload implements ISerializeableTopicPayload {
/**
* @return true if this artifact matches event branch and contains artifact
*/
- public boolean matches(ArtifactId artifact) {
+ public boolean matches(IArtifactToken artifact) {
if (!artifactUuids.isEmpty()) {
return artifact.getBranchId().equals(branchUuid) && artifactUuids.contains(String.valueOf(artifact.getUuid()));
}
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF
index 6aa8497b3f..650bdfdde3 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF
@@ -17,7 +17,8 @@ Require-Bundle: org.junit,
org.eclipse.osee.framework.core,
org.eclipse.osee.framework.core.model,
org.eclipse.osee.framework.resource.management
-Import-Package: org.eclipse.osee.orcs.db.mock,
+Import-Package: org.eclipse.osee.account.admin,
org.eclipse.osee.event,
org.eclipse.osee.executor.admin,
+ org.eclipse.osee.orcs.db.mock,
org.osgi.service.event
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java
index 3eb03c2a66..4f4fcdf417 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java
@@ -24,7 +24,6 @@ import org.eclipse.osee.account.admin.AccountSession;
import org.eclipse.osee.account.admin.CreateAccountRequest;
import org.eclipse.osee.account.admin.ds.AccountStorage;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.util.Compare;
import org.eclipse.osee.orcs.account.admin.internal.OrcsAccountStorage;
@@ -107,7 +106,7 @@ public class OrcsAccountStorageTest {
Account account1 = result.getExactlyOne();
assertAccount(account1, newAccountId, name, email, username, active, prefs);
- ArtifactId artId = TokenFactory.createArtifactId(account1.getId());
+ ArtifactId artId = ArtifactId.valueOf(account1.getId());
ResultSet<Account> result2 = storage.getAccountById(artId);
Account account2 = result2.getExactlyOne();
assertEquals(account1, account2);
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java
index d4de22921b..1da5e057ec 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java
@@ -11,20 +11,18 @@
package org.eclipse.osee.orcs.account.admin.integration;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.osee.account.admin.Account;
-import org.eclipse.osee.account.admin.AccountPreferences;
import org.eclipse.osee.account.admin.CreateAccountRequest;
+import org.eclipse.osee.account.admin.CreateAccountRequestBuilder;
import org.eclipse.osee.account.admin.Subscription;
import org.eclipse.osee.account.admin.SubscriptionGroup;
import org.eclipse.osee.account.admin.ds.AccountStorage;
import org.eclipse.osee.account.admin.ds.SubscriptionStorage;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.orcs.account.admin.internal.OrcsSubscriptionStorage;
import org.eclipse.osee.orcs.db.mock.OsgiService;
@@ -34,7 +32,6 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.TestName;
import org.junit.rules.TestRule;
-import org.mockito.Mock;
/**
* Test Case for {@link OrcsSubscriptionStorage}
@@ -60,11 +57,6 @@ public class OrcsSubscriptionStorageTest {
@OsgiService
private AccountStorage accountStorage;
- // @formatter:off
- @Mock private CreateAccountRequest request;
- @Mock private AccountPreferences preferences;
- // @formatter:on
-
private String name;
private String email;
private String username;
@@ -89,12 +81,8 @@ public class OrcsSubscriptionStorageTest {
prefs.put("b", "2");
prefs.put("c", "true");
- when(request.getDisplayName()).thenReturn(name);
- when(request.getEmail()).thenReturn(email);
- when(request.getUserName()).thenReturn(username);
- when(request.getPreferences()).thenReturn(prefs);
- when(request.isActive()).thenReturn(active);
-
+ CreateAccountRequest request =
+ new CreateAccountRequestBuilder.CreateAccountRequestImpl(active, username, email, name, prefs);
newAccountId = accountStorage.createAccount(request);
}
@@ -108,17 +96,17 @@ public class OrcsSubscriptionStorageTest {
assertEquals(false, storage.subscriptionGroupNameExists(SUBSCRIPTION_GROUP_NAME));
SubscriptionGroupId groupId = storage.createSubscriptionGroup(SUBSCRIPTION_GROUP_NAME);
- assertEquals(true, groupId.getUuid() > 0);
+ assertEquals(true, groupId.getId() > 0);
assertEquals(true, storage.subscriptionGroupNameExists(SUBSCRIPTION_GROUP_NAME));
SubscriptionGroup group1Id = storage.getSubscriptionGroups().getExactlyOne();
- assertEquals(groupId, group1Id.getId());
+ assertEquals(groupId, group1Id);
ResultSet<Account> members = storage.getMembersOfSubscriptionGroupById(groupId);
assertEquals(true, members.isEmpty());
- ArtifactId artId = TokenFactory.createArtifactId(account.getId());
+ ArtifactId artId = ArtifactId.valueOf(account.getId());
Subscription subscription = storage.getSubscriptionsByAccountId(artId).getExactlyOne();
assertEquals(groupId, subscription.getGroupId());
assertEquals(account.getId(), subscription.getAccountId().getUuid());
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtilTest.java b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtilTest.java
index fc0e904ba4..08402a94ea 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtilTest.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtilTest.java
@@ -16,7 +16,6 @@ import static org.mockito.Mockito.when;
import org.eclipse.osee.account.admin.Subscription;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.orcs.account.admin.internal.SubscriptionUtil.ActiveDelegate;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.junit.Test;
@@ -29,7 +28,7 @@ import org.mockito.Mockito;
*/
public class SubscriptionUtilTest {
- private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(3242L);
+ private static final ArtifactId ACCOUNT_ID = ArtifactId.valueOf(3242);
private static final String ACCOUNT_NAME = "account-name";
private static final SubscriptionGroupId GROUP_ID = new SubscriptionGroupId(97012L);
@@ -86,7 +85,7 @@ public class SubscriptionUtilTest {
when(accountArt.getName()).thenReturn(ACCOUNT_NAME);
ArtifactReadable subscriptionArt = Mockito.mock(ArtifactReadable.class);
- when(subscriptionArt.getUuid()).thenReturn(GROUP_ID.getUuid());
+ when(subscriptionArt.getUuid()).thenReturn(GROUP_ID.getId());
when(subscriptionArt.getName()).thenReturn(SUBSCRIPTION_NAME);
Subscription actual = SubscriptionUtil.fromArtifactData(accountArt, subscriptionArt, true);
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java
index 556ef82343..661d56f407 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java
@@ -18,7 +18,6 @@ import java.util.concurrent.Callable;
import org.eclipse.osee.account.admin.AccountSession;
import org.eclipse.osee.executor.admin.CancellableCallable;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
import org.eclipse.osee.framework.jdk.core.util.Lib;
@@ -98,7 +97,7 @@ public class AccountSessionDatabaseStore implements AccountSessionStorage {
Date lastAccessedOn = chStmt.getTimestamp("last_accessed_on");
String accessedFrom = chStmt.getString("accessed_from");
String accessDetails = chStmt.getString("access_details");
- ArtifactId artId = TokenFactory.createArtifactId(accountId);
+ ArtifactId artId = ArtifactId.valueOf(accountId);
AccountSession session = factory.newAccountSession(artId, sessionToken, createdOn, lastAccessedOn,
accessedFrom, accessDetails);
list.add(session);
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSubscriptionGroupImpl.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSubscriptionGroupImpl.java
index b32e89353f..b60f6c6a10 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSubscriptionGroupImpl.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSubscriptionGroupImpl.java
@@ -13,26 +13,26 @@ package org.eclipse.osee.orcs.account.admin.internal;
import org.eclipse.osee.account.admin.SubscriptionGroup;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
+import org.eclipse.osee.framework.jdk.core.type.NamedId;
import org.eclipse.osee.orcs.data.ArtifactReadable;
/**
* @author Roberto E. Escobar
*/
-public class AccountSubscriptionGroupImpl extends BaseIdentity<String> implements SubscriptionGroup {
+public class AccountSubscriptionGroupImpl extends NamedId implements SubscriptionGroup {
private static final String NOT_AVAILABLE = "N/A";
private final ArtifactReadable artifact;
private final SubscriptionGroupId id;
public AccountSubscriptionGroupImpl(ArtifactReadable artifact) {
- super(artifact.getGuid());
+ super(artifact.getId(), artifact.getSoleAttributeValue(CoreAttributeTypes.Name, NOT_AVAILABLE));
this.artifact = artifact;
- this.id = new SubscriptionGroupId(artifact.getUuid());
+ this.id = new SubscriptionGroupId(artifact.getId());
}
@Override
- public SubscriptionGroupId getId() {
+ public SubscriptionGroupId getGroupId() {
return id;
}
@@ -46,4 +46,8 @@ public class AccountSubscriptionGroupImpl extends BaseIdentity<String> implement
return "AccountSubscriptionGroupImpl [artifact=" + artifact + "]";
}
-}
+ @Override
+ public String getGuid() {
+ return artifact.getGuid();
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java
index 901f7292f7..9b8d1b8007 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.orcs.account.admin.internal;
+import com.google.common.base.Supplier;
+import com.google.common.base.Suppliers;
import java.io.StringWriter;
import java.util.Collections;
import java.util.Map;
@@ -21,7 +23,6 @@ import org.eclipse.osee.account.admin.CreateAccountRequest;
import org.eclipse.osee.account.admin.ds.AccountStorage;
import org.eclipse.osee.account.rest.model.AccountWebPreferences;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.SystemUser;
@@ -33,8 +34,6 @@ import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.transaction.TransactionBuilder;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
/**
* @author Roberto E. Escobar
@@ -184,7 +183,7 @@ public class OrcsAccountStorage extends AbstractOrcsStorage implements AccountSt
@Override
public AccountSession createAccountSession(String sessionToken, Account account, String remoteAddress, String accessDetails) {
- ArtifactId artId = TokenFactory.createArtifactId(account.getId());
+ ArtifactId artId = ArtifactId.valueOf(account.getId());
AccountSession session = getFactory().newAccountSession(artId, sessionToken, remoteAddress, accessDetails);
try {
sessionStore.createAccountSession(Collections.singleton(session)).call();
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsSubscriptionStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsSubscriptionStorage.java
index 10a07aadd3..b9761d6d42 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsSubscriptionStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsSubscriptionStorage.java
@@ -19,7 +19,6 @@ import org.eclipse.osee.account.admin.SubscriptionGroup;
import org.eclipse.osee.account.admin.ds.SubscriptionStorage;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
@@ -51,7 +50,7 @@ public class OrcsSubscriptionStorage extends AbstractOrcsStorage implements Subs
@Override
public void updateSubscription(Subscription subscription, boolean activate) {
Long intAccountId = subscription.getAccountId().getUuid();
- Long intGroupId = subscription.getGroupId().getUuid();
+ Long intGroupId = subscription.getGroupId().getId();
ArtifactReadable account = newQuery().andUuid(intAccountId).getResults().getExactlyOne();
ArtifactReadable group =
@@ -83,7 +82,7 @@ public class OrcsSubscriptionStorage extends AbstractOrcsStorage implements Subs
public boolean isActive(ArtifactId accountId, SubscriptionGroupId groupId) {
if (wasRun.compareAndSet(false, true)) {
int intAccountId = Long.valueOf(accountId.getUuid()).intValue();
- int intGroupId = Long.valueOf(groupId.getUuid()).intValue();
+ int intGroupId = Long.valueOf(groupId.getId()).intValue();
ArtifactReadable account = newQuery().andUuid(intAccountId).getResults().getExactlyOne();
ArtifactReadable group = newQuery().andUuid(intGroupId).getResults().getExactlyOne();
@@ -119,7 +118,7 @@ public class OrcsSubscriptionStorage extends AbstractOrcsStorage implements Subs
SubscriptionGroup subscriptionGroup = getSubscriptionGroupById(subscriptionId);
if (subscriptionGroup != null) {
- ArtifactId subscriptionAsArtId = TokenFactory.createArtifactId(subscriptionId.getUuid());
+ ArtifactId subscriptionAsArtId = ArtifactId.valueOf(subscriptionId.getId());
String comment = String.format("Delete subscription group [%s]", subscriptionGroup.getName());
TransactionBuilder tx = newTransaction(comment);
tx.deleteArtifact(subscriptionAsArtId);
@@ -132,7 +131,7 @@ public class OrcsSubscriptionStorage extends AbstractOrcsStorage implements Subs
@Override
public SubscriptionGroup getSubscriptionGroupById(SubscriptionGroupId groupId) {
ResultSet<ArtifactReadable> results =
- newQuery().andUuid(groupId.getUuid()).andIsOfType(CoreArtifactTypes.SubscriptionGroup).getResults();
+ newQuery().andUuid(groupId.getId()).andIsOfType(CoreArtifactTypes.SubscriptionGroup).getResults();
return getFactory().newAccountSubscriptionGroupResultSet(results).getExactlyOne();
}
@@ -144,7 +143,7 @@ public class OrcsSubscriptionStorage extends AbstractOrcsStorage implements Subs
@Override
public ResultSet<Account> getSubscriptionMembersById(SubscriptionGroupId groupId) {
- int intGroupId = Long.valueOf(groupId.getUuid()).intValue();
+ int intGroupId = Long.valueOf(groupId.getId()).intValue();
ResultSet<ArtifactReadable> results =
newQuery().andIsOfType(CoreArtifactTypes.User).andRelatedToLocalIds(CoreRelationTypes.Users_Artifact,
intGroupId).getResults();
@@ -154,7 +153,7 @@ public class OrcsSubscriptionStorage extends AbstractOrcsStorage implements Subs
@Override
public ResultSet<Account> getMembersOfSubscriptionGroupById(SubscriptionGroupId subscriptionId) {
ResultSet<ArtifactReadable> results =
- newQuery().andIsOfType(CoreArtifactTypes.SubscriptionGroup).andUuid(subscriptionId.getUuid()).getResults();
+ newQuery().andIsOfType(CoreArtifactTypes.SubscriptionGroup).andUuid(subscriptionId.getId()).getResults();
ArtifactReadable group = results.getOneOrNull();
return getMembers(group);
}
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java
index 395e230a42..7359671677 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/SubscriptionUtil.java
@@ -13,7 +13,6 @@ package org.eclipse.osee.orcs.account.admin.internal;
import org.eclipse.osee.account.admin.Subscription;
import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.NamedIdentity;
import org.eclipse.osee.framework.jdk.core.util.EncryptUtility;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -40,7 +39,7 @@ public final class SubscriptionUtil {
String[] data = decrypted.split(":");
int index = 0;
int accountId = Integer.parseInt(data[index++]);
- ArtifactId artId = TokenFactory.createArtifactId(Long.valueOf(accountId));
+ ArtifactId artId = ArtifactId.valueOf(accountId);
String accountDisplayName = data[index++];
int groupId = Integer.parseInt(data[index++]);
@@ -57,7 +56,7 @@ public final class SubscriptionUtil {
public static Subscription fromArtifactData(ArtifactReadable account, ArtifactReadable subscription, boolean isActive) {
int accountId = account.getLocalId();
- ArtifactId artId = TokenFactory.createArtifactId(Long.valueOf(accountId));
+ ArtifactId artId = ArtifactId.valueOf(accountId);
String accountName = account.getName();
int groupId = subscription.getLocalId();
SubscriptionGroupId subcriptionId = new SubscriptionGroupId((long) groupId);
@@ -120,5 +119,9 @@ public final class SubscriptionUtil {
return "SubscriptionImpl [accountId=" + accountId + ", accountDisplayName=" + accountDisplayName + ", groupId=" + groupId + ", active=" + isActive() + "]";
}
+ @Override
+ public Long getId() {
+ return null;
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java
index 8f1799763e..560be3fffa 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java
@@ -20,12 +20,14 @@ import static org.eclipse.osee.orcs.account.admin.internal.oauth.OAuthTypes.OAUT
import static org.eclipse.osee.orcs.account.admin.internal.oauth.OAuthTypes.OAUTH_CLIENT_PROPERTIES;
import static org.eclipse.osee.orcs.account.admin.internal.oauth.OAuthTypes.OAUTH_CLIENT_WEBSITE_URI;
import static org.eclipse.osee.orcs.account.admin.internal.oauth.OAuthTypes.OAUTH_TYPES;
+import com.google.common.io.InputSupplier;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -40,9 +42,6 @@ import org.eclipse.osee.orcs.search.QueryBuilder;
import org.eclipse.osee.orcs.search.QueryFactory;
import org.eclipse.osee.orcs.transaction.TransactionBuilder;
import org.eclipse.osee.orcs.transaction.TransactionFactory;
-import com.google.common.io.InputSupplier;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
/**
* @author Roberto E. Escobar
@@ -125,7 +124,7 @@ public class ClientStorage {
}
public void update(OseePrincipal principal, OAuthClient data) {
- ArtifactId artId = TokenFactory.createArtifactId(data.getClientUuid());
+ ArtifactId artId = ArtifactId.valueOf(data.getClientUuid());
TransactionBuilder tx = newTransaction(principal, "Update OAuth Client");
tx.setName(artId, data.getApplicationName());
@@ -163,7 +162,7 @@ public class ClientStorage {
}
public void delete(OseePrincipal principal, OAuthClient data) {
- ArtifactId artId = TokenFactory.createArtifactId(data.getClientUuid());
+ ArtifactId artId = ArtifactId.valueOf(data.getClientUuid());
TransactionBuilder tx = newTransaction(principal, "Delete OAuth Client");
tx.deleteArtifact(artId);
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
index 5a9c95faec..91251db447 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.orcs.account.admin.internal.oauth;
import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
import org.eclipse.osee.jaxrs.server.security.JaxRsOAuthStorage;
import org.eclipse.osee.jaxrs.server.security.OAuthClient;
@@ -116,7 +115,7 @@ public class JdbcJaxRsOAuthStorage implements JaxRsOAuthStorage {
boolean exists = clientStorage.exists(client.getClientUuid());
if (exists) {
clientStorage.update(principal, client);
- clientArtId = TokenFactory.createArtifactId(client.getClientUuid());
+ clientArtId = ArtifactId.valueOf(client.getClientUuid());
} else {
clientArtId = clientStorage.insert(principal, client);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
index b36497be26..4ae4130434 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
@@ -21,7 +21,7 @@ import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.RelationSide;
-import org.eclipse.osee.framework.jdk.core.type.Identity;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
@@ -62,7 +62,7 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public boolean matches(Identity<?>... identities) {
+ public boolean matches(Id... identities) {
return getProxiedObject().matches(identities);
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
index 789276e72e..4be0617d60 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.data;
import java.util.Collection;
import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.HasBranch;
import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -27,7 +28,7 @@ import org.eclipse.osee.framework.jdk.core.type.ResultSet;
* @author Roberto E. Escobar
* @author Andrew M. Finkbeiner
*/
-public interface ArtifactReadable extends ArtifactId, HasLocalId<Integer>, HasTransaction, OrcsReadable {
+public interface ArtifactReadable extends ArtifactId, HasLocalId<Integer>, HasTransaction, OrcsReadable, HasBranch {
int getLastModifiedTransaction();

Back to the top