Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2014-08-26 17:17:15 +0000
committerRoberto E. Escobar2014-10-01 21:03:19 +0000
commit1e8d8d173767d8eddbbfb7d7faf7953a43e47592 (patch)
treecbba44b8467cf3d14b6738b1036dd76873f9a6b5 /plugins/org.eclipse.osee.framework.core.message/src/org
parent4a2589ece3b57889a7df14294cd467fa822e7e7e (diff)
downloadorg.eclipse.osee-1e8d8d173767d8eddbbfb7d7faf7953a43e47592.tar.gz
org.eclipse.osee-1e8d8d173767d8eddbbfb7d7faf7953a43e47592.tar.xz
org.eclipse.osee-1e8d8d173767d8eddbbfb7d7faf7953a43e47592.zip
refactor[ats_ATS46139]: Finish removing BranchCache from server
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.message/src/org')
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCommitResponse.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCommitResponseTranslator.java7
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/TransactionRecordTranslator.java46
4 files changed, 15 insertions, 54 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCommitResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCommitResponse.java
index 87258cb1f3a..e106f5591a6 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCommitResponse.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCommitResponse.java
@@ -10,23 +10,22 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.message;
-import org.eclipse.osee.framework.core.model.TransactionRecord;
/**
* @author Megumi Telles
*/
public class BranchCommitResponse {
- private TransactionRecord transactionRecord;
+ private Integer transactionId;
public BranchCommitResponse() {
- this.transactionRecord = null;
+ this.transactionId = null;
}
- public TransactionRecord getTransaction() {
- return transactionRecord;
+ public Integer getTransactionId() {
+ return transactionId;
}
- public void setTransaction(TransactionRecord transactionRecord) {
- this.transactionRecord = transactionRecord;
+ public void setTransactionId(Integer transactionId) {
+ this.transactionId = transactionId;
}
}
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 b43548fe115..a8b4e85665a 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
@@ -53,8 +53,7 @@ public class DataTranslationServiceFactory {
public void configureService(IDataTranslationService service, TransactionRecordFactory txRecordFactory, AttributeTypeFactory attributeTypeFactory, TempCachingService cachingService) throws OseeCoreException {
BranchCache branchCache = cachingService.getBranchCache();
- service.addTranslator(new TransactionRecordTranslator(txRecordFactory, branchCache),
- CoreTranslatorId.TRANSACTION_RECORD);
+ service.addTranslator(new TransactionRecordTranslator(), CoreTranslatorId.TRANSACTION_RECORD);
service.addTranslator(new BranchCreationRequestTranslator(), CoreTranslatorId.BRANCH_CREATION_REQUEST);
service.addTranslator(new BranchCreationResponseTranslator(), CoreTranslatorId.BRANCH_CREATION_RESPONSE);
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCommitResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCommitResponseTranslator.java
index f2fc422b859..f9c79e4ff7b 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCommitResponseTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCommitResponseTranslator.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.framework.core.message.internal.translation;
import org.eclipse.osee.framework.core.enums.CoreTranslatorId;
import org.eclipse.osee.framework.core.message.BranchCommitResponse;
-import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.core.translation.ITranslator;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -37,15 +36,15 @@ public class BranchCommitResponseTranslator implements ITranslator<BranchCommitR
public BranchCommitResponse convert(PropertyStore propertyStore) throws OseeCoreException {
BranchCommitResponse response = new BranchCommitResponse();
PropertyStore innerStore = propertyStore.getPropertyStore(Entry.TRANSACTION_NUMBER.name());
- TransactionRecord transactionRecord = service.convert(innerStore, CoreTranslatorId.TRANSACTION_RECORD);
- response.setTransaction(transactionRecord);
+ Integer transactionRecord = service.convert(innerStore, CoreTranslatorId.TRANSACTION_RECORD);
+ response.setTransactionId(transactionRecord);
return response;
}
@Override
public PropertyStore convert(BranchCommitResponse data) throws OseeCoreException {
PropertyStore store = new PropertyStore();
- TransactionRecord record = data.getTransaction();
+ Integer record = data.getTransactionId();
PropertyStore property = service.convert(record, CoreTranslatorId.TRANSACTION_RECORD);
store.put(Entry.TRANSACTION_NUMBER.name(), property);
return store;
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/TransactionRecordTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/TransactionRecordTranslator.java
index 471ac1cda54..beb7f785c3c 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/TransactionRecordTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/TransactionRecordTranslator.java
@@ -10,12 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.message.internal.translation;
-import java.sql.Timestamp;
-import java.util.Date;
-import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
-import org.eclipse.osee.framework.core.model.TransactionRecord;
-import org.eclipse.osee.framework.core.model.TransactionRecordFactory;
-import org.eclipse.osee.framework.core.model.cache.BranchCache;
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;
@@ -23,51 +17,21 @@ import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
/**
* @author Roberto E. Escobar
*/
-public final class TransactionRecordTranslator implements ITranslator<TransactionRecord> {
+public final class TransactionRecordTranslator implements ITranslator<Integer> {
private static enum Entry {
TRANSACTION_ID,
- TRANSACTION_BRANCH,
- TRANSACTION_TX_TYPE,
- TRANSACTION_COMMENT,
- TRANSACTION_TIMESTAMP,
- TRANSACTION_AUTHOR_ART_ID,
- TRANSACTION_COMMIT_ART_ID;
- }
-
- private final TransactionRecordFactory txRecordFactory;
- private final BranchCache branchCache;
-
- public TransactionRecordTranslator(TransactionRecordFactory txRecordFactory, BranchCache branchCache) {
- this.txRecordFactory = txRecordFactory;
- this.branchCache = branchCache;
}
@Override
- public TransactionRecord convert(PropertyStore store) throws OseeCoreException {
- int transactionNumber = store.getInt(Entry.TRANSACTION_ID.name());
- TransactionDetailsType txType = TransactionDetailsType.valueOf(store.get(Entry.TRANSACTION_TX_TYPE.name()));
- String comment = store.get(Entry.TRANSACTION_COMMENT.name());
- Date time = new Timestamp(store.getLong(Entry.TRANSACTION_TIMESTAMP.name()));
- int authorArtId = store.getInt(Entry.TRANSACTION_AUTHOR_ART_ID.name());
- int commitArtId = store.getInt(Entry.TRANSACTION_COMMIT_ART_ID.name());
- long branchUuid = store.getLong(Entry.TRANSACTION_BRANCH.name());
- return txRecordFactory.create(transactionNumber, branchUuid, comment, time, authorArtId, commitArtId, txType,
- branchCache);
+ public Integer convert(PropertyStore store) throws OseeCoreException {
+ return store.getInt(Entry.TRANSACTION_ID.name());
}
@Override
- public PropertyStore convert(TransactionRecord data) {
+ public PropertyStore convert(Integer transactionId) {
PropertyStore store = new PropertyStore();
- store.put(Entry.TRANSACTION_ID.name(), data.getId());
- store.put(Entry.TRANSACTION_TX_TYPE.name(), data.getTxType().name());
- store.put(Entry.TRANSACTION_COMMENT.name(), data.getComment());
- store.put(Entry.TRANSACTION_TIMESTAMP.name(), data.getTimeStamp().getTime());
- store.put(Entry.TRANSACTION_AUTHOR_ART_ID.name(), data.getAuthor());
-
- store.put(Entry.TRANSACTION_COMMIT_ART_ID.name(), data.getCommit());
-
- store.put(Entry.TRANSACTION_BRANCH.name(), data.getBranchId());
+ store.put(Entry.TRANSACTION_ID.name(), transactionId);
return store;
}
}

Back to the top