From 8d4e299834c364c4e74614a70cfae3720b176959 Mon Sep 17 00:00:00 2001 From: Angel Avila Date: Thu, 19 Mar 2015 14:38:35 -0700 Subject: feature[ats_ATS146079]: Remove OseeCache Servlet Change-Id: I5df2addcecc5932a5f395fc9531fe74036688d2b Signed-off-by: Angel Avila --- .../core/message/test/AllCoreMessageTestSuite.java | 3 +- .../message/test/data/CacheUpdateRequestTest.java | 41 --- .../core/message/test/data/DataTestSuite.java | 24 -- .../data/TransactionCacheUpdateResponseTest.java | 60 ----- .../core/message/test/mocks/DataAsserts.java | 10 - .../message/test/mocks/MockRequestFactory.java | 13 - .../CacheUpdateRequestTranslatorTest.java | 58 ---- .../DataTranslationServiceFactoryTest.java | 15 -- .../test/translation/TranslationTestSuite.java | 1 - .../core/message/AbstractBranchCacheMessage.java | 70 ----- .../message/ArtifactTypeCacheUpdateResponse.java | 113 -------- .../message/AttributeTypeCacheUpdateResponse.java | 38 --- .../osee/framework/core/message/BranchRow.java | 89 ------- .../framework/core/message/CacheUpdateRequest.java | 42 --- .../message/OseeEnumTypeCacheUpdateResponse.java | 36 --- .../message/RelationTypeCacheUpdateResponse.java | 137 ---------- .../message/TransactionCacheUpdateResponse.java | 43 --- .../internal/DataTranslationServiceFactory.java | 19 -- .../ArtifactTypeCacheUpdateResponseTranslator.java | 71 ----- ...AttributeTypeCacheUpdateResponseTranslator.java | 118 --------- .../translation/CacheUpdateRequestTranslator.java | 63 ----- .../OseeEnumTypeCacheUpdateResponseTranslator.java | 75 ------ .../RelationTypeCacheUpdateResponseTranslator.java | 56 ---- .../framework/core/enums/CoreTranslatorId.java | 11 +- .../manager/servlet/OseeCacheServlet.java | 292 --------------------- .../internal/ServletRegistrationHandler.java | 2 - 26 files changed, 2 insertions(+), 1498 deletions(-) delete mode 100644 plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/CacheUpdateRequestTest.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/DataTestSuite.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/TransactionCacheUpdateResponseTest.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/CacheUpdateRequestTranslatorTest.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeTypeCacheUpdateResponse.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/CacheUpdateRequest.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TransactionCacheUpdateResponse.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/AttributeTypeCacheUpdateResponseTranslator.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/CacheUpdateRequestTranslator.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/OseeEnumTypeCacheUpdateResponseTranslator.java delete mode 100644 plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/RelationTypeCacheUpdateResponseTranslator.java delete mode 100644 plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeCacheServlet.java (limited to 'plugins') diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/AllCoreMessageTestSuite.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/AllCoreMessageTestSuite.java index 14cccaf0aca..1854660fec8 100644 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/AllCoreMessageTestSuite.java +++ b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/AllCoreMessageTestSuite.java @@ -10,13 +10,12 @@ *******************************************************************************/ package org.eclipse.osee.framework.core.message.test; -import org.eclipse.osee.framework.core.message.test.data.DataTestSuite; import org.eclipse.osee.framework.core.message.test.translation.TranslationTestSuite; import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) -@Suite.SuiteClasses({DataTestSuite.class, TranslationTestSuite.class,}) +@Suite.SuiteClasses({TranslationTestSuite.class}) /** * @author Roberto E. Escobar */ diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/CacheUpdateRequestTest.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/CacheUpdateRequestTest.java deleted file mode 100644 index 3f12f587c22..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/CacheUpdateRequestTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.message.test.data; - -import java.util.Arrays; -import java.util.List; -import org.junit.Assert; -import org.eclipse.osee.framework.core.enums.OseeCacheEnum; -import org.eclipse.osee.framework.core.message.CacheUpdateRequest; -import org.junit.Test; - -/** - * Test Case for {@link CacheUpdateRequest} - * - * @author Roberto E. Escobar - */ -public class CacheUpdateRequestTest { - - @Test - public void testNoGuids() { - CacheUpdateRequest request = new CacheUpdateRequest(OseeCacheEnum.ARTIFACT_TYPE_CACHE); - Assert.assertEquals(OseeCacheEnum.ARTIFACT_TYPE_CACHE, request.getCacheId()); - Assert.assertTrue(request.getItemsIds().isEmpty()); - } - - @Test - public void testWithGuids() { - List guids = Arrays.asList(45, 55); - CacheUpdateRequest request = new CacheUpdateRequest(OseeCacheEnum.ATTRIBUTE_TYPE_CACHE, guids); - Assert.assertEquals(OseeCacheEnum.ATTRIBUTE_TYPE_CACHE, request.getCacheId()); - Assert.assertEquals(guids, request.getItemsIds()); - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/DataTestSuite.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/DataTestSuite.java deleted file mode 100644 index c59cf11c895..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/DataTestSuite.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.message.test.data; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({CacheUpdateRequestTest.class, TransactionCacheUpdateResponseTest.class,}) -/** - * @author Roberto E. Escobar - */ -public class DataTestSuite { - // Test Suite -} diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/TransactionCacheUpdateResponseTest.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/TransactionCacheUpdateResponseTest.java deleted file mode 100644 index 665287183af..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/data/TransactionCacheUpdateResponseTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.message.test.data; - -import java.util.ArrayList; -import java.util.List; -import org.eclipse.osee.framework.core.message.TransactionCacheUpdateResponse; -import org.eclipse.osee.framework.core.message.test.mocks.DataAsserts; -import org.eclipse.osee.framework.core.message.test.mocks.MockDataFactory; -import org.eclipse.osee.framework.core.model.TransactionRecord; -import org.eclipse.osee.framework.core.model.TransactionRecordFactory; -import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; -import org.eclipse.osee.framework.jdk.core.util.Compare; -import org.junit.Assert; -import org.junit.Test; - -/** - * Test Case for {@link TransactionCacheUpdateResponse} - * - * @author Roberto E. Escobar - */ -public class TransactionCacheUpdateResponseTest { - - @Test - public void testGetRows() { - List expected = new ArrayList(); - for (int j = 1; j <= 2; j++) { - expected.add(MockDataFactory.createTransaction(j, j * 3)); - } - - TransactionCacheUpdateResponse response = new TransactionCacheUpdateResponse(expected); - List actual = response.getTxRows(); - Assert.assertFalse(Compare.isDifferent(expected, actual)); - } - - @Test - public void testFromCache() throws OseeCoreException { - - List data = new ArrayList(); - for (int j = 1; j <= 2; j++) { - data.add(MockDataFactory.createTransaction(j, j * 3)); - } - - TransactionRecordFactory factory = new TransactionRecordFactory(); - TransactionCacheUpdateResponse response = TransactionCacheUpdateResponse.fromCache(factory, data); - List actual = response.getTxRows(); - Assert.assertEquals(data.size(), actual.size()); - for (int index = 0; index < data.size(); index++) { - DataAsserts.assertEquals(data.get(index), actual.get(index)); - } - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/mocks/DataAsserts.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/mocks/DataAsserts.java index 80328dfa098..63e0741e076 100644 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/mocks/DataAsserts.java +++ b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/mocks/DataAsserts.java @@ -11,7 +11,6 @@ package org.eclipse.osee.framework.core.message.test.mocks; import java.util.List; -import org.eclipse.osee.framework.core.message.CacheUpdateRequest; import org.eclipse.osee.framework.core.message.DatastoreInitRequest; import org.eclipse.osee.framework.core.model.AbstractOseeType; import org.eclipse.osee.framework.core.model.Branch; @@ -108,15 +107,6 @@ public final class DataAsserts { } } - public static void assertEquals(CacheUpdateRequest expected, CacheUpdateRequest actual) { - if (expected == null) { - Assert.assertNull(actual); - } else { - Assert.assertEquals(expected.getCacheId(), actual.getCacheId()); - Assert.assertFalse(Compare.isDifferent(expected.getItemsIds(), actual.getItemsIds())); - } - } - public static void assertEquals(RelationType expected, RelationType actual) { if (expected == null) { Assert.assertNull(actual); diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/mocks/MockRequestFactory.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/mocks/MockRequestFactory.java index 45b5a180510..6fb418bc4d0 100644 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/mocks/MockRequestFactory.java +++ b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/mocks/MockRequestFactory.java @@ -10,11 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.framework.core.message.test.mocks; -import java.util.ArrayList; -import java.util.List; import org.eclipse.osee.framework.core.enums.ModificationType; -import org.eclipse.osee.framework.core.enums.OseeCacheEnum; -import org.eclipse.osee.framework.core.message.CacheUpdateRequest; import org.eclipse.osee.framework.core.model.BranchFactory; import org.eclipse.osee.framework.core.model.OseeModelFactoryService; import org.eclipse.osee.framework.core.model.TransactionRecordFactory; @@ -62,13 +58,4 @@ public final class MockRequestFactory { changeVersion.setValue("change_version_value_" + index); } - public static CacheUpdateRequest createRequest(int index) { - OseeCacheEnum cacheEnum = OseeCacheEnum.values()[Math.abs(index % OseeCacheEnum.values().length)]; - List guids = new ArrayList(); - for (int j = 1; j <= index * 3; j++) { - guids.add(j * index); - } - return new CacheUpdateRequest(cacheEnum, guids); - } - } diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/CacheUpdateRequestTranslatorTest.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/CacheUpdateRequestTranslatorTest.java deleted file mode 100644 index 604fae17c1b..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/CacheUpdateRequestTranslatorTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.message.test.translation; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.junit.Assert; -import org.eclipse.osee.framework.core.enums.OseeCacheEnum; -import org.eclipse.osee.framework.core.message.CacheUpdateRequest; -import org.eclipse.osee.framework.core.message.internal.translation.CacheUpdateRequestTranslator; -import org.eclipse.osee.framework.core.message.test.mocks.DataAsserts; -import org.eclipse.osee.framework.core.message.test.mocks.MockRequestFactory; -import org.eclipse.osee.framework.core.translation.ITranslator; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; - -/** - * Test Case for {@link CacheUpdateRequestTranslator} - * - * @author Roberto E. Escobar - * @author Jeff C. Phillips - */ -@RunWith(Parameterized.class) -public class CacheUpdateRequestTranslatorTest extends BaseTranslatorTest { - - public CacheUpdateRequestTranslatorTest(CacheUpdateRequest data, ITranslator translator) { - super(data, translator); - } - - @Override - protected void checkEquals(CacheUpdateRequest expected, CacheUpdateRequest actual) { - Assert.assertNotSame(expected, actual); - DataAsserts.assertEquals(expected, actual); - } - - @Parameters - public static Collection data() { - CacheUpdateRequestTranslator translator = new CacheUpdateRequestTranslator(); - - List data = new ArrayList(); - for (int index = 1; index <= 5; index++) { - data.add(new Object[] {MockRequestFactory.createRequest(index), translator}); - } - // - data.add(new Object[] {new CacheUpdateRequest(OseeCacheEnum.ARTIFACT_TYPE_CACHE), translator}); - return data; - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java index 1c1d07d5240..e31f9eda9e0 100644 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java +++ b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java @@ -13,14 +13,9 @@ package org.eclipse.osee.framework.core.message.test.translation; import org.eclipse.osee.framework.core.enums.CoreTranslatorId; import org.eclipse.osee.framework.core.message.internal.DataTranslationService; import org.eclipse.osee.framework.core.message.internal.DataTranslationServiceFactory; -import org.eclipse.osee.framework.core.message.internal.translation.ArtifactTypeCacheUpdateResponseTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.AttributeTypeCacheUpdateResponseTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.CacheUpdateRequestTranslator; import org.eclipse.osee.framework.core.message.internal.translation.DatastoreInitRequestTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.OseeEnumTypeCacheUpdateResponseTranslator; import org.eclipse.osee.framework.core.message.internal.translation.OseeImportModelRequestTranslator; import org.eclipse.osee.framework.core.message.internal.translation.OseeImportModelResponseTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.RelationTypeCacheUpdateResponseTranslator; import org.eclipse.osee.framework.core.message.internal.translation.TableDataTranslator; import org.eclipse.osee.framework.core.model.BranchFactory; import org.eclipse.osee.framework.core.model.TransactionRecordFactory; @@ -49,16 +44,6 @@ public class DataTranslationServiceFactoryTest { srvc.setModelFactory(new MockModelFactoryService()); srvc.start(); - checkExists(srvc, CacheUpdateRequestTranslator.class, CoreTranslatorId.OSEE_CACHE_UPDATE_REQUEST); - checkExists(srvc, ArtifactTypeCacheUpdateResponseTranslator.class, - CoreTranslatorId.ARTIFACT_TYPE_CACHE_UPDATE_RESPONSE); - checkExists(srvc, AttributeTypeCacheUpdateResponseTranslator.class, - CoreTranslatorId.ATTRIBUTE_TYPE_CACHE_UPDATE_RESPONSE); - checkExists(srvc, RelationTypeCacheUpdateResponseTranslator.class, - CoreTranslatorId.RELATION_TYPE_CACHE_UPDATE_RESPONSE); - checkExists(srvc, OseeEnumTypeCacheUpdateResponseTranslator.class, - CoreTranslatorId.OSEE_ENUM_TYPE_CACHE_UPDATE_RESPONSE); - checkExists(srvc, OseeImportModelRequestTranslator.class, CoreTranslatorId.OSEE_IMPORT_MODEL_REQUEST); checkExists(srvc, OseeImportModelResponseTranslator.class, CoreTranslatorId.OSEE_IMPORT_MODEL_RESPONSE); checkExists(srvc, TableDataTranslator.class, CoreTranslatorId.TABLE_DATA); diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TranslationTestSuite.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TranslationTestSuite.java index 1537cd89716..55d909917d5 100644 --- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TranslationTestSuite.java +++ b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/TranslationTestSuite.java @@ -15,7 +15,6 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ - CacheUpdateRequestTranslatorTest.class, DatastoreInitRequestTranslatorTest.class, DataTranslationServiceFactoryTest.class, DataTranslationServiceTest.class, diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java deleted file mode 100644 index 90b2dbe511d..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.message; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.eclipse.osee.framework.jdk.core.type.Triplet; - -/** - * @author Roberto E. Escobar - */ -public abstract class AbstractBranchCacheMessage { - - private final List rows; - private final Map childToParent; - private final Map branchToBaseTx; - private final Map branchToSourceTx; - private final Map branchToAssocArt; - private final Map branchToAliases; - private final List> srcDestMerge; - - protected AbstractBranchCacheMessage() { - this.rows = new ArrayList(); - this.childToParent = new HashMap(); - this.branchToBaseTx = new HashMap(); - this.branchToSourceTx = new HashMap(); - this.branchToAssocArt = new HashMap(); - this.branchToAliases = new HashMap(); - this.srcDestMerge = new ArrayList>(); - } - - public List getBranchRows() { - return rows; - } - - public Map getChildToParent() { - return childToParent; - } - - public Map getBranchToBaseTx() { - return branchToBaseTx; - } - - public Map getBranchToSourceTx() { - return branchToSourceTx; - } - - public Map getBranchToAssocArt() { - return branchToAssocArt; - } - - public Map getBranchAliases() { - return branchToAliases; - } - - public List> getMergeBranches() { - return srcDestMerge; - } - -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java deleted file mode 100644 index 1d868d8fb33..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.message; - -import java.util.List; -import java.util.Map; -import org.eclipse.osee.framework.core.enums.StorageState; -import org.eclipse.osee.framework.jdk.core.type.Triplet; - -/** - * @author Roberto E. Escobar - */ -public class ArtifactTypeCacheUpdateResponse { - - private final List rows; - private final Map baseToSuper; - private final List> artAttrs; - - public ArtifactTypeCacheUpdateResponse(List rows, Map baseToSuper, List> artAttrs) { - this.rows = rows; - this.baseToSuper = baseToSuper; - this.artAttrs = artAttrs; - } - - public List getArtTypeRows() { - return rows; - } - - public Map getBaseToSuperTypes() { - return baseToSuper; - } - - public List> getAttributeTypes() { - return artAttrs; - } - - public static final class ArtifactTypeRow { - private final long id; - private final String name; - private final Long guid; - private final boolean isAbstract; - private StorageState storageState; - - public ArtifactTypeRow(long id, long guid, String name, boolean isAbstract, StorageState storageState) { - this.id = id; - this.guid = guid; - this.name = name; - this.isAbstract = isAbstract; - this.storageState = storageState; - } - - public long getId() { - return id; - } - - public String getName() { - return name; - } - - public Long getGuid() { - return guid; - } - - public boolean isAbstract() { - return isAbstract; - } - - public StorageState getStorageState() { - return storageState; - } - - public void setStorageState(StorageState storageState) { - this.storageState = storageState; - } - - public String[] toArray() { - return new String[] { - String.valueOf(getId()), - String.valueOf(getGuid()), - getName(), - String.valueOf(isAbstract()), - getStorageState().name()}; - } - - public static ArtifactTypeRow fromArray(String[] data) { - long id = Long.valueOf(data[0]); - long remoteId = Long.parseLong(data[1]); - String name = data[2]; - boolean isAbstract = Boolean.valueOf(data[3]); - StorageState storageState = StorageState.valueOf(data[4]); - return new ArtifactTypeRow(id, remoteId, name, isAbstract, storageState); - } - - @Override - public String toString() { - return String.format("%s (%s)", name, guid); - } - } - - @Override - public String toString() { - return "ArtifactTypeCacheUpdateResponse [artAttrs=" + artAttrs + ", baseToSuper=" + baseToSuper + ", rows=" + rows + "]"; - } - -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeTypeCacheUpdateResponse.java deleted file mode 100644 index ec608d0fc48..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeTypeCacheUpdateResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.message; - -import java.util.List; -import java.util.Map; -import org.eclipse.osee.framework.core.model.type.AttributeType; - -/** - * @author Roberto E. Escobar - */ -public class AttributeTypeCacheUpdateResponse { - - private final List rows; - private final Map attrToEnum; - - public AttributeTypeCacheUpdateResponse(List rows, Map attrToEnum) { - this.rows = rows; - this.attrToEnum = attrToEnum; - } - - public List getAttrTypeRows() { - return rows; - } - - public Map getAttrToEnums() { - return attrToEnum; - } - -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java deleted file mode 100644 index c3d58f07c2a..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 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.message; - -import org.eclipse.osee.framework.core.enums.BranchArchivedState; -import org.eclipse.osee.framework.core.enums.BranchState; -import org.eclipse.osee.framework.core.enums.BranchType; -import org.eclipse.osee.framework.core.enums.StorageState; - -public final class BranchRow { - private final long branchUuid; - - private final String branchName; - private final BranchType branchType; - private final BranchState branchState; - private final BranchArchivedState branchArchived; - private final StorageState storageState; - private final boolean inheritAccessControl; - - public BranchRow(long branchUuid, String branchName, BranchType branchType, BranchState branchState, BranchArchivedState branchArchived, StorageState storageState, boolean inheritAccessControl) { - this.branchUuid = branchUuid; - this.branchName = branchName; - this.branchType = branchType; - this.branchState = branchState; - this.branchArchived = branchArchived; - this.storageState = storageState; - this.inheritAccessControl = inheritAccessControl; - } - - public long getBranchId() { - return branchUuid; - } - - public String getBranchName() { - return branchName; - } - - public BranchType getBranchType() { - return branchType; - } - - public BranchState getBranchState() { - return branchState; - } - - public BranchArchivedState getBranchArchived() { - return branchArchived; - } - - public StorageState getStorageState() { - return storageState; - } - - public boolean isInheritAccessControl() { - return inheritAccessControl; - } - - public String[] toArray() { - return new String[] { - getBranchArchived().name(), - String.valueOf(getBranchId()), - getBranchName(), - getBranchState().name(), - getBranchType().name(), - getStorageState().name(), - Boolean.toString(isInheritAccessControl())}; - } - - public static BranchRow fromArray(String[] data) { - BranchArchivedState archived = BranchArchivedState.valueOf(data[0]); - long branchUuid = Long.valueOf(data[1]); - String branchName = data[2]; - BranchState branchState = BranchState.valueOf(data[3]); - BranchType branchType = BranchType.valueOf(data[4]); - StorageState storageState = StorageState.valueOf(data[5]); - boolean inheritAccessControl = Boolean.parseBoolean(data[6]); - return new BranchRow(branchUuid, branchName, branchType, branchState, archived, storageState, - inheritAccessControl); - } - -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/CacheUpdateRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/CacheUpdateRequest.java deleted file mode 100644 index fc0c0661e3c..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/CacheUpdateRequest.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.message; - -import java.util.Collection; -import java.util.Collections; -import org.eclipse.osee.framework.core.enums.OseeCacheEnum; - -/** - * @author Roberto E. Escobar - * @author Jeff C. Phillips - */ -public class CacheUpdateRequest { - - private final OseeCacheEnum cacheId; - private final Collection itemsIds; - - public CacheUpdateRequest(OseeCacheEnum cacheId) { - this(cacheId, Collections. emptyList()); - } - - public CacheUpdateRequest(OseeCacheEnum cacheId, Collection itemsIds) { - this.cacheId = cacheId; - this.itemsIds = itemsIds; - } - - public OseeCacheEnum getCacheId() { - return cacheId; - } - - public Collection getItemsIds() { - return itemsIds; - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java deleted file mode 100644 index b3285038c4d..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.message; - -import java.util.List; - -/** - * @author Roberto E. Escobar - * @author Ryan D. Brooks - */ -public class OseeEnumTypeCacheUpdateResponse { - private final List enumTypeRows; - private final List enumEntryRows; - - public OseeEnumTypeCacheUpdateResponse(List enumTypeRows, List enumEntryRows) { - this.enumTypeRows = enumTypeRows; - this.enumEntryRows = enumEntryRows; - } - - public List getEnumTypeRows() { - return enumTypeRows; - } - - public List getEnumEntryRows() { - return enumEntryRows; - } - -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java deleted file mode 100644 index 2f49b81a143..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.message; - -import java.util.List; -import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity; -import org.eclipse.osee.framework.core.enums.StorageState; - -/** - * @author Roberto E. Escobar - */ -public class RelationTypeCacheUpdateResponse { - - private final List rows; - - public RelationTypeCacheUpdateResponse(List rows) { - this.rows = rows; - } - - public List getRelationTypeRows() { - return rows; - } - - public static final class RelationTypeRow { - private final long id; - private final String name; - private final long guid; - private StorageState storageState; - - private final String sideAName; - private final String sideBName; - private final long artifactTypeSideA; - private final long artifactTypeSideB; - private final RelationTypeMultiplicity multiplicity; - private final String defaultOrderTypeGuid; - - public RelationTypeRow(long id, String name, long guid, StorageState storageState, String sideAName, String sideBName, long artifactTypeSideA, long artifactTypeSideB, RelationTypeMultiplicity multiplicity, String defaultOrderTypeGuid) { - super(); - this.id = id; - this.name = name; - this.guid = guid; - this.storageState = storageState; - this.sideAName = sideAName; - this.sideBName = sideBName; - this.artifactTypeSideA = artifactTypeSideA; - this.artifactTypeSideB = artifactTypeSideB; - this.multiplicity = multiplicity; - this.defaultOrderTypeGuid = defaultOrderTypeGuid; - } - - public long getArtifactTypeSideA() { - return artifactTypeSideA; - } - - public long getArtifactTypeSideB() { - return artifactTypeSideB; - } - - public long getId() { - return id; - } - - public String getName() { - return name; - } - - public long getGuid() { - return guid; - } - - public StorageState getStorageState() { - return storageState; - } - - public void setStorageState(StorageState storageState) { - this.storageState = storageState; - } - - public String getSideBName() { - return sideBName; - } - - public String getSideAName() { - return sideAName; - } - - public String getDefaultOrderTypeGuid() { - return defaultOrderTypeGuid; - } - - public RelationTypeMultiplicity getMultiplicity() { - return multiplicity; - } - - public String[] toArray() { - return new String[] { - String.valueOf(getId()), - String.valueOf(getGuid()), - getName(), - getStorageState().name(), - getSideAName(), - getSideBName(), - String.valueOf(getArtifactTypeSideA()), - String.valueOf(getArtifactTypeSideB()), - getMultiplicity().name(), - getDefaultOrderTypeGuid()}; - } - - public static RelationTypeRow fromArray(String[] data) { - int index = 0; - - long id = Long.valueOf(data[index++]); - long guid = Long.valueOf(data[index++]); - String name = data[index++]; - StorageState storageState = StorageState.valueOf(data[index++]); - - String sideAName = data[index++]; - String sideBName = data[index++]; - long artifactTypeSideA = Long.valueOf(data[index++]); - long artifactTypeSideB = Long.valueOf(data[index++]); - RelationTypeMultiplicity multiplicity = RelationTypeMultiplicity.valueOf(data[index++]); - String defaultOrderTypeGuid = data[index++]; - - return new RelationTypeRow(id, name, guid, storageState, sideAName, sideBName, artifactTypeSideA, - artifactTypeSideB, multiplicity, defaultOrderTypeGuid); - } - } - -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TransactionCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TransactionCacheUpdateResponse.java deleted file mode 100644 index 7b2bd954725..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TransactionCacheUpdateResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.message; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.eclipse.osee.framework.core.model.TransactionRecord; -import org.eclipse.osee.framework.core.model.TransactionRecordFactory; -import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; - -/** - * @author Roberto E. Escobar - */ -public class TransactionCacheUpdateResponse { - - private final List rows; - - public TransactionCacheUpdateResponse(List rows) { - this.rows = rows; - } - - public List getTxRows() { - return rows; - } - - public static TransactionCacheUpdateResponse fromCache(TransactionRecordFactory factory, Collection types) throws OseeCoreException { - List rows = new ArrayList(); - for (TransactionRecord tx : types) { - rows.add(factory.create(tx.getId(), tx.getBranchId(), tx.getComment(), tx.getTimeStamp(), tx.getAuthor(), - tx.getCommit(), tx.getTxType(), null)); - } - return new TransactionCacheUpdateResponse(rows); - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java index d6e70b3381b..576127312dd 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java @@ -11,14 +11,9 @@ package org.eclipse.osee.framework.core.message.internal; import org.eclipse.osee.framework.core.enums.CoreTranslatorId; -import org.eclipse.osee.framework.core.message.internal.translation.ArtifactTypeCacheUpdateResponseTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.AttributeTypeCacheUpdateResponseTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.CacheUpdateRequestTranslator; import org.eclipse.osee.framework.core.message.internal.translation.DatastoreInitRequestTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.OseeEnumTypeCacheUpdateResponseTranslator; import org.eclipse.osee.framework.core.message.internal.translation.OseeImportModelRequestTranslator; import org.eclipse.osee.framework.core.message.internal.translation.OseeImportModelResponseTranslator; -import org.eclipse.osee.framework.core.message.internal.translation.RelationTypeCacheUpdateResponseTranslator; import org.eclipse.osee.framework.core.message.internal.translation.TableDataTranslator; import org.eclipse.osee.framework.core.model.type.AttributeTypeFactory; import org.eclipse.osee.framework.core.translation.IDataTranslationService; @@ -35,20 +30,6 @@ public class DataTranslationServiceFactory { } public void configureService(IDataTranslationService service, AttributeTypeFactory attributeTypeFactory) throws OseeCoreException { - service.addTranslator(new CacheUpdateRequestTranslator(), CoreTranslatorId.OSEE_CACHE_UPDATE_REQUEST); - - service.addTranslator(new ArtifactTypeCacheUpdateResponseTranslator(), - CoreTranslatorId.ARTIFACT_TYPE_CACHE_UPDATE_RESPONSE); - - service.addTranslator(new AttributeTypeCacheUpdateResponseTranslator(attributeTypeFactory), - CoreTranslatorId.ATTRIBUTE_TYPE_CACHE_UPDATE_RESPONSE); - - service.addTranslator(new RelationTypeCacheUpdateResponseTranslator(), - CoreTranslatorId.RELATION_TYPE_CACHE_UPDATE_RESPONSE); - - service.addTranslator(new OseeEnumTypeCacheUpdateResponseTranslator(), - CoreTranslatorId.OSEE_ENUM_TYPE_CACHE_UPDATE_RESPONSE); - service.addTranslator(new OseeImportModelRequestTranslator(), CoreTranslatorId.OSEE_IMPORT_MODEL_REQUEST); service.addTranslator(new OseeImportModelResponseTranslator(service), CoreTranslatorId.OSEE_IMPORT_MODEL_RESPONSE); service.addTranslator(new TableDataTranslator(), CoreTranslatorId.TABLE_DATA); diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java deleted file mode 100644 index fd67c6bd356..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.message.internal.translation; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.eclipse.osee.framework.core.message.ArtifactTypeCacheUpdateResponse; -import org.eclipse.osee.framework.core.message.ArtifactTypeCacheUpdateResponse.ArtifactTypeRow; -import org.eclipse.osee.framework.core.message.TranslationUtil; -import org.eclipse.osee.framework.core.translation.ITranslator; -import org.eclipse.osee.framework.jdk.core.type.PropertyStore; -import org.eclipse.osee.framework.jdk.core.type.Triplet; - -/** - * @author Roberto E. Escobar - */ -public class ArtifactTypeCacheUpdateResponseTranslator implements ITranslator { - - private static enum Fields { - ITEM_COUNT, - ITEM_ROW, - BASE_TO_SUPER_TYPES, - BASE_BRANCH_ATTR; - } - - @Override - public ArtifactTypeCacheUpdateResponse convert(PropertyStore store) { - List rows = new ArrayList(); - Map baseToSuper = new HashMap(); - List> artAttrs = new ArrayList>(); - - int rowCount = store.getInt(Fields.ITEM_COUNT.name()); - for (int index = 0; index < rowCount; index++) { - String[] rowData = store.getArray(createKey(Fields.ITEM_ROW, index)); - rows.add(ArtifactTypeRow.fromArray(rowData)); - } - - TranslationUtil.loadLongArrayMap(baseToSuper, store, Fields.BASE_TO_SUPER_TYPES); - TranslationUtil.loadTripletLongList(artAttrs, store, Fields.BASE_BRANCH_ATTR); - return new ArtifactTypeCacheUpdateResponse(rows, baseToSuper, artAttrs); - } - - @Override - public PropertyStore convert(ArtifactTypeCacheUpdateResponse object) { - PropertyStore store = new PropertyStore(); - List rows = object.getArtTypeRows(); - for (int index = 0; index < rows.size(); index++) { - ArtifactTypeRow row = rows.get(index); - store.put(createKey(Fields.ITEM_ROW, index), row.toArray()); - } - store.put(Fields.ITEM_COUNT.name(), rows.size()); - - TranslationUtil.putLongArrayMap(store, Fields.BASE_TO_SUPER_TYPES, object.getBaseToSuperTypes()); - TranslationUtil.putTripletLongList(store, Fields.BASE_BRANCH_ATTR, object.getAttributeTypes()); - return store; - } - - private String createKey(Fields key, int index) { - return String.format("%s_%s", key.name(), index); - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/AttributeTypeCacheUpdateResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/AttributeTypeCacheUpdateResponseTranslator.java deleted file mode 100644 index 87ca0027e59..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/AttributeTypeCacheUpdateResponseTranslator.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.message.internal.translation; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.eclipse.osee.framework.core.enums.StorageState; -import org.eclipse.osee.framework.core.message.AttributeTypeCacheUpdateResponse; -import org.eclipse.osee.framework.core.message.TranslationUtil; -import org.eclipse.osee.framework.core.model.type.AttributeType; -import org.eclipse.osee.framework.core.model.type.AttributeTypeFactory; -import org.eclipse.osee.framework.core.translation.ITranslator; -import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; -import org.eclipse.osee.framework.jdk.core.type.PropertyStore; - -/** - * @author Roberto E. Escobar - */ -public class AttributeTypeCacheUpdateResponseTranslator implements ITranslator { - - private static enum Fields { - ROW_COUNT, - ROW, - ATTR_TO_ENUM; - } - - private final AttributeTypeFactory attributeTypeFactory; - - public AttributeTypeCacheUpdateResponseTranslator(AttributeTypeFactory attributeTypeFactory) { - this.attributeTypeFactory = attributeTypeFactory; - } - - private AttributeTypeFactory getFactory() { - return attributeTypeFactory; - } - - @Override - public AttributeTypeCacheUpdateResponse convert(PropertyStore store) throws OseeCoreException { - List rows = new ArrayList(); - int rowCount = store.getInt(Fields.ROW_COUNT.name()); - AttributeTypeFactory factory = getFactory(); - for (int index = 0; index < rowCount; index++) { - String[] rowData = store.getArray(createKey(Fields.ROW, index)); - rows.add(createfromArray(factory, rowData)); - } - Map attrToEnum = new HashMap(); - TranslationUtil.loadMapLong(attrToEnum, store, Fields.ATTR_TO_ENUM); - return new AttributeTypeCacheUpdateResponse(rows, attrToEnum); - } - - @Override - public PropertyStore convert(AttributeTypeCacheUpdateResponse object) { - PropertyStore store = new PropertyStore(); - List rows = object.getAttrTypeRows(); - for (int index = 0; index < rows.size(); index++) { - AttributeType row = rows.get(index); - store.put(createKey(Fields.ROW, index), toArray(row)); - } - store.put(Fields.ROW_COUNT.name(), rows.size()); - - TranslationUtil.putMapLong(store, Fields.ATTR_TO_ENUM, object.getAttrToEnums()); - return store; - } - - private String createKey(Fields key, int index) { - return String.format("%s_%s", key.name(), index); - } - - private String[] toArray(AttributeType type) { - return new String[] { - type.getAttributeProviderId(), - type.getBaseAttributeTypeId(), - type.getDefaultValue(), - type.getDescription(), - type.getFileTypeExtension(), - String.valueOf(type.getGuid()), - String.valueOf(type.getId()), - String.valueOf(type.getMaxOccurrences()), - String.valueOf(type.getMinOccurrences()), - type.getStorageState().name(), - type.getName(), - type.getTaggerId(), - type.getMediaType()}; - } - - private AttributeType createfromArray(AttributeTypeFactory factory, String[] data) throws OseeCoreException { - String attributeProviderId = data[0]; - String baseAttributeTypeId = data[1]; - String defaultValue = data[2]; - String description = data[3]; - String fileTypeExtension = data[4]; - long remoteId = Long.valueOf(data[5]); - long uniqueId = Long.valueOf(data[6]); - int maxOccurrences = Integer.valueOf(data[7]); - int minOccurrences = Integer.valueOf(data[8]); - StorageState storageState = StorageState.valueOf(data[9]); - String name = data[10]; - String taggerId = data[11]; - String mediaType = data[12]; - - AttributeType type = - factory.create(remoteId, name, baseAttributeTypeId, attributeProviderId, fileTypeExtension, defaultValue, - minOccurrences, maxOccurrences, description, taggerId, mediaType); - type.setId(uniqueId); - type.setStorageState(storageState); - return type; - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/CacheUpdateRequestTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/CacheUpdateRequestTranslator.java deleted file mode 100644 index 24177477dfe..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/CacheUpdateRequestTranslator.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 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.message.internal.translation; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.eclipse.osee.framework.core.enums.OseeCacheEnum; -import org.eclipse.osee.framework.core.message.CacheUpdateRequest; -import org.eclipse.osee.framework.core.translation.ITranslator; -import org.eclipse.osee.framework.jdk.core.type.PropertyStore; - -/** - * @author Roberto E. Escobar - * @author Jeff C. Phillips - */ -public class CacheUpdateRequestTranslator implements ITranslator { - - private static enum Entry { - CACHE_ID, - ITEM_IDS; - } - - @Override - public CacheUpdateRequest convert(PropertyStore propertyStore) { - OseeCacheEnum cacheId = OseeCacheEnum.valueOf(propertyStore.get(Entry.CACHE_ID.name())); - String[] itemId = propertyStore.getArray(Entry.ITEM_IDS.name()); - List itemIds = new ArrayList(); - if (itemId != null && itemId.length > 0) { - for (String item : itemId) { - if (item != null) { - itemIds.add(Integer.valueOf(item)); - } - } - } - return new CacheUpdateRequest(cacheId, itemIds); - } - - @Override - public PropertyStore convert(CacheUpdateRequest object) { - PropertyStore store = new PropertyStore(); - - store.put(Entry.CACHE_ID.name(), object.getCacheId().name()); - Collection itemIds = object.getItemsIds(); - if (!itemIds.isEmpty()) { - String[] itemStr = new String[itemIds.size()]; - int index = 0; - for (Integer item : itemIds) { - itemStr[index++] = String.valueOf(item); - } - store.put(Entry.ITEM_IDS.name(), itemStr); - } - return store; - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/OseeEnumTypeCacheUpdateResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/OseeEnumTypeCacheUpdateResponseTranslator.java deleted file mode 100644 index cd96699e685..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/OseeEnumTypeCacheUpdateResponseTranslator.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.message.internal.translation; - -import java.util.ArrayList; -import java.util.List; -import org.eclipse.osee.framework.core.message.OseeEnumTypeCacheUpdateResponse; -import org.eclipse.osee.framework.core.translation.ITranslator; -import org.eclipse.osee.framework.jdk.core.type.PropertyStore; - -/** - * @author Roberto E. Escobar - */ -public class OseeEnumTypeCacheUpdateResponseTranslator implements ITranslator { - - private static enum Fields { - ENUM_TYPE_ROW, - ENUM_TYPE_COUNT, - ENUM_ENTRY_ROW, - ENUM_ENTRY_COUNT; - } - - @Override - public OseeEnumTypeCacheUpdateResponse convert(PropertyStore store) { - - int enumTypeRowCount = store.getInt(Fields.ENUM_TYPE_COUNT.name()); - List enumTypeRows = new ArrayList(enumTypeRowCount); - - for (int index = 0; index < enumTypeRowCount; index++) { - String[] rowData = store.getArray(createKey(Fields.ENUM_TYPE_ROW, index)); - enumTypeRows.add(rowData); - } - - int enumEntryRowCount = store.getInt(Fields.ENUM_ENTRY_COUNT.name()); - List enumEntryRows = new ArrayList(enumEntryRowCount); - - for (int index = 0; index < enumEntryRowCount; index++) { - String[] rowData = store.getArray(createKey(Fields.ENUM_ENTRY_ROW, index)); - enumEntryRows.add(rowData); - } - - return new OseeEnumTypeCacheUpdateResponse(enumTypeRows, enumEntryRows); - } - - @Override - public PropertyStore convert(OseeEnumTypeCacheUpdateResponse response) { - PropertyStore store = new PropertyStore(); - - List enumTypeRows = response.getEnumTypeRows(); - for (int index = 0; index < enumTypeRows.size(); index++) { - store.put(createKey(Fields.ENUM_TYPE_ROW, index), enumTypeRows.get(index)); - } - store.put(Fields.ENUM_TYPE_COUNT.name(), enumTypeRows.size()); - - List enumEntryRows = response.getEnumEntryRows(); - for (int index = 0; index < enumEntryRows.size(); index++) { - store.put(createKey(Fields.ENUM_ENTRY_ROW, index), enumEntryRows.get(index)); - } - store.put(Fields.ENUM_ENTRY_COUNT.name(), enumEntryRows.size()); - - return store; - } - - private String createKey(Fields key, int index) { - return String.format("%s_%s", key.name(), index); - } -} diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/RelationTypeCacheUpdateResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/RelationTypeCacheUpdateResponseTranslator.java deleted file mode 100644 index 2caf117500d..00000000000 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/RelationTypeCacheUpdateResponseTranslator.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.message.internal.translation; - -import java.util.ArrayList; -import java.util.List; -import org.eclipse.osee.framework.core.message.RelationTypeCacheUpdateResponse; -import org.eclipse.osee.framework.core.message.RelationTypeCacheUpdateResponse.RelationTypeRow; -import org.eclipse.osee.framework.core.translation.ITranslator; -import org.eclipse.osee.framework.jdk.core.type.PropertyStore; - -/** - * @author Roberto E. Escobar - */ -public class RelationTypeCacheUpdateResponseTranslator implements ITranslator { - - private static enum Fields { - COUNT, - ROW - } - - @Override - public RelationTypeCacheUpdateResponse convert(PropertyStore store) { - List rows = new ArrayList(); - int rowCount = store.getInt(Fields.COUNT.name()); - for (int index = 0; index < rowCount; index++) { - String[] rowData = store.getArray(createKey(Fields.ROW, index)); - rows.add(RelationTypeRow.fromArray(rowData)); - } - return new RelationTypeCacheUpdateResponse(rows); - } - - @Override - public PropertyStore convert(RelationTypeCacheUpdateResponse object) { - PropertyStore store = new PropertyStore(); - List rows = object.getRelationTypeRows(); - for (int index = 0; index < rows.size(); index++) { - RelationTypeRow row = rows.get(index); - store.put(createKey(Fields.ROW, index), row.toArray()); - } - store.put(Fields.COUNT.name(), rows.size()); - return store; - } - - private String createKey(Fields key, int index) { - return String.format("%s_%s", key.name(), index); - } -} diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreTranslatorId.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreTranslatorId.java index 4b5e4df1a09..a56151f6d19 100644 --- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreTranslatorId.java +++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreTranslatorId.java @@ -22,16 +22,7 @@ public enum CoreTranslatorId implements ITranslatorId { OSEE_IMPORT_MODEL_REQUEST, OSEE_IMPORT_MODEL_RESPONSE, - OSEE_CACHE_UPDATE_REQUEST, - ARTIFACT_TYPE_CACHE_UPDATE_RESPONSE, - ATTRIBUTE_TYPE_CACHE_UPDATE_RESPONSE, - RELATION_TYPE_CACHE_UPDATE_RESPONSE, - OSEE_ENUM_TYPE_CACHE_UPDATE_RESPONSE, - - TRANSACTION_RECORD, - TABLE_DATA, - - STATUS_RESPONSE; + TABLE_DATA; @Override public String getKey() { diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeCacheServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeCacheServlet.java deleted file mode 100644 index b60d4884344..00000000000 --- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeCacheServlet.java +++ /dev/null @@ -1,292 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 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.manager.servlet; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; -import org.eclipse.osee.framework.core.data.IRelationType; -import org.eclipse.osee.framework.core.enums.CacheOperation; -import org.eclipse.osee.framework.core.enums.CoreTranslatorId; -import org.eclipse.osee.framework.core.enums.OseeCacheEnum; -import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity; -import org.eclipse.osee.framework.core.enums.StorageState; -import org.eclipse.osee.framework.core.exception.OseeExceptions; -import org.eclipse.osee.framework.core.message.ArtifactTypeCacheUpdateResponse; -import org.eclipse.osee.framework.core.message.ArtifactTypeCacheUpdateResponse.ArtifactTypeRow; -import org.eclipse.osee.framework.core.message.AttributeTypeCacheUpdateResponse; -import org.eclipse.osee.framework.core.message.CacheUpdateRequest; -import org.eclipse.osee.framework.core.message.OseeEnumTypeCacheUpdateResponse; -import org.eclipse.osee.framework.core.message.RelationTypeCacheUpdateResponse; -import org.eclipse.osee.framework.core.message.RelationTypeCacheUpdateResponse.RelationTypeRow; -import org.eclipse.osee.framework.core.model.type.AttributeType; -import org.eclipse.osee.framework.core.server.UnsecuredOseeHttpServlet; -import org.eclipse.osee.framework.core.translation.IDataTranslationService; -import org.eclipse.osee.framework.core.translation.ITranslatorId; -import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException; -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.Triplet; -import org.eclipse.osee.framework.jdk.core.util.Lib; -import org.eclipse.osee.framework.manager.servlet.internal.ApplicationContextFactory; -import org.eclipse.osee.logger.Log; -import org.eclipse.osee.orcs.ApplicationContext; -import org.eclipse.osee.orcs.OrcsApi; -import org.eclipse.osee.orcs.OrcsTypes; -import org.eclipse.osee.orcs.data.ArtifactTypes; -import org.eclipse.osee.orcs.data.AttributeTypes; -import org.eclipse.osee.orcs.data.EnumEntry; -import org.eclipse.osee.orcs.data.EnumType; -import org.eclipse.osee.orcs.data.EnumTypes; -import org.eclipse.osee.orcs.data.RelationTypes; - -/** - * @author Roberto E. Escobar - */ -public class OseeCacheServlet extends UnsecuredOseeHttpServlet { - - private static final long serialVersionUID = 6693534844874109524L; - private final IDataTranslationService translationService; - private final OrcsApi orcsApi; - private static final StorageState DEFAULT_STORAGE_STATE = StorageState.CREATED; - - public OseeCacheServlet(Log logger, IDataTranslationService translationService, OrcsApi orcsApi) { - super(logger); - this.translationService = translationService; - this.orcsApi = orcsApi; - } - - public IDataTranslationService getTranslationService() { - return translationService; - } - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) { - OseeCacheEnum cacheId = OseeCacheEnum.valueOf(req.getParameter("cacheId")); - try { - IDataTranslationService service = getTranslationService(); - ApplicationContext context = createAppContext(req); - OrcsTypes orcsTypes = orcsApi.getOrcsTypes(context); - Pair pair = createResponse(new CacheUpdateRequest(cacheId), orcsTypes); - resp.setStatus(HttpServletResponse.SC_ACCEPTED); - resp.setContentType("text/xml"); - resp.setCharacterEncoding("UTF-8"); - InputStream inputStream = service.convertToStream(pair.getFirst(), pair.getSecond()); - OutputStream outputStream = resp.getOutputStream(); - Lib.inputStreamToOutputStream(inputStream, outputStream); - } catch (Exception ex) { - getLogger().error(ex, "Error acquiring cache [%s]", cacheId); - } - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { - try { - CacheOperation operation = CacheOperation.fromString(req.getParameter("function")); - switch (operation) { - case UPDATE: - ApplicationContext context = createAppContext(req); - OrcsTypes orcsTypes = orcsApi.getOrcsTypes(context); - sendUpdates(req, resp, orcsTypes); - break; - default: - throw new UnsupportedOperationException(); - } - } catch (Exception ex) { - handleError(resp, req.toString(), ex); - } - } - - private ApplicationContext createAppContext(HttpServletRequest req) { - String sessionId = req.getParameter("sessionId"); - return ApplicationContextFactory.createContext(sessionId); - } - - private void handleError(HttpServletResponse resp, String request, Throwable th) throws IOException { - getLogger().error(th, "Osee Cache request error: [%s]", request); - resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); - resp.setContentType("text/plain"); - resp.getWriter().write(Lib.exceptionToString(th)); - resp.getWriter().flush(); - resp.getWriter().close(); - } - - private void sendUpdates(HttpServletRequest req, HttpServletResponse resp, OrcsTypes orcsTypes) throws OseeCoreException { - IDataTranslationService service = getTranslationService(); - - CacheUpdateRequest updateRequest = null; - InputStream inputStream = null; - try { - inputStream = req.getInputStream(); - updateRequest = service.convert(inputStream, CoreTranslatorId.OSEE_CACHE_UPDATE_REQUEST); - } catch (IOException ex) { - OseeExceptions.wrapAndThrow(ex); - } finally { - Lib.close(inputStream); - } - - OutputStream outputStream = null; - try { - Pair pair = createResponse(updateRequest, orcsTypes); - - resp.setStatus(HttpServletResponse.SC_ACCEPTED); - resp.setContentType("text/xml"); - resp.setCharacterEncoding("UTF-8"); - - inputStream = service.convertToStream(pair.getFirst(), pair.getSecond()); - outputStream = resp.getOutputStream(); - Lib.inputStreamToOutputStream(inputStream, outputStream); - } catch (IOException ex) { - OseeExceptions.wrapAndThrow(ex); - } - } - - private Pair createResponse(CacheUpdateRequest updateRequest, OrcsTypes orcsTypes) throws OseeCoreException { - Object response = null; - ITranslatorId transalatorId = null; - switch (updateRequest.getCacheId()) { - case ARTIFACT_TYPE_CACHE: - response = createArtifactTypeCacheUpdateResponse(orcsTypes); - transalatorId = CoreTranslatorId.ARTIFACT_TYPE_CACHE_UPDATE_RESPONSE; - break; - case ATTRIBUTE_TYPE_CACHE: - response = createAttributeTypeCacheUpdateResponse(orcsTypes); - transalatorId = CoreTranslatorId.ATTRIBUTE_TYPE_CACHE_UPDATE_RESPONSE; - break; - case OSEE_ENUM_TYPE_CACHE: - response = createOseeEnumTypeCacheUpdateResponse(orcsTypes); - transalatorId = CoreTranslatorId.OSEE_ENUM_TYPE_CACHE_UPDATE_RESPONSE; - break; - case RELATION_TYPE_CACHE: - response = createRelationTypeCacheUpdateResponse(orcsTypes); - transalatorId = CoreTranslatorId.RELATION_TYPE_CACHE_UPDATE_RESPONSE; - break; - default: - throw new OseeArgumentException("Invalid cacheId [%s]", updateRequest.getCacheId()); - } - return new Pair(response, transalatorId); - } - - private ArtifactTypeCacheUpdateResponse createArtifactTypeCacheUpdateResponse(OrcsTypes orcsTypes) throws OseeCoreException { - List rows = new ArrayList(); - Map baseToSuper = new HashMap(); - List> artAttrs = new ArrayList>(); - ArtifactTypes artTypes = orcsTypes.getArtifactTypes(); - for (IArtifactType artType : artTypes.getAll()) { - long artTypeId = artType.getGuid(); - boolean isAbstract = artTypes.isAbstract(artType); - rows.add(new ArtifactTypeRow(artTypeId, artType.getGuid(), artType.getName(), isAbstract, - DEFAULT_STORAGE_STATE)); - - Collection superTypes = artTypes.getSuperArtifactTypes(artType); - if (!superTypes.isEmpty()) { - Long[] intSuperTypes = new Long[superTypes.size()]; - int index = 0; - for (IArtifactType superType : superTypes) { - intSuperTypes[index++] = superType.getGuid(); - } - baseToSuper.put(artTypeId, intSuperTypes); - } - - Map> allTypes = artTypes.getAllAttributeTypes(artType); - for (Entry> entry : allTypes.entrySet()) { - IOseeBranch branch = entry.getKey(); - Collection attrTypes = entry.getValue(); - for (IAttributeType type : attrTypes) { - artAttrs.add(new Triplet(artType.getGuid(), branch.getUuid(), type.getGuid())); - } - - } - } - return new ArtifactTypeCacheUpdateResponse(rows, baseToSuper, artAttrs); - } - - private AttributeTypeCacheUpdateResponse createAttributeTypeCacheUpdateResponse(OrcsTypes orcsTypes) throws OseeCoreException { - List rows = new ArrayList(); - Map attrToEnum = new HashMap(); - AttributeTypes attrTypes = orcsTypes.getAttributeTypes(); - for (IAttributeType item : attrTypes.getAll()) { - String baseAttributeTypeId = attrTypes.getBaseAttributeTypeId(item); - String attributeProviderNameId = attrTypes.getAttributeProviderId(item); - String fileTypeExtension = attrTypes.getFileTypeExtension(item); - String defaultValue = attrTypes.getDefaultValue(item); - int minOccurrances = attrTypes.getMinOccurrences(item); - int maxOccurrences = attrTypes.getMaxOccurrences(item); - String description = attrTypes.getDescription(item); - String taggerId = attrTypes.getTaggerId(item); - String mediaType = attrTypes.getMediaType(item); - AttributeType type = - new AttributeType(item.getGuid(), item.getName(), baseAttributeTypeId, attributeProviderNameId, - fileTypeExtension, defaultValue, minOccurrances, maxOccurrences, description, taggerId, mediaType); - - long typeId = item.getGuid(); - type.setId(typeId); - rows.add(type); - - if (attrTypes.isEnumerated(item)) { - EnumType enumType = attrTypes.getEnumType(item); - attrToEnum.put(typeId, enumType.getGuid()); - } - - } - return new AttributeTypeCacheUpdateResponse(rows, attrToEnum); - } - - private RelationTypeCacheUpdateResponse createRelationTypeCacheUpdateResponse(OrcsTypes orcsTypes) throws OseeCoreException { - List rows = new ArrayList(); - RelationTypes relTypes = orcsTypes.getRelationTypes(); - for (IRelationType item : relTypes.getAll()) { - IArtifactType sideAType = relTypes.getArtifactTypeSideA(item); - IArtifactType sideBType = relTypes.getArtifactTypeSideB(item); - - String sideAName = relTypes.getSideAName(item); - String sideBName = relTypes.getSideBName(item); - RelationTypeMultiplicity multiplicity = relTypes.getMultiplicity(item); - String defaultOrderTypeGuid = relTypes.getDefaultOrderTypeGuid(item); - - rows.add(new RelationTypeRow(item.getGuid(), item.getName(), item.getGuid(), DEFAULT_STORAGE_STATE, sideAName, - sideBName, sideAType.getGuid(), sideBType.getGuid(), multiplicity, defaultOrderTypeGuid)); - } - return new RelationTypeCacheUpdateResponse(rows); - } - - private OseeEnumTypeCacheUpdateResponse createOseeEnumTypeCacheUpdateResponse(OrcsTypes orcsTypes) throws OseeCoreException { - List enumTypeRows = new ArrayList(); - List enumEntryRows = new ArrayList(); - EnumTypes enumTypes = orcsTypes.getEnumTypes(); - for (EnumType type : enumTypes.getAll()) { - enumTypeRows.add(new String[] { - String.valueOf(type.getGuid()), - DEFAULT_STORAGE_STATE.toString(), - String.valueOf(type.getGuid()), - type.getName()}); - for (EnumEntry entry : type.values()) { - enumEntryRows.add(new String[] { - String.valueOf(type.getGuid()), - entry.getName(), - String.valueOf(entry.ordinal()), - entry.getDescription()}); - } - } - return new OseeEnumTypeCacheUpdateResponse(enumTypeRows, enumEntryRows); - } -} diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java index 523265b583c..695f4378e44 100644 --- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java +++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java @@ -25,7 +25,6 @@ import org.eclipse.osee.framework.manager.servlet.AtsServlet; import org.eclipse.osee.framework.manager.servlet.BranchExchangeServlet; import org.eclipse.osee.framework.manager.servlet.ConfigurationServlet; import org.eclipse.osee.framework.manager.servlet.DataServlet; -import org.eclipse.osee.framework.manager.servlet.OseeCacheServlet; import org.eclipse.osee.framework.manager.servlet.OseeModelServlet; import org.eclipse.osee.framework.manager.servlet.ResourceManagerServlet; import org.eclipse.osee.framework.manager.servlet.SearchEngineTaggerServlet; @@ -123,7 +122,6 @@ public class ServletRegistrationHandler { register(new SessionManagementServlet(logger, sessionManager, authenticationManager, activityLog), OseeServerContext.SESSION_CONTEXT); register(new SessionClientLoopbackServlet(logger, sessionManager), OseeServerContext.CLIENT_LOOPBACK_CONTEXT); - register(new OseeCacheServlet(logger, translationService, orcsApi), OseeServerContext.CACHE_CONTEXT); register(new OseeModelServlet(logger, sessionManager, translationService, orcsApi), OseeServerContext.OSEE_MODEL_CONTEXT); -- cgit v1.2.3