Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-02-22 14:34:31 -0500
committerRyan D. Brooks2012-02-22 14:34:31 -0500
commitaf8a27e75f9ed5965d37bc0c5787ee9a226673a3 (patch)
treedd286fdcdb49233aed1102e5161c9df7cb1a21a9 /plugins/org.eclipse.osee.framework.core.message/src/org
parent73b90a7a89126f482b60e9bdb4427c04da24f974 (diff)
downloadorg.eclipse.osee-af8a27e75f9ed5965d37bc0c5787ee9a226673a3.tar.gz
org.eclipse.osee-af8a27e75f9ed5965d37bc0c5787ee9a226673a3.tar.xz
org.eclipse.osee-af8a27e75f9ed5965d37bc0c5787ee9a226673a3.zip
feature[ats_VVMH0]: Move ChangeItem and ChangeVersion into core.model
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/ArtifactChangeItem.java23
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeChangeItem.java25
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeItem.java93
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeItemUtil.java132
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeReportResponse.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeVersion.java123
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationChangeItem.java37
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ChangeReportResponseTranslator.java10
8 files changed, 6 insertions, 438 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactChangeItem.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactChangeItem.java
deleted file mode 100644
index 29083a2715..0000000000
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactChangeItem.java
+++ /dev/null
@@ -1,23 +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;
-
-import org.eclipse.osee.framework.core.enums.ModificationType;
-
-/**
- * @author Jeff C. Phillips
- */
-public class ArtifactChangeItem extends ChangeItem {
-
- public ArtifactChangeItem(int artId, int artTypeId, long currentSourceGammaId, ModificationType currentSourceModType) {
- super(artId, artTypeId, artId, currentSourceGammaId, currentSourceModType);
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeChangeItem.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeChangeItem.java
deleted file mode 100644
index 2a81df49b0..0000000000
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeChangeItem.java
+++ /dev/null
@@ -1,25 +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;
-
-import org.eclipse.osee.framework.core.enums.ModificationType;
-
-/**
- * @author Jeff C. Phillips
- */
-public class AttributeChangeItem extends ChangeItem {
-
- public AttributeChangeItem(int attrId, int attrTypeId, int artId, long currentSourceGammaId, ModificationType currentSourceModType, String value) {
- super(attrId, attrTypeId, artId, currentSourceGammaId, currentSourceModType);
- this.getCurrentVersion().setValue(value);
- }
-
-}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeItem.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeItem.java
deleted file mode 100644
index e667243a2d..0000000000
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeItem.java
+++ /dev/null
@@ -1,93 +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;
-
-import org.eclipse.osee.framework.core.enums.ModificationType;
-
-/**
- * @author Roberto E. Escobar
- */
-public abstract class ChangeItem {
- private final int artId;
- private final int itemId;
- private final int itemTypeId;
-
- private final ChangeVersion baseEntry;
- private final ChangeVersion firstChange;
- private final ChangeVersion currentEntry;
- private final ChangeVersion destinationEntry;
- private final ChangeVersion netEntry;
-
- private boolean synthetic;
-
- protected ChangeItem(int itemId, int itemTypeId, int artId, long currentSourceGammaId, ModificationType currentSourceModType) {
- this.itemId = itemId;
- this.itemTypeId = itemTypeId;
- this.artId = artId;
-
- this.currentEntry = new ChangeVersion(currentSourceGammaId, currentSourceModType);
-
- this.baseEntry = new ChangeVersion();
- this.firstChange = new ChangeVersion();
- this.destinationEntry = new ChangeVersion();
- this.netEntry = new ChangeVersion();
-
- this.synthetic = false;
- }
-
- public void setSynthetic(boolean synthetic) {
- this.synthetic = synthetic;
- }
-
- public boolean isSynthetic() {
- return synthetic;
- }
-
- public int getArtId() {
- return artId;
- }
-
- public int getItemId() {
- return itemId;
- }
-
- public int getItemTypeId() {
- return itemTypeId;
- }
-
- public ChangeVersion getBaselineVersion() {
- return baseEntry;
- }
-
- public ChangeVersion getFirstNonCurrentChange() {
- return firstChange;
- }
-
- public ChangeVersion getCurrentVersion() {
- return currentEntry;
- }
-
- public ChangeVersion getDestinationVersion() {
- return destinationEntry;
- }
-
- public ChangeVersion getNetChange() {
- return netEntry;
- }
-
- @Override
- public String toString() {
- return String.format(
- "ChangeItem - itemId:[%s] artId:%s typeId:%s base:%s first:%s current:%s destination:%s net:%s synthetic:%s",
- itemId, getArtId(), getItemTypeId(), getBaselineVersion(), getFirstNonCurrentChange(), getCurrentVersion(),
- getDestinationVersion(), getNetChange(), isSynthetic());
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeItemUtil.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeItemUtil.java
deleted file mode 100644
index 82d9c483fd..0000000000
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeItemUtil.java
+++ /dev/null
@@ -1,132 +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;
-
-import org.eclipse.osee.framework.core.enums.ModificationType;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeStateException;
-import org.eclipse.osee.framework.core.util.Conditions;
-
-/**
- * @author Roberto E. Escobar
- */
-public final class ChangeItemUtil {
-
- private ChangeItemUtil() {
- // Utility Class
- }
-
- public static ChangeVersion getStartingVersion(ChangeItem item) throws OseeCoreException {
- if (item == null) {
- throw new OseeArgumentException("ChangeItem cannot be null");
- }
- ChangeVersion toReturn = item.getBaselineVersion();
- if (!toReturn.isValid()) {
- toReturn = item.getFirstNonCurrentChange();
- if (!toReturn.isValid()) {
- toReturn = item.getCurrentVersion();
- if (!toReturn.isValid()) {
- throw new OseeStateException("Cannot find a valid starting point for change item: %s", item);
- }
- }
- }
- return toReturn;
- }
-
- public static void copy(ChangeVersion source, ChangeVersion dest) throws OseeCoreException {
- Conditions.checkNotNull(source, "source");
- Conditions.checkNotNull(dest, "Dest");
-
- dest.setGammaId(source.getGammaId());
- dest.setModType(source.getModType());
- dest.setValue(source.getValue());
- }
-
- public static boolean isModType(ChangeVersion changeVersion, ModificationType matchModType) {
- return changeVersion != null && changeVersion.getModType() == matchModType;
- }
-
- public static boolean isNew(ChangeVersion changeVersion) {
- return isModType(changeVersion, ModificationType.NEW);
- }
-
- public static boolean isIntroduced(ChangeVersion changeVersion) {
- return isModType(changeVersion, ModificationType.INTRODUCED);
- }
-
- public static boolean isDeleted(ChangeVersion changeVersion) {
- return changeVersion != null && changeVersion.getModType() != null && changeVersion.getModType().isDeleted();
- }
-
- public static boolean wasNewOnSource(ChangeItem changeItem) {
- return isNew(changeItem.getFirstNonCurrentChange()) || isNew(changeItem.getCurrentVersion());
- }
-
- public static boolean wasIntroducedOnSource(ChangeItem changeItem) {
- return isIntroduced(changeItem.getFirstNonCurrentChange()) || isIntroduced(changeItem.getCurrentVersion());
- }
-
- public static boolean wasNewOrIntroducedOnSource(ChangeItem changeItem) {
- return wasNewOnSource(changeItem) || wasIntroducedOnSource(changeItem);
- }
-
- public static boolean hasBeenReplacedWithVersion(ChangeItem changeItem) {
- boolean results = areGammasEqual(changeItem.getCurrentVersion(), changeItem.getBaselineVersion()) && //
- isModType(changeItem.getCurrentVersion(), ModificationType.MODIFIED);
- return results;
- }
-
- public static boolean isAlreadyOnDestination(ChangeItem changeItem) {
- return areGammasEqual(changeItem.getCurrentVersion(), changeItem.getDestinationVersion()) && //
- isDeleted(changeItem.getCurrentVersion()) == isDeleted(changeItem.getDestinationVersion());
- }
-
- public static boolean areGammasEqual(ChangeVersion object1, ChangeVersion object2) {
- boolean result = false;
- if (object1 == null && object2 == null) {
- result = true;
- } else if (object1 != null && object2 != null) {
- if (object1.getGammaId() == object2.getGammaId()) {
- result = true;
- } else if (object1.getGammaId() != null) {
- result = object1.getGammaId().equals(object2.getGammaId());
- }
- }
- return result;
- }
-
- public static boolean isIgnoreCase(ChangeItem changeItem) {
- return //
- wasCreatedAndDeleted(changeItem) || //
- isAlreadyOnDestination(changeItem) || //
- isDeletedAndDoesNotExistInDestination(changeItem) || //
- hasBeenDeletedInDestination(changeItem) || //
- isDestinationEqualOrNewerThanCurrent(changeItem) || //
- hasBeenReplacedWithVersion(changeItem);
- }
-
- public static boolean wasCreatedAndDeleted(ChangeItem changeItem) {
- return wasNewOrIntroducedOnSource(changeItem) && isDeleted(changeItem.getCurrentVersion());
- }
-
- public static boolean isDeletedAndDoesNotExistInDestination(ChangeItem changeItem) {
- return !changeItem.getDestinationVersion().isValid() && isDeleted(changeItem.getCurrentVersion());
- }
-
- public static boolean hasBeenDeletedInDestination(ChangeItem changeItem) {
- return changeItem.getDestinationVersion().isValid() && isDeleted(changeItem.getDestinationVersion());
- }
-
- public static boolean isDestinationEqualOrNewerThanCurrent(ChangeItem changeItem) {
- return (isNew(changeItem.getCurrentVersion()) || isIntroduced(changeItem.getCurrentVersion())) && changeItem.getDestinationVersion().isValid();
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeReportResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeReportResponse.java
index 9c01fc37a1..3bd4ef3f3a 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeReportResponse.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeReportResponse.java
@@ -13,6 +13,7 @@ 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.change.ChangeItem;
/**
* @author Jeff C. Phillips
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeVersion.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeVersion.java
deleted file mode 100644
index 583acda1cf..0000000000
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeVersion.java
+++ /dev/null
@@ -1,123 +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;
-
-import org.eclipse.osee.framework.core.enums.ModificationType;
-
-/**
- * @author Roberto E. Escobar
- */
-public final class ChangeVersion {
- private Long gammaId;
- private ModificationType modType;
- private String value;
-
- public ChangeVersion() {
- this(null, null, null);
- }
-
- public ChangeVersion(Long gammaId, ModificationType modType) {
- this(null, gammaId, modType);
- }
-
- public ChangeVersion(String value, Long gammaId, ModificationType modType) {
- super();
- this.value = value;
- this.gammaId = gammaId;
- this.modType = modType;
- }
-
- public Long getGammaId() {
- return gammaId;
- }
-
- public ModificationType getModType() {
- return modType;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public void setGammaId(Long gammaId) {
- this.gammaId = gammaId;
- }
-
- public void setModType(ModificationType modType) {
- this.modType = modType;
- }
-
- public boolean isValid() {
- return getModType() != null && getGammaId() != null;// && getTransactionNumber() != null;
- }
-
- public void copy(ChangeVersion item) {
- setGammaId(item.getGammaId());
- setModType(item.getModType());
- setValue(item.getValue());
- }
-
- @Override
- public String toString() {
- return String.format("[%s,%s]", getGammaId(), getModType());
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (gammaId == null ? 0 : gammaId.hashCode());
- result = prime * result + (modType == null ? 0 : modType.hashCode());
- result = prime * result + (value == null ? 0 : value.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ChangeVersion other = (ChangeVersion) obj;
- if (gammaId == null) {
- if (other.gammaId != null) {
- return false;
- }
- } else if (!gammaId.equals(other.gammaId)) {
- return false;
- }
- if (modType == null) {
- if (other.modType != null) {
- return false;
- }
- } else if (!modType.equals(other.modType)) {
- return false;
- }
- if (value == null) {
- if (other.value != null) {
- return false;
- }
- } else if (!value.equals(other.value)) {
- return false;
- }
- return true;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationChangeItem.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationChangeItem.java
deleted file mode 100644
index 2e1bacbdf6..0000000000
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationChangeItem.java
+++ /dev/null
@@ -1,37 +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;
-
-import org.eclipse.osee.framework.core.enums.ModificationType;
-
-/**
- * @author Jeff C. Phillips
- */
-public class RelationChangeItem extends ChangeItem {
- private final int bArtId;
- private final String rationale;
-
- public RelationChangeItem(int relLinkId, int relTypeId, long currentSourceGammaId, ModificationType currentSourceModType, int aArtId, int bArtId, String rationale) {
- super(relLinkId, relTypeId, aArtId, currentSourceGammaId, currentSourceModType);
-
- this.getCurrentVersion().setValue(rationale);
- this.bArtId = bArtId;
- this.rationale = rationale;
- }
-
- public int getBArtId() {
- return bArtId;
- }
-
- public String getRationale() {
- return rationale;
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ChangeReportResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ChangeReportResponseTranslator.java
index bd06e5840e..b31592f6b7 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ChangeReportResponseTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ChangeReportResponseTranslator.java
@@ -16,13 +16,13 @@ import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeStateException;
-import org.eclipse.osee.framework.core.message.ArtifactChangeItem;
-import org.eclipse.osee.framework.core.message.AttributeChangeItem;
-import org.eclipse.osee.framework.core.message.ChangeItem;
import org.eclipse.osee.framework.core.message.ChangeReportResponse;
-import org.eclipse.osee.framework.core.message.ChangeVersion;
-import org.eclipse.osee.framework.core.message.RelationChangeItem;
import org.eclipse.osee.framework.core.message.TranslationUtil;
+import org.eclipse.osee.framework.core.model.change.ArtifactChangeItem;
+import org.eclipse.osee.framework.core.model.change.AttributeChangeItem;
+import org.eclipse.osee.framework.core.model.change.ChangeItem;
+import org.eclipse.osee.framework.core.model.change.ChangeVersion;
+import org.eclipse.osee.framework.core.model.change.RelationChangeItem;
import org.eclipse.osee.framework.core.translation.ITranslator;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;

Back to the top