Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-03-21 20:51:21 +0000
committerRyan D. Brooks2016-03-21 20:51:21 +0000
commit0d22cf094b4cb632a9b65a205e6c1f2b253fe61f (patch)
tree258a1aa35e7e5cd9502fecfa4d2396791a250988
parente7941c057d520323a87548af60decc660436fd66 (diff)
downloadorg.eclipse.osee-0d22cf094b4cb632a9b65a205e6c1f2b253fe61f.tar.gz
org.eclipse.osee-0d22cf094b4cb632a9b65a205e6c1f2b253fe61f.tar.xz
org.eclipse.osee-0d22cf094b4cb632a9b65a205e6c1f2b253fe61f.zip
refactor: Use BranchId with BranchEvent
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java9
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsBranchManagerUpdateListener.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonFavorites.java2
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java17
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactTest.java19
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/BranchEventTest.java42
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/FrameworkEventToRemoteEventListenerTest.java6
-rw-r--r--plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/WordUpdateChange.java17
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java10
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java5
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessEventListener.java2
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java5
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicGuidArtifact.java17
-rw-r--r--plugins/org.eclipse.osee.framework.core/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java12
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/HasBranch.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java4
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java11
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/IdSerializer.java52
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/NamedId.java2
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.event.res/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidArtifact1.java38
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java27
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelationReorder1.java22
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBranchEvent1.java50
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemotePersistEvent1.java24
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteTransactionChange1.java15
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidArtifactTest.java40
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java9
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventChangeTypeBasicGuidArtifactTest.java14
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java21
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java24
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/internal/event/EventListenerRegistryTest.java7
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java17
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ChangeArtifactType.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/DeleteBranchOperation.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java59
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/OseeEventManager.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactEventFilter.java11
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilter.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilter.java7
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/IEventFilter.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEvent.java24
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/BranchEvent.java73
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidArtifact.java17
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventChangeTypeBasicGuidArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventModifiedBasicGuidArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java12
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchArchivedStateHttpRequestOperation.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchNameHttpRequestOperation.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchStateHttpRequestOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchTypeHttpRequestOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/ArtifactEventHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchEventHandler.java5
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchRemoteEventHandler.java7
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/StoreSkynetTransactionOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportEditor.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorer.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerEventManager.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java21
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java9
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java5
76 files changed, 465 insertions, 454 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java
index d6dd5845d2..de06dd5534 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AtsTaskService.java
@@ -91,8 +91,8 @@ public class AtsTaskService extends AbstractAtsTaskService {
for (JaxAtsTask task : jaxTasks.getTasks()) {
String guid = ArtifactQuery.getGuidFromUuid(task.getUuid(), AtsUtilCore.getAtsBranch());
- artifactEvent.getArtifacts().add(new EventBasicGuidArtifact(EventModType.Added,
- AtsUtilCore.getAtsBranch().getUuid(), AtsArtifactTypes.Task.getGuid(), guid));
+ artifactEvent.getArtifacts().add(new EventBasicGuidArtifact(EventModType.Added, AtsUtilCore.getAtsBranch(),
+ AtsArtifactTypes.Task.getGuid(), guid));
artUuids.add(task.getUuid());
RelationLink relation = getRelation(teamWf, task);
@@ -115,7 +115,7 @@ public class AtsTaskService extends AbstractAtsTaskService {
}
public static DefaultBasicGuidArtifact getBasicGuidArtifact(Artifact artifact) {
- return new DefaultBasicGuidArtifact(artifact.getBranchId(), artifact.getArtTypeGuid(), artifact.getGuid());
+ return new DefaultBasicGuidArtifact(artifact.getBranch(), artifact.getArtTypeGuid(), artifact.getGuid());
}
private RelationLink getRelation(Artifact teamWf, JaxAtsTask task) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java
index 235b513fc0..a50c033c62 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
@@ -31,7 +32,7 @@ import org.eclipse.osee.framework.ui.swt.Displays;
/**
* Common location for event handling for SMAEditors in order to keep number of registrations and processing to a
* minimum.
- *
+ *
* @author Donald G. Dunne
*/
public class SMAEditorBranchEventManager implements IBranchEventListener {
@@ -70,14 +71,14 @@ public class SMAEditorBranchEventManager implements IBranchEventListener {
}
for (final ISMAEditorEventHandler handler : handlers) {
try {
- safelyProcessHandler(branchEvent.getEventType(), branchEvent.getBranchUuid());
+ safelyProcessHandler(branchEvent.getEventType(), branchEvent.getSourceBranch());
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, "Error processing event handler - " + handler, ex);
}
}
}
- private void safelyProcessHandler(BranchEventType branchEventType, Long branchUuid) {
+ private void safelyProcessHandler(BranchEventType branchEventType, BranchId branch) {
for (final ISMAEditorEventHandler handler : handlers) {
if (handler.isDisposed()) {
OseeLog.log(Activator.class, Level.SEVERE, "Unexpected handler disposed but not unregistered.");
@@ -98,7 +99,7 @@ public class SMAEditorBranchEventManager implements IBranchEventListener {
if (awa instanceof TeamWorkFlowArtifact) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) awa;
IOseeBranch assocBranch = AtsClientService.get().getBranchService().getWorkingBranch(teamArt);
- if (assocBranch != null && branchUuid.equals(assocBranch.getUuid())) {
+ if (branch.equals(assocBranch)) {
Displays.ensureInDisplayThread(new Runnable() {
@Override
public void run() {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsBranchManagerUpdateListener.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsBranchManagerUpdateListener.java
index 18f9a85f53..4831ee38bc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsBranchManagerUpdateListener.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsBranchManagerUpdateListener.java
@@ -15,8 +15,6 @@ import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -47,8 +45,8 @@ public class AtsBranchManagerUpdateListener implements IBranchEventListener {
return;
}
try {
- IOseeBranch branch = TokenFactory.createBranch(branchEvent.getBranchUuid());
- Artifact assocArtInCache = ArtifactCache.getActive(BranchManager.getAssociatedArtifactId(branch), COMMON);
+ Artifact assocArtInCache =
+ ArtifactCache.getActive(BranchManager.getAssociatedArtifactId(branchEvent.getSourceBranch()), COMMON);
if (assocArtInCache != null && assocArtInCache instanceof TeamWorkFlowArtifact) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) assocArtInCache;
if (branchEvent.getEventType() == BranchEventType.Added) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
index 17074c6375..6b1bfbc95d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
@@ -294,7 +294,7 @@ public class XWorkingBranch extends GenericXWidget implements IArtifactWidget, I
isFavorite ? "Favorite" : "NOT Favorite");
if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Toggle Branch as Favorite", message)) {
user.toggleFavoriteBranch(branch);
- OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.FavoritesUpdated, branch.getUuid()));
+ OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.FavoritesUpdated, branch));
}
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonFavorites.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonFavorites.java
index 08c98c06d4..84e9e9067d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonFavorites.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonFavorites.java
@@ -72,7 +72,7 @@ public class XWorkingBranchButtonFavorites extends XWorkingBranchButtonAbstract
isFavorite ? "Favorite" : "NOT Favorite");
if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Toggle Branch as Favorite", message)) {
user.toggleFavoriteBranch(branch);
- OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.FavoritesUpdated, branch.getUuid()));
+ OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.FavoritesUpdated, branch));
}
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java
index 2d1ac2e3e7..9851391bfc 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java
@@ -342,12 +342,11 @@ public class ArtifactEventTest {
remoteEvent.setNetworkSender(networkSender);
remoteEvent.setTransactionId(1000);
- String branchGuid = COMMON_ID.toString();
- remoteEvent.setBranchGuid(branchGuid);
+ remoteEvent.setBranchGuid(COMMON);
RemoteBasicGuidArtifact1 remGuidArt = new RemoteBasicGuidArtifact1();
remGuidArt.setModTypeGuid(EventModType.Modified.getGuid());
- remGuidArt.setBranchGuid(branchGuid);
+ remGuidArt.setBranch(COMMON);
remGuidArt.setArtTypeGuid(CoreArtifactTypes.GeneralData.getGuid());
remGuidArt.setArtGuid(modifiedArt.getGuid());
@@ -356,19 +355,17 @@ public class ArtifactEventTest {
}
private RemotePersistEvent1 getFakeGeneralDataArtifactRemoteEventForArtifactRelationModified(int relationId, RelationEventType relationEventType, IRelationType relType, Artifact artA, Artifact artB) throws OseeCoreException {
- String branchGuid = COMMON_ID.toString();
-
// Create fake remote event that would come in from another client
RemotePersistEvent1 remoteEvent = new RemotePersistEvent1();
// Set sender to something other than this client so event system will think came from another client
remoteEvent.setNetworkSender(networkSender);
remoteEvent.setTransactionId(1000);
- remoteEvent.setBranchGuid(branchGuid);
+ remoteEvent.setBranchGuid(COMMON);
RemoteBasicGuidRelation1 remGuidRel = new RemoteBasicGuidRelation1();
remGuidRel.setModTypeGuid(relationEventType.getGuid());
- remGuidRel.setBranchGuid(branchGuid);
+ remGuidRel.setBranchGuid(COMMON);
remGuidRel.setGammaId(incrementingGammaId++);
remGuidRel.setRelTypeGuid(relType.getGuid());
remGuidRel.setRelationId(relationId);
@@ -595,16 +592,16 @@ public class ArtifactEventTest {
// Set sender to something other than this client so event system will think came from another client
remoteEvent.setNetworkSender(networkSender);
remoteEvent.setTransactionId(1000);
- remoteEvent.setBranchGuid(COMMON_ID.toString());
+ remoteEvent.setBranchGuid(COMMON);
RemoteBasicGuidRelationReorder1 remoteReorder = new RemoteBasicGuidRelationReorder1();
- remoteReorder.setBranchGuid(COMMON_ID.toString());
+ remoteReorder.setBranchGuid(COMMON);
remoteReorder.setModTypeGuid(RelationOrderModType.Absolute.getGuid());
remoteReorder.setRelTypeGuid(CoreRelationTypes.Default_Hierarchical__Child.getGuid());
RemoteBasicGuidArtifact1 parentRemGuidArt = new RemoteBasicGuidArtifact1();
parentRemGuidArt.setModTypeGuid(EventModType.Modified.getGuid());
- parentRemGuidArt.setBranchGuid(COMMON_ID.toString());
+ parentRemGuidArt.setBranch(COMMON);
parentRemGuidArt.setArtTypeGuid(CoreArtifactTypes.GeneralData.getGuid());
parentRemGuidArt.setArtGuid(GUID.create());
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactTest.java
index 25b31cdb42..9a4fef1592 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactTest.java
@@ -14,7 +14,7 @@ package org.eclipse.osee.client.integration.tests.integration.skynet.core;
import static org.eclipse.osee.client.demo.DemoChoice.OSEE_CLIENT_DEMO;
import static org.eclipse.osee.framework.core.enums.CoreArtifactTypes.GeneralData;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
-import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.SYSTEM_ROOT;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_1;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_2;
import org.eclipse.osee.client.demo.DemoTypes;
@@ -26,7 +26,6 @@ import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
@@ -107,19 +106,19 @@ public final class ArtifactTest {
art.persist("test");
DefaultBasicGuidArtifact equalGuid =
- new DefaultBasicGuidArtifact(Lib.generateUuid(), CoreArtifactTypes.SoftwareDesign.getGuid(), art.getGuid());
+ new DefaultBasicGuidArtifact(SYSTEM_ROOT, CoreArtifactTypes.SoftwareDesign.getGuid(), art.getGuid());
Assert.assertEquals(art.hashCode(), equalGuid.hashCode());
DefaultBasicGuidArtifact equalGuidArtType =
- new DefaultBasicGuidArtifact(Lib.generateUuid(), GeneralData.getGuid(), art.getGuid());
+ new DefaultBasicGuidArtifact(SYSTEM_ROOT, GeneralData.getGuid(), art.getGuid());
Assert.assertEquals(art.hashCode(), equalGuidArtType.hashCode());
DefaultBasicGuidArtifact equalGuidArtTypeBranchUuid =
- new DefaultBasicGuidArtifact(COMMON_ID, GeneralData.getGuid(), art.getGuid());
+ new DefaultBasicGuidArtifact(COMMON, GeneralData.getGuid(), art.getGuid());
Assert.assertEquals(art.hashCode(), equalGuidArtTypeBranchUuid.hashCode());
DefaultBasicGuidArtifact equalArtTypeBranchUuidNotGuid =
- new DefaultBasicGuidArtifact(COMMON_ID, GeneralData.getGuid(), GUID.create());
+ new DefaultBasicGuidArtifact(COMMON, GeneralData.getGuid(), GUID.create());
Assert.assertNotSame(art.hashCode(), equalArtTypeBranchUuidNotGuid.hashCode());
}
@@ -129,19 +128,19 @@ public final class ArtifactTest {
art.persist("test");
DefaultBasicGuidArtifact equalGuid =
- new DefaultBasicGuidArtifact(Lib.generateUuid(), CoreArtifactTypes.SoftwareDesign.getGuid(), art.getGuid());
+ new DefaultBasicGuidArtifact(SYSTEM_ROOT, CoreArtifactTypes.SoftwareDesign.getGuid(), art.getGuid());
Assert.assertNotSame(art, equalGuid);
DefaultBasicGuidArtifact equalGuidArtType =
- new DefaultBasicGuidArtifact(Lib.generateUuid(), GeneralData.getGuid(), art.getGuid());
+ new DefaultBasicGuidArtifact(SYSTEM_ROOT, GeneralData.getGuid(), art.getGuid());
Assert.assertNotSame(art, equalGuidArtType);
DefaultBasicGuidArtifact equalGuidArtTypeBranchUuid =
- new DefaultBasicGuidArtifact(COMMON_ID, GeneralData.getGuid(), art.getGuid());
+ new DefaultBasicGuidArtifact(COMMON, GeneralData.getGuid(), art.getGuid());
Assert.assertEquals(art, equalGuidArtTypeBranchUuid);
DefaultBasicGuidArtifact equalArtTypeBranchUuidNotGuid =
- new DefaultBasicGuidArtifact(COMMON_ID, GeneralData.getGuid(), GUID.create());
+ new DefaultBasicGuidArtifact(COMMON, GeneralData.getGuid(), GUID.create());
Assert.assertNotSame(art, equalArtTypeBranchUuidNotGuid);
}
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/BranchEventTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/BranchEventTest.java
index 755840a0f7..facf5b3b8e 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/BranchEventTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/BranchEventTest.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.client.test.framework.TestInfo;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
@@ -130,11 +131,11 @@ public class BranchEventTest {
branchEventListener.reset();
Assert.assertNotNull(committedBranch);
- final Long uuid = committedBranch.getUuid();
Assert.assertEquals(BranchArchivedState.ARCHIVED, committedBranch.getArchiveState());
BranchManager.updateBranchArchivedState(null, committedBranch.getUuid(), BranchArchivedState.UNARCHIVED);
- verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.ArchiveStateUpdated, uuid);
+ verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.ArchiveStateUpdated,
+ committedBranch);
Assert.assertEquals(BranchArchivedState.UNARCHIVED, committedBranch.getArchiveState());
Assert.assertFalse(BranchManager.isEditable(committedBranch));
@@ -147,7 +148,6 @@ public class BranchEventTest {
Assert.assertNotNull(workingBranch);
- final Long uuid = workingBranch.getUuid();
Assert.assertNotNull(workingBranch);
Artifact newArt = ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralData, workingBranch);
newArt.persist(getClass().getSimpleName());
@@ -155,8 +155,8 @@ public class BranchEventTest {
branchEventListener.reset();
BranchManager.commitBranch(null, conflictManager, true, true);
- verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Committing, uuid);
- verifyReceivedBranchStatesEvent(branchEventListener.getSecondResults(), BranchEventType.Committed, uuid);
+ verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Committing, workingBranch);
+ verifyReceivedBranchStatesEvent(branchEventListener.getSecondResults(), BranchEventType.Committed, workingBranch);
Assert.assertEquals(BranchState.COMMITTED, workingBranch.getBranchState());
Assert.assertFalse(BranchManager.isEditable(workingBranch));
@@ -169,32 +169,30 @@ public class BranchEventTest {
Assert.assertNotNull(workingBranch);
- final Long uuid = workingBranch.getUuid();
Assert.assertNotNull(workingBranch);
branchEventListener.reset();
Operations.executeWorkAndCheckStatus(new PurgeBranchHttpRequestOperation(workingBranch, false));
- verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Purging, uuid);
- verifyReceivedBranchStatesEvent(branchEventListener.getSecondResults(), BranchEventType.Purged, uuid);
+ verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Purging, workingBranch);
+ verifyReceivedBranchStatesEvent(branchEventListener.getSecondResults(), BranchEventType.Purged, workingBranch);
Assert.assertEquals(BranchState.PURGED, workingBranch.getBranchState());
Assert.assertEquals(StorageState.PURGED, workingBranch.getStorageState());
Assert.assertFalse(BranchManager.isEditable(workingBranch));
- Assert.assertFalse("Branch should not exist", BranchManager.branchExists(uuid));
+ Assert.assertFalse("Branch should not exist", BranchManager.branchExists(workingBranch));
return workingBranch;
}
private Branch testEvents__deleted(Branch workingBranch) throws Exception {
- final Long uuid = workingBranch.getUuid();
Assert.assertNotNull(workingBranch);
Assert.assertNotSame(BranchState.DELETED, workingBranch.getBranchState());
branchEventListener.reset();
Operations.executeWorkAndCheckStatus(new DeleteBranchOperation(workingBranch));
- verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Deleting, uuid);
- verifyReceivedBranchStatesEvent(branchEventListener.getSecondResults(), BranchEventType.Deleted, uuid);
+ verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Deleting, workingBranch);
+ verifyReceivedBranchStatesEvent(branchEventListener.getSecondResults(), BranchEventType.Deleted, workingBranch);
Assert.assertEquals(BranchState.DELETED, workingBranch.getBranchState());
return workingBranch;
@@ -203,12 +201,12 @@ public class BranchEventTest {
private Branch testEvents__stateChange(Branch workingBranch) throws Exception {
branchEventListener.reset();
- final Long uuid = workingBranch.getUuid();
Assert.assertNotNull(workingBranch);
Assert.assertEquals(BranchState.CREATED, workingBranch.getBranchState());
BranchManager.updateBranchState(null, workingBranch.getUuid(), BranchState.MODIFIED);
- verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.StateUpdated, uuid);
+ verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.StateUpdated,
+ workingBranch);
Assert.assertEquals(BranchState.MODIFIED, workingBranch.getBranchState());
return workingBranch;
@@ -216,12 +214,12 @@ public class BranchEventTest {
private Branch testEvents__typeChange(Branch workingBranch) throws Exception {
branchEventListener.reset();
- final Long uuid = workingBranch.getUuid();
Assert.assertNotNull(workingBranch);
Assert.assertEquals(BranchType.WORKING, workingBranch.getBranchType());
BranchManager.updateBranchType(null, workingBranch.getUuid(), BranchType.BASELINE);
- verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.TypeUpdated, uuid);
+ verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.TypeUpdated,
+ workingBranch);
Assert.assertEquals(BranchType.BASELINE, workingBranch.getBranchType());
return workingBranch;
@@ -230,13 +228,12 @@ public class BranchEventTest {
private Branch testEvents__workingRenamed(Branch workingBranch) throws Exception {
branchEventListener.reset();
- final Long uuid = workingBranch.getUuid();
Assert.assertNotNull(workingBranch);
String newName = method.getQualifiedTestName() + " - working renamed";
workingBranch.setName(newName);
BranchManager.persist(workingBranch);
- verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Renamed, uuid);
+ verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Renamed, workingBranch);
Assert.assertEquals(newName, workingBranch.getName());
Assert.assertNotNull(BranchManager.getBranchesByName(newName));
@@ -260,13 +257,12 @@ public class BranchEventTest {
IOseeBranch branch = BranchManager.createTopLevelBranch(mainBranch);
Assert.assertNotNull(branch);
- verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Added,
- mainBranch.getUuid());
+ verifyReceivedBranchStatesEvent(branchEventListener.getFirstResults(), BranchEventType.Added, mainBranch);
return branch;
}
- private void verifyReceivedBranchStatesEvent(Pair<Sender, BranchEvent> eventPair, BranchEventType expectedEnumState, Long expectedBranchUuid) {
+ private void verifyReceivedBranchStatesEvent(Pair<Sender, BranchEvent> eventPair, BranchEventType expectedEnumState, BranchId expectedBranch) {
Sender receivedSender = eventPair.getFirst();
BranchEvent receivedBranchEvent = eventPair.getSecond();
@@ -277,8 +273,8 @@ public class BranchEventTest {
Assert.assertTrue(receivedSender.isLocal());
}
- if (expectedBranchUuid != null) {
- Assert.assertEquals(expectedBranchUuid, Long.valueOf(receivedBranchEvent.getBranchUuid()));
+ if (expectedBranch != null) {
+ Assert.assertEquals(expectedBranch, receivedBranchEvent.getSourceBranch());
}
}
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/FrameworkEventToRemoteEventListenerTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/FrameworkEventToRemoteEventListenerTest.java
index bf93ffa246..a4c233dc46 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/FrameworkEventToRemoteEventListenerTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/FrameworkEventToRemoteEventListenerTest.java
@@ -39,7 +39,7 @@ import org.junit.Test;
/**
* Test unit for {@link FrameworkEventToRemoteEventListener}
- *
+ *
* @author Shawn F. Cook
*/
public class FrameworkEventToRemoteEventListenerTest {
@@ -113,10 +113,10 @@ public class FrameworkEventToRemoteEventListenerTest {
private RemotePersistEvent1 createRemoteEvent(Artifact modifiedArt) {
RemotePersistEvent1 remoteEvent = new RemotePersistEvent1();
remoteEvent.setNetworkSender(networkSender);
- remoteEvent.setBranchGuid(String.valueOf(BRANCH.getUuid()));
+ remoteEvent.setBranchGuid(BRANCH);
RemoteBasicGuidArtifact1 remGuidArt = new RemoteBasicGuidArtifact1();
remGuidArt.setModTypeGuid(EventModType.Modified.getGuid());
- remGuidArt.setBranchGuid(String.valueOf(BRANCH.getUuid()));
+ remGuidArt.setBranch(BRANCH);
remGuidArt.setArtTypeGuid(modifiedArt.getArtTypeGuid());
remGuidArt.setArtGuid(modifiedArt.getGuid());
diff --git a/plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF
index 2c633b4942..c81852fe24 100644
--- a/plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.define.report.api/META-INF/MANIFEST.MF
@@ -8,4 +8,6 @@ Bundle-Vendor: Eclipse Open System Engineering Environment
Export-Package: org.eclipse.osee.define.report.api
Import-Package: javax.ws.rs,
javax.ws.rs.core,
+ org.eclipse.osee.framework.core.data,
+ org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util
diff --git a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/WordUpdateChange.java b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/WordUpdateChange.java
index 8a745230d0..b065ce9740 100644
--- a/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/WordUpdateChange.java
+++ b/plugins/org.eclipse.osee.define.report.api/src/org/eclipse/osee/define/report/api/WordUpdateChange.java
@@ -12,16 +12,15 @@ package org.eclipse.osee.define.report.api;
import java.util.LinkedList;
import java.util.List;
-import javax.xml.bind.annotation.XmlRootElement;
+import org.eclipse.osee.framework.core.data.BranchId;
/**
* @author David W. Miller
*/
-@XmlRootElement
public class WordUpdateChange {
- Integer tx;
- Long branchUuid;
- List<WordArtifactChange> changedArts = new LinkedList<>();
+ private Integer tx;
+ private List<WordArtifactChange> changedArts = new LinkedList<>();
+ private BranchId branch;
public Integer getTx() {
return tx;
@@ -31,12 +30,12 @@ public class WordUpdateChange {
this.tx = tx;
}
- public Long getBranchUuid() {
- return branchUuid;
+ public BranchId getBranch() {
+ return branch;
}
- public void setBranchUuid(Long branchUuid) {
- this.branchUuid = branchUuid;
+ public void setBranch(BranchId branch) {
+ this.branch = branch;
}
public List<WordArtifactChange> getChangedArts() {
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
index e2c5d580bf..5c3cce518f 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
@@ -33,6 +33,7 @@ import org.eclipse.osee.ats.rest.IAtsServer;
import org.eclipse.osee.define.report.api.WordArtifactChange;
import org.eclipse.osee.define.report.api.WordUpdateChange;
import org.eclipse.osee.define.report.api.WordUpdateData;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
@@ -196,12 +197,11 @@ public class WordUpdateArtifact {
}
private void postProcessChange(TransactionReadable tx, WordUpdateChange updateChange, ArtifactReadable userId) {
- long branchUuid = tx.getBranchId();
updateChange.setTx(tx.getLocalId());
- updateChange.setBranchUuid(branchUuid);
+ updateChange.setBranch(tx.getBranch());
if (updateChange.hasSafetyRelatedArtifactChange()) {
try {
- ArtifactReadable assocArt = getAssociatedWorkflowArt(branchUuid);
+ ArtifactReadable assocArt = getAssociatedWorkflowArt(tx.getBranch());
IAtsTeamWorkflow safetyWf = getSafetyWorkflow(assocArt);
if (safetyWf == null) {
IAtsTeamWorkflow teamWf = atsServer.getWorkItemFactory().getTeamWf(assocArt);
@@ -213,9 +213,9 @@ public class WordUpdateArtifact {
}
}
- private ArtifactReadable getAssociatedWorkflowArt(long branchUuid) {
+ private ArtifactReadable getAssociatedWorkflowArt(BranchId branchId) {
ArtifactReadable toReturn = null;
- BranchReadable branch = queryFactory.branchQuery().andUuids(branchUuid).getResults().getExactlyOne();
+ BranchReadable branch = queryFactory.branchQuery().andIds(branchId).getResults().getExactlyOne();
long workflowUuid = branch.getAssociatedArtifactId();
try {
toReturn = atsServer.getQuery().andUuid(workflowUuid).andIsOfType(
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java
index fc7b3bfca4..441ca0acc6 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlCacheHandler.java
@@ -14,6 +14,7 @@ import java.util.List;
import org.eclipse.osee.framework.access.AccessControlData;
import org.eclipse.osee.framework.access.AccessObject;
import org.eclipse.osee.framework.access.internal.data.BranchAccessObject;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -21,8 +22,8 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
*/
public class AccessControlCacheHandler {
- public void updateAccessListForBranchObject(AccessControlService service, final long branchUuid) throws OseeCoreException {
- BranchAccessObject branchAccessObject = BranchAccessObject.getBranchAccessObject(branchUuid);
+ public void updateAccessListForBranchObject(AccessControlService service, BranchId branch) throws OseeCoreException {
+ BranchAccessObject branchAccessObject = BranchAccessObject.getBranchAccessObject(branch);
if (branchAccessObject != null) {
updateAccessList(service, branchAccessObject);
}
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessEventListener.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessEventListener.java
index c0b9bebdee..fa6e55e1b1 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessEventListener.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessEventListener.java
@@ -77,7 +77,7 @@ public final class AccessEventListener implements IBranchEventListener, IAccessC
public void handleBranchEvent(Sender sender, final BranchEvent branchEvent) {
try {
if (branchEvent.getEventType() == BranchEventType.Deleted) {
- accessControlCacheHandler.updateAccessListForBranchObject(service, branchEvent.getBranchUuid());
+ accessControlCacheHandler.updateAccessListForBranchObject(service, branchEvent.getSourceBranch());
}
} catch (OseeCoreException ex) {
OseeLog.log(AccessControlHelper.class, Level.SEVERE, ex);
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java
index 10f4e320f0..d4002f90b0 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.framework.access.internal.data;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.osee.framework.access.AccessObject;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.utility.ConnectionHandler;
@@ -51,8 +52,8 @@ public class BranchAccessObject extends AccessObject {
ConnectionHandler.runPreparedUpdate(DELETE_BRANCH_ACL, subjectId, branchUuid);
}
- public static BranchAccessObject getBranchAccessObject(IOseeBranch branch) throws OseeCoreException {
- return getBranchAccessObject(branch.getUuid());
+ public static BranchAccessObject getBranchAccessObject(BranchId branch) throws OseeCoreException {
+ return getBranchAccessObject(branch.getId());
}
public static BranchAccessObject getBranchAccessObject(long branchUuid) {
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicGuidArtifact.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicGuidArtifact.java
index 15c3ed1fae..3734914264 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicGuidArtifact.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/event/DefaultBasicGuidArtifact.java
@@ -10,25 +10,26 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.event;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
/**
* @author Donald G. Dunne
*/
-public class DefaultBasicGuidArtifact extends BaseIdentity<String>implements IBasicGuidArtifact {
- private final Long branchUuid;
+public class DefaultBasicGuidArtifact extends BaseIdentity<String> implements IBasicGuidArtifact {
+ private final BranchId branch;
private Long artTypeGuid;
- public DefaultBasicGuidArtifact(Long branchUuid, Long artTypeGuid, String artGuid) {
+ public DefaultBasicGuidArtifact(BranchId branch, Long artTypeGuid, String artGuid) {
super(artGuid);
- this.branchUuid = branchUuid;
+ this.branch = branch;
this.artTypeGuid = artTypeGuid;
}
@Override
public Long getBranchId() {
- return branchUuid;
+ return branch.getId();
}
@Override
@@ -63,11 +64,7 @@ public class DefaultBasicGuidArtifact extends BaseIdentity<String>implements IBa
}
equals = artTypeGuid.equals(other.getArtTypeGuid());
- if (equals && branchUuid == null || other.getBranchId() == null) {
- equals = false;
- } else if (equals) {
- equals = isOnSameBranch(other);
- }
+ equals &= isOnSameBranch(other);
if (equals && getGuid() == null || other.getGuid() == null) {
equals = false;
diff --git a/plugins/org.eclipse.osee.framework.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.core/META-INF/MANIFEST.MF
index b303513d10..e9777bdf59 100644
--- a/plugins/org.eclipse.osee.framework.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.core/META-INF/MANIFEST.MF
@@ -9,6 +9,13 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.apache.commons.httpclient,
org.apache.commons.httpclient.methods,
org.apache.commons.httpclient.params,
+ org.codehaus.jackson,
+ org.codehaus.jackson.annotate,
+ org.codehaus.jackson.map,
+ org.codehaus.jackson.map.annotate,
+ org.codehaus.jackson.map.deser.std,
+ org.codehaus.jackson.map.ser.std,
+ org.codehaus.jackson.node,
org.eclipse.core.net.proxy,
org.eclipse.osee.framework.jdk.core.text,
org.eclipse.osee.framework.jdk.core.text.change,
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java
index a5007d841a..08e4f87afe 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchId.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.data;
+import org.codehaus.jackson.annotate.JsonCreator;
import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.Identity;
@@ -28,7 +29,12 @@ public interface BranchId extends Identity<Long>, HasUuid, Id {
return getId();
};
- default Long getBranchId() {
- return getId();
+ public static BranchId valueOf(String id) {
+ return valueOf(Long.valueOf(id));
+ }
+
+ @JsonCreator
+ public static BranchId valueOf(long id) {
+ return TokenFactory.createBranch(id);
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/HasBranch.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/HasBranch.java
index c6251b67ee..b2dda8d559 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/HasBranch.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/HasBranch.java
@@ -31,7 +31,7 @@ public interface HasBranch {
return other == null ? false : getBranchId().equals(other.getBranchId());
}
- default boolean isOnBranch(IOseeBranch branch) {
- return getBranchId().equals(branch.getUuid());
+ default boolean isOnBranch(BranchId branch) {
+ return branch != null && getBranchId().equals(branch.getId());
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java
index 25656d36c4..551564a2ee 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java
@@ -86,6 +86,10 @@ public final class TokenFactory {
return new BranchToken(branchId, null);
}
+ public static BranchId createBranch() {
+ return new BranchToken(Lib.generateUuid(), null);
+ }
+
public static IRelationSorterId createSorterId(String guid, String name) {
return new SorterIdToken(guid, name);
}
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF
index 54d903fbf8..5b84e516e0 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.jdk.core/META-INF/MANIFEST.MF
@@ -29,4 +29,8 @@ Export-Package: org.eclipse.osee.framework.jdk.core.collection.tree,
org.eclipse.osee.framework.jdk.core.validate
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.apache.commons.codec.binary,
- org.apache.xml.serialize
+ org.codehaus.jackson,
+ org.codehaus.jackson.map,
+ org.codehaus.jackson.map.annotate,
+ org.codehaus.jackson.map.ser.std
+
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java
index 5d42abc3b7..646a17d348 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/Id.java
@@ -11,19 +11,26 @@
package org.eclipse.osee.framework.jdk.core.type;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
/**
* @author Ryan D. Brooks
*/
+@JsonSerialize(using = IdSerializer.class)
public interface Id {
Long getId();
- default boolean matches(BaseId... identities) {
- for (BaseId identity : identities) {
+ default boolean matches(Id... identities) {
+ for (Id identity : identities) {
if (equals(identity)) {
return true;
}
}
return false;
}
+
+ default boolean equals(Long id) {
+ return getId().equals(id);
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/IdSerializer.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/IdSerializer.java
new file mode 100644
index 0000000000..9a39df37f4
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/IdSerializer.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016 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.jdk.core.type;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.JsonGenerator;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.map.SerializerProvider;
+import org.codehaus.jackson.map.TypeSerializer;
+import org.codehaus.jackson.map.ser.std.SerializerBase;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class IdSerializer extends SerializerBase<Id> {
+
+ public IdSerializer() {
+ super(Id.class);
+ }
+
+ @Override
+ public void serialize(Id id, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException {
+ jgen.writeString(id.getId().toString());
+ }
+
+ /**
+ * Default implementation will write type prefix, call regular serialization method (since assumption is that value
+ * itself does not need JSON Array or Object start/end markers), and then write type suffix. This should work for
+ * most cases; some sub-classes may want to change this behavior.
+ */
+ @Override
+ public void serializeWithType(Id id, JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws IOException, JsonGenerationException {
+ typeSer.writeTypePrefixForScalar(id, jgen);
+ serialize(id, jgen, provider);
+ typeSer.writeTypeSuffixForScalar(id, jgen);
+ }
+
+ @Override
+ public JsonNode getSchema(SerializerProvider provider, Type typeHint) {
+ return createSchemaNode("string", true);
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/NamedId.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/NamedId.java
index 5eec5394b2..d43c70a597 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/NamedId.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/NamedId.java
@@ -33,6 +33,6 @@ public class NamedId extends BaseId implements Named {
@Override
public String toString() {
- return getName();
+ return name == null ? super.toString() : name;
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.messaging.event.res/META-INF/MANIFEST.MF
index 213cf4d49b..b33a495368 100644
--- a/plugins/org.eclipse.osee.framework.messaging.event.res/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.messaging.event.res/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Bundle-Description: Skynet Event Service - Skynet Cache Network Manager
Bundle-Vendor: Eclipse Open System Engineering Environment
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.eclipse.core.runtime,
+ org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.util,
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidArtifact1.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidArtifact1.java
index 40a236a6db..bc87c9eaf1 100644
--- a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidArtifact1.java
+++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidArtifact1.java
@@ -12,7 +12,11 @@ import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
/**
@@ -20,7 +24,7 @@ import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
* Java class for RemoteBasicGuidArtifact1 complex type.
* <p>
* The following schema fragment specifies the expected content contained within this class.
- *
+ *
* <pre>
* &lt;complexType name="RemoteBasicGuidArtifact1">
* &lt;complexContent>
@@ -58,10 +62,12 @@ public class RemoteBasicGuidArtifact1 extends RemoteEvent {
@XmlElement(required = true)
protected List<RemoteAttributeChange1> attributes;
protected long toArtTypeGuid;
+ @XmlTransient
+ private BranchId branch;
/**
* Gets the value of the modTypeGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getModTypeGuid() {
@@ -70,7 +76,7 @@ public class RemoteBasicGuidArtifact1 extends RemoteEvent {
/**
* Sets the value of the modTypeGuid property.
- *
+ *
* @param value allowed object is {@link String }
*/
public void setModTypeGuid(String value) {
@@ -79,20 +85,24 @@ public class RemoteBasicGuidArtifact1 extends RemoteEvent {
/**
* Gets the value of the branchGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getBranchGuid() {
return branchGuid;
}
- /**
- * Sets the value of the branchGuid property.
- *
- * @param value allowed object is {@link String }
- */
- public void setBranchGuid(String value) {
- this.branchGuid = value;
+ public BranchId getBranch() {
+ if (branch == null && Strings.isNumeric(branchGuid)) {
+ branch = TokenFactory.createBranch(Long.valueOf(branchGuid));
+ }
+
+ return branch;
+ }
+
+ public void setBranch(BranchId branch) {
+ this.branch = branch;
+ this.branchGuid = branch.getId().toString();
}
/**
@@ -111,7 +121,7 @@ public class RemoteBasicGuidArtifact1 extends RemoteEvent {
/**
* Gets the value of the artGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getArtGuid() {
@@ -120,7 +130,7 @@ public class RemoteBasicGuidArtifact1 extends RemoteEvent {
/**
* Sets the value of the artGuid property.
- *
+ *
* @param value allowed object is {@link String }
*/
public void setArtGuid(String value) {
@@ -135,7 +145,7 @@ public class RemoteBasicGuidArtifact1 extends RemoteEvent {
* the attributes property.
* <p>
* For example, to add a new item, do as follows:
- *
+ *
* <pre>
* getAttributes().add(newItem);
* </pre>
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java
index d2ab0b0947..26651a945b 100644
--- a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java
+++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelation1.java
@@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
/**
@@ -18,7 +19,7 @@ import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
* Java class for RemoteBasicGuidRelation1 complex type.
* <p>
* The following schema fragment specifies the expected content contained within this class.
- *
+ *
* <pre>
* &lt;complexType name="RemoteBasicGuidRelation1">
* &lt;complexContent>
@@ -72,7 +73,7 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Gets the value of the modTypeGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getModTypeGuid() {
@@ -81,7 +82,7 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Sets the value of the modTypeGuid property.
- *
+ *
* @param value allowed object is {@link String }
*/
public void setModTypeGuid(String value) {
@@ -90,7 +91,7 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Gets the value of the branchGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getBranchGuid() {
@@ -99,11 +100,11 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Sets the value of the branchGuid property.
- *
+ *
* @param value allowed object is {@link String }
*/
- public void setBranchGuid(String value) {
- this.branchGuid = value;
+ public void setBranchGuid(BranchId branch) {
+ this.branchGuid = branch.getId().toString();
}
/**
@@ -164,7 +165,7 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Gets the value of the artA property.
- *
+ *
* @return possible object is {@link RemoteBasicGuidArtifact1 }
*/
public RemoteBasicGuidArtifact1 getArtA() {
@@ -173,7 +174,7 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Sets the value of the artA property.
- *
+ *
* @param value allowed object is {@link RemoteBasicGuidArtifact1 }
*/
public void setArtA(RemoteBasicGuidArtifact1 value) {
@@ -196,7 +197,7 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Gets the value of the artB property.
- *
+ *
* @return possible object is {@link RemoteBasicGuidArtifact1 }
*/
public RemoteBasicGuidArtifact1 getArtB() {
@@ -205,7 +206,7 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Sets the value of the artB property.
- *
+ *
* @param value allowed object is {@link RemoteBasicGuidArtifact1 }
*/
public void setArtB(RemoteBasicGuidArtifact1 value) {
@@ -214,7 +215,7 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Gets the value of the rationale property.
- *
+ *
* @return possible object is {@link String }
*/
public String getRationale() {
@@ -223,7 +224,7 @@ public class RemoteBasicGuidRelation1 extends RemoteEvent {
/**
* Sets the value of the rationale property.
- *
+ *
* @param value allowed object is {@link String }
*/
public void setRationale(String value) {
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelationReorder1.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelationReorder1.java
index c38a430afc..7f7cbfb1e9 100644
--- a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelationReorder1.java
+++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBasicGuidRelationReorder1.java
@@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
/**
@@ -18,7 +19,7 @@ import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
* Java class for RemoteBasicGuidRelationReorder1 complex type.
* <p>
* The following schema fragment specifies the expected content contained within this class.
- *
+ *
* <pre>
* &lt;complexType name="RemoteBasicGuidRelationReorder1">
* &lt;complexContent>
@@ -52,7 +53,7 @@ public class RemoteBasicGuidRelationReorder1 extends RemoteEvent {
/**
* Gets the value of the modTypeGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getModTypeGuid() {
@@ -61,7 +62,7 @@ public class RemoteBasicGuidRelationReorder1 extends RemoteEvent {
/**
* Sets the value of the modTypeGuid property.
- *
+ *
* @param value allowed object is {@link String }
*/
public void setModTypeGuid(String value) {
@@ -70,20 +71,15 @@ public class RemoteBasicGuidRelationReorder1 extends RemoteEvent {
/**
* Gets the value of the branchGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getBranchGuid() {
return branchGuid;
}
- /**
- * Sets the value of the branchGuid property.
- *
- * @param value allowed object is {@link String }
- */
- public void setBranchGuid(String value) {
- this.branchGuid = value;
+ public void setBranchGuid(BranchId branch) {
+ this.branchGuid = branch.getId().toString();
}
/**
@@ -102,7 +98,7 @@ public class RemoteBasicGuidRelationReorder1 extends RemoteEvent {
/**
* Gets the value of the parentArt property.
- *
+ *
* @return possible object is {@link RemoteBasicGuidArtifact1 }
*/
public RemoteBasicGuidArtifact1 getParentArt() {
@@ -111,7 +107,7 @@ public class RemoteBasicGuidRelationReorder1 extends RemoteEvent {
/**
* Sets the value of the parentArt property.
- *
+ *
* @param value allowed object is {@link RemoteBasicGuidArtifact1 }
*/
public void setParentArt(RemoteBasicGuidArtifact1 value) {
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBranchEvent1.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBranchEvent1.java
index 3104bcbd2c..2da9b1beaa 100644
--- a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBranchEvent1.java
+++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteBranchEvent1.java
@@ -11,6 +11,9 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
/**
@@ -18,7 +21,7 @@ import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
* Java class for RemoteBranchEvent1 complex type.
* <p>
* The following schema fragment specifies the expected content contained within this class.
- *
+ *
* <pre>
* &lt;complexType name="RemoteBranchEvent1">
* &lt;complexContent>
@@ -52,7 +55,7 @@ public class RemoteBranchEvent1 extends RemoteEvent {
/**
* Gets the value of the eventTypeGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getEventTypeGuid() {
@@ -61,52 +64,41 @@ public class RemoteBranchEvent1 extends RemoteEvent {
/**
* Sets the value of the eventTypeGuid property.
- *
+ *
* @param value allowed object is {@link String }
*/
public void setEventTypeGuid(String value) {
this.eventTypeGuid = value;
}
- /**
- * Gets the value of the branchGuid property.
- *
- * @return possible object is {@link String }
- */
public String getBranchGuid() {
return branchGuid;
}
- /**
- * Sets the value of the branchGuid property.
- *
- * @param value allowed object is {@link String }
- */
- public void setBranchGuid(String value) {
- this.branchGuid = value;
+ public BranchId getBranch() {
+ return TokenFactory.createBranch(Long.valueOf(branchGuid));
+ }
+
+ public void setBranch(BranchId banch) {
+ this.branchGuid = banch.getId().toString();
}
- /**
- * Gets the value of the destinationBranchGuid property.
- *
- * @return possible object is {@link String }
- */
public String getDestinationBranchGuid() {
return destinationBranchGuid;
}
- /**
- * Sets the value of the destinationBranchGuid property.
- *
- * @param value allowed object is {@link String }
- */
- public void setDestinationBranchGuid(String value) {
- this.destinationBranchGuid = value;
+ public BranchId getDestinationBranch() {
+ return Strings.isNumeric(destinationBranchGuid) ? TokenFactory.createBranch(
+ Long.valueOf(destinationBranchGuid)) : null;
+ }
+
+ public void setDestinationBranch(BranchId branch) {
+ this.destinationBranchGuid = branch == null ? null : branch.getId().toString();
}
/**
* Gets the value of the networkSender property.
- *
+ *
* @return possible object is {@link RemoteNetworkSender1 }
*/
@Override
@@ -116,7 +108,7 @@ public class RemoteBranchEvent1 extends RemoteEvent {
/**
* Sets the value of the networkSender property.
- *
+ *
* @param value allowed object is {@link RemoteNetworkSender1 }
*/
public void setNetworkSender(RemoteNetworkSender1 value) {
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemotePersistEvent1.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemotePersistEvent1.java
index 94c443b027..0176bac885 100644
--- a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemotePersistEvent1.java
+++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemotePersistEvent1.java
@@ -13,6 +13,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
/**
@@ -20,7 +21,7 @@ import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
* Java class for RemotePersistEvent1 complex type.
* <p>
* The following schema fragment specifies the expected content contained within this class.
- *
+ *
* <pre>
* &lt;complexType name="RemotePersistEvent1">
* &lt;complexContent>
@@ -62,20 +63,15 @@ public class RemotePersistEvent1 extends RemoteEvent {
/**
* Gets the value of the branchGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getBranchGuid() {
return branchGuid;
}
- /**
- * Sets the value of the branchGuid property.
- *
- * @param value allowed object is {@link String }
- */
- public void setBranchGuid(String value) {
- this.branchGuid = value;
+ public void setBranchGuid(BranchId branch) {
+ this.branchGuid = branch.getId().toString();
}
/**
@@ -100,7 +96,7 @@ public class RemotePersistEvent1 extends RemoteEvent {
* the artifacts property.
* <p>
* For example, to add a new item, do as follows:
- *
+ *
* <pre>
* getArtifacts().add(newItem);
* </pre>
@@ -122,7 +118,7 @@ public class RemotePersistEvent1 extends RemoteEvent {
* the relations property.
* <p>
* For example, to add a new item, do as follows:
- *
+ *
* <pre>
* getRelations().add(newItem);
* </pre>
@@ -144,7 +140,7 @@ public class RemotePersistEvent1 extends RemoteEvent {
* the relationReorders property.
* <p>
* For example, to add a new item, do as follows:
- *
+ *
* <pre>
* getRelationReorders().add(newItem);
* </pre>
@@ -160,7 +156,7 @@ public class RemotePersistEvent1 extends RemoteEvent {
/**
* Gets the value of the networkSender property.
- *
+ *
* @return possible object is {@link RemoteNetworkSender1 }
*/
@Override
@@ -170,7 +166,7 @@ public class RemotePersistEvent1 extends RemoteEvent {
/**
* Sets the value of the networkSender property.
- *
+ *
* @param value allowed object is {@link RemoteNetworkSender1 }
*/
public void setNetworkSender(RemoteNetworkSender1 value) {
diff --git a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteTransactionChange1.java b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteTransactionChange1.java
index e04d4d15e6..c27b1635cf 100644
--- a/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteTransactionChange1.java
+++ b/plugins/org.eclipse.osee.framework.messaging.event.res/src-gen/org/eclipse/osee/framework/messaging/event/res/msgs/RemoteTransactionChange1.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.messaging.event.res.RemoteEvent;
* Java class for RemoteTransactionChange1 complex type.
* <p>
* The following schema fragment specifies the expected content contained within this class.
- *
+ *
* <pre>
* &lt;complexType name="RemoteTransactionChange1">
* &lt;complexContent>
@@ -47,20 +47,15 @@ public class RemoteTransactionChange1 extends RemoteEvent {
/**
* Gets the value of the branchGuid property.
- *
+ *
* @return possible object is {@link String }
*/
public String getBranchGuid() {
return branchGuid;
}
- /**
- * Sets the value of the branchGuid property.
- *
- * @param value allowed object is {@link String }
- */
- public void setBranchGuid(String value) {
- this.branchGuid = value;
+ public void setBranchGuid(Long branchId) {
+ this.branchGuid = branchId.toString();
}
/**
@@ -85,7 +80,7 @@ public class RemoteTransactionChange1 extends RemoteEvent {
* the artifacts property.
* <p>
* For example, to add a new item, do as follows:
- *
+ *
* <pre>
* getArtifacts().add(newItem);
* </pre>
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidArtifactTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidArtifactTest.java
index 0aa76b7c07..107285c70a 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidArtifactTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidArtifactTest.java
@@ -10,12 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.event;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact;
import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidArtifact;
import org.eclipse.osee.framework.skynet.core.event.model.EventModType;
import org.junit.Assert;
@@ -28,30 +28,28 @@ public class EventBasicGuidArtifactTest {
@Test
public void testEqualsEventBasicGuidArtifact() {
- EventBasicGuidArtifact eventArt1 =
- new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(), 0x01L, GUID.create());
- EventBasicGuidArtifact eventArt2 = new EventBasicGuidArtifact(EventModType.Added, eventArt1.getBranchId(),
- eventArt1.getArtTypeGuid(), eventArt1.getGuid());
+ EventBasicGuidArtifact eventArt1 = new EventBasicGuidArtifact(EventModType.Added, COMMON, 0x01L, GUID.create());
+ EventBasicGuidArtifact eventArt2 =
+ new EventBasicGuidArtifact(EventModType.Added, COMMON, eventArt1.getArtTypeGuid(), eventArt1.getGuid());
Assert.assertEquals(eventArt1.hashCode(), eventArt2.hashCode());
Assert.assertEquals(eventArt1, eventArt2);
- eventArt2 = new EventBasicGuidArtifact(EventModType.Deleted, eventArt1.getBranchId(), eventArt1.getArtTypeGuid(),
- eventArt1.getGuid());
+ eventArt2 =
+ new EventBasicGuidArtifact(EventModType.Deleted, COMMON, eventArt1.getArtTypeGuid(), eventArt1.getGuid());
Assert.assertNotSame(eventArt1, eventArt2);
- eventArt2 = new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(), eventArt1.getArtTypeGuid(),
- eventArt1.getGuid());
+ eventArt2 =
+ new EventBasicGuidArtifact(EventModType.Added, COMMON, eventArt1.getArtTypeGuid(), eventArt1.getGuid());
Assert.assertNotSame(eventArt1, eventArt2);
- eventArt2 = new EventBasicGuidArtifact(EventModType.Added, eventArt1.getBranchId(), 0x02L, eventArt1.getGuid());
+ eventArt2 = new EventBasicGuidArtifact(EventModType.Added, COMMON, 0x02L, eventArt1.getGuid());
Assert.assertNotSame(eventArt1, eventArt2);
- eventArt2 = new EventBasicGuidArtifact(EventModType.Added, eventArt1.getBranchId(), eventArt1.getArtTypeGuid(),
- GUID.create());
+ eventArt2 = new EventBasicGuidArtifact(EventModType.Added, COMMON, eventArt1.getArtTypeGuid(), GUID.create());
Assert.assertNotSame(eventArt1, eventArt2);
@@ -72,29 +70,28 @@ public class EventBasicGuidArtifactTest {
@Test
public void testEqualsBasicGuidArtifact() {
- EventBasicGuidArtifact eventArt1 =
- new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(), 0x01L, GUID.create());
+ EventBasicGuidArtifact eventArt1 = new EventBasicGuidArtifact(EventModType.Added, COMMON, 0x01L, GUID.create());
DefaultBasicGuidArtifact eventArt2 =
- new DefaultBasicGuidArtifact(eventArt1.getBranchId(), eventArt1.getArtTypeGuid(), eventArt1.getGuid());
+ new DefaultBasicGuidArtifact(eventArt1.getBranch(), eventArt1.getArtTypeGuid(), eventArt1.getGuid());
Assert.assertEquals(eventArt1.hashCode(), eventArt2.hashCode());
Assert.assertEquals(eventArt1, eventArt2);
- eventArt2 = new EventBasicGuidArtifact(EventModType.Deleted, eventArt1.getBranchId(), eventArt1.getArtTypeGuid(),
+ eventArt2 = new EventBasicGuidArtifact(EventModType.Deleted, eventArt1.getBranch(), eventArt1.getArtTypeGuid(),
eventArt1.getGuid());
Assert.assertNotSame(eventArt1, eventArt2);
- eventArt2 = new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(), eventArt1.getArtTypeGuid(),
- eventArt1.getGuid());
+ eventArt2 =
+ new EventBasicGuidArtifact(EventModType.Added, COMMON, eventArt1.getArtTypeGuid(), eventArt1.getGuid());
Assert.assertNotSame(eventArt1, eventArt2);
- eventArt2 = new EventBasicGuidArtifact(EventModType.Added, eventArt1.getBranchId(), 0x02L, eventArt1.getGuid());
+ eventArt2 = new EventBasicGuidArtifact(EventModType.Added, eventArt1.getBranch(), 0x02L, eventArt1.getGuid());
Assert.assertNotSame(eventArt1, eventArt2);
- eventArt2 = new EventBasicGuidArtifact(EventModType.Added, eventArt1.getBranchId(), eventArt1.getArtTypeGuid(),
+ eventArt2 = new EventBasicGuidArtifact(EventModType.Added, eventArt1.getBranch(), eventArt1.getArtTypeGuid(),
GUID.create());
Assert.assertNotSame(eventArt1, eventArt2);
@@ -116,8 +113,7 @@ public class EventBasicGuidArtifactTest {
@Test
public void testEventBasicGuidArtifactIs() {
- EventBasicGuidArtifact eventArt1 =
- new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(), 0x01L, GUID.create());
+ EventBasicGuidArtifact eventArt1 = new EventBasicGuidArtifact(EventModType.Added, COMMON, 0x01L, GUID.create());
Assert.assertTrue(eventArt1.is(EventModType.Added));
Assert.assertTrue(eventArt1.is(EventModType.Added, EventModType.ChangeType));
Assert.assertFalse(eventArt1.is(EventModType.ChangeType));
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java
index 60f7458e1d..f7297b5ed7 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventBasicGuidRelationTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.event;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
@@ -27,9 +28,9 @@ public class EventBasicGuidRelationTest {
@Test
public void testEqualsEventBasicGuidRelation() {
- DefaultBasicGuidArtifact eventArt1 = new DefaultBasicGuidArtifact(Lib.generateUuid(), 0x01L, GUID.create());
+ DefaultBasicGuidArtifact eventArt1 = new DefaultBasicGuidArtifact(COMMON, 0x01L, GUID.create());
DefaultBasicGuidArtifact eventArt2 =
- new DefaultBasicGuidArtifact(eventArt1.getBranchId(), eventArt1.getArtTypeGuid(), eventArt1.getGuid());
+ new DefaultBasicGuidArtifact(eventArt1.getBranch(), eventArt1.getArtTypeGuid(), eventArt1.getGuid());
EventBasicGuidRelation eventRel1 = new EventBasicGuidRelation(RelationEventType.Added, eventArt1.getBranchId(),
0x02L, 234, 333, 34, eventArt1, 33, eventArt2);
@@ -93,9 +94,9 @@ public class EventBasicGuidRelationTest {
@Test
public void testEventBasicGuidRelationIs() {
- DefaultBasicGuidArtifact eventArt1 = new DefaultBasicGuidArtifact(Lib.generateUuid(), 0x03L, GUID.create());
+ DefaultBasicGuidArtifact eventArt1 = new DefaultBasicGuidArtifact(COMMON, 0x03L, GUID.create());
DefaultBasicGuidArtifact eventArt2 =
- new DefaultBasicGuidArtifact(eventArt1.getBranchId(), eventArt1.getArtTypeGuid(), eventArt1.getGuid());
+ new DefaultBasicGuidArtifact(eventArt1.getBranch(), eventArt1.getArtTypeGuid(), eventArt1.getGuid());
EventBasicGuidRelation eventRel1 = new EventBasicGuidRelation(RelationEventType.Added, eventArt1.getBranchId(),
0x04L, 234, 333, 34, eventArt1, 33, eventArt2);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventChangeTypeBasicGuidArtifactTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventChangeTypeBasicGuidArtifactTest.java
index 668969903d..46431cda7a 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventChangeTypeBasicGuidArtifactTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/EventChangeTypeBasicGuidArtifactTest.java
@@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.event;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidArtifact;
import org.eclipse.osee.framework.skynet.core.event.model.EventChangeTypeBasicGuidArtifact;
import org.junit.Assert;
@@ -27,29 +27,29 @@ public class EventChangeTypeBasicGuidArtifactTest {
@Test
public void testEquals() {
EventChangeTypeBasicGuidArtifact eventArt1 =
- new EventChangeTypeBasicGuidArtifact(Lib.generateUuid(), 1234L, 546L, GUID.create());
- EventChangeTypeBasicGuidArtifact eventArt2 = new EventChangeTypeBasicGuidArtifact(eventArt1.getBranchId(),
+ new EventChangeTypeBasicGuidArtifact(COMMON, 1234L, 546L, GUID.create());
+ EventChangeTypeBasicGuidArtifact eventArt2 = new EventChangeTypeBasicGuidArtifact(eventArt1.getBranch(),
eventArt1.getFromArtTypeGuid(), eventArt1.getArtTypeGuid(), eventArt1.getGuid());
Assert.assertEquals(eventArt1.hashCode(), eventArt2.hashCode());
Assert.assertEquals(eventArt1, eventArt2);
- eventArt2 = new EventChangeTypeBasicGuidArtifact(eventArt1.getBranchId(), eventArt1.getFromArtTypeGuid(),
+ eventArt2 = new EventChangeTypeBasicGuidArtifact(eventArt1.getBranch(), eventArt1.getFromArtTypeGuid(),
eventArt1.getArtTypeGuid(), eventArt1.getGuid());
Assert.assertNotSame(eventArt1, eventArt2);
- eventArt2 = new EventChangeTypeBasicGuidArtifact(Lib.generateUuid(), eventArt1.getFromArtTypeGuid(),
+ eventArt2 = new EventChangeTypeBasicGuidArtifact(COMMON, eventArt1.getFromArtTypeGuid(),
eventArt1.getArtTypeGuid(), eventArt1.getGuid());
Assert.assertNotSame(eventArt1, eventArt2);
- eventArt2 = new EventChangeTypeBasicGuidArtifact(eventArt1.getBranchId(), 111L, eventArt1.getArtTypeGuid(),
+ eventArt2 = new EventChangeTypeBasicGuidArtifact(eventArt1.getBranch(), 111L, eventArt1.getArtTypeGuid(),
eventArt1.getGuid());
Assert.assertNotSame(eventArt1, eventArt2);
- eventArt2 = new EventChangeTypeBasicGuidArtifact(eventArt1.getBranchId(), eventArt1.getFromArtTypeGuid(),
+ eventArt2 = new EventChangeTypeBasicGuidArtifact(eventArt1.getBranch(), eventArt1.getFromArtTypeGuid(),
eventArt1.getArtTypeGuid(), GUID.create());
Assert.assertNotSame(eventArt1, eventArt2);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java
index 5c249e67d0..cac3348fed 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilterTest.java
@@ -5,11 +5,13 @@
*/
package org.eclipse.osee.framework.skynet.core.event.filter;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.model.event.IBasicGuidRelation;
import org.eclipse.osee.framework.jdk.core.util.GUID;
@@ -41,12 +43,11 @@ public class ArtifactTypeEventFilterTest {
@Test
public void testArtifactEventFilters_artifactTypeAndInherited() throws Exception {
- long branchUuid = Lib.generateUuid();
when(typeProvider.getTypeByGuid(CoreArtifactTypes.Requirement.getGuid())).thenReturn(
CoreArtifactTypes.Requirement);
ArtifactTypeEventFilter typeFilter = new ArtifactTypeEventFilter(typeProvider, CoreArtifactTypes.Requirement);
- EventBasicGuidArtifact guidArt = new EventBasicGuidArtifact(EventModType.Added, branchUuid,
- CoreArtifactTypes.Requirement.getGuid(), GUID.create());
+ EventBasicGuidArtifact guidArt =
+ new EventBasicGuidArtifact(EventModType.Added, COMMON, CoreArtifactTypes.Requirement.getGuid(), GUID.create());
List<EventBasicGuidArtifact> guidArts = Arrays.asList(guidArt);
Assert.assertTrue("Should match cause same artifact type", typeFilter.isMatchArtifacts(guidArts));
@@ -74,9 +75,9 @@ public class ArtifactTypeEventFilterTest {
when(typeProvider.getTypeByGuid(CoreArtifactTypes.Requirement.getGuid())).thenReturn(
CoreArtifactTypes.Requirement);
- EventBasicGuidArtifact guidArtA = new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(),
- CoreArtifactTypes.Requirement.getGuid(), GUID.create());
- EventBasicGuidArtifact guidArtB = new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(),
+ EventBasicGuidArtifact guidArtA =
+ new EventBasicGuidArtifact(EventModType.Added, COMMON, CoreArtifactTypes.Requirement.getGuid(), GUID.create());
+ EventBasicGuidArtifact guidArtB = new EventBasicGuidArtifact(EventModType.Added, COMMON,
CoreArtifactTypes.SoftwareRequirement.getGuid(), GUID.create());
List<IBasicGuidRelation> relations = new ArrayList<>();
@@ -96,9 +97,7 @@ public class ArtifactTypeEventFilterTest {
@Test
public void testBranchMatch_isMatch() throws Exception {
ArtifactTypeEventFilter typeFilter = new ArtifactTypeEventFilter(typeProvider, CoreArtifactTypes.Requirement);
- Assert.assertTrue(typeFilter.isMatch(234324L));
- Assert.assertTrue(typeFilter.isMatch(0L));
- Assert.assertTrue(typeFilter.isMatch(-123123L));
+ Assert.assertTrue(typeFilter.isMatch(COMMON));
+ Assert.assertTrue(typeFilter.isMatch(CoreBranches.SYSTEM_ROOT));
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java
index 5e62dca4d3..8d96f9f399 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilterTest.java
@@ -12,8 +12,10 @@ package org.eclipse.osee.framework.skynet.core.event.filter;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.SYSTEM_ROOT;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact;
@@ -37,17 +39,17 @@ public class BranchUuidEventFilterTest {
@Test
public void testIsMatch() {
BranchUuidEventFilter branchFilter = new BranchUuidEventFilter(COMMON);
- Assert.assertTrue(branchFilter.isMatch(COMMON_ID));
- Assert.assertFalse(branchFilter.isMatch(23444235235324L));
+ Assert.assertTrue(branchFilter.isMatch(COMMON));
+ Assert.assertFalse(branchFilter.isMatch(SYSTEM_ROOT));
}
@Test
public void testIsMatchArtifacts() {
BranchUuidEventFilter branchFilter = new BranchUuidEventFilter(COMMON);
- EventBasicGuidArtifact guidArtA = new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(),
+ EventBasicGuidArtifact guidArtA = new EventBasicGuidArtifact(EventModType.Added, TokenFactory.createBranch(),
CoreArtifactTypes.Requirement.getGuid(), GUID.create());
- EventBasicGuidArtifact guidArtB = new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(),
+ EventBasicGuidArtifact guidArtB = new EventBasicGuidArtifact(EventModType.Added, TokenFactory.createBranch(),
CoreArtifactTypes.SoftwareRequirement.getGuid(), GUID.create());
List<IBasicGuidArtifact> arts = new ArrayList<>();
arts.add(guidArtB);
@@ -55,8 +57,8 @@ public class BranchUuidEventFilterTest {
Assert.assertFalse(branchFilter.isMatchArtifacts(arts));
- guidArtA = new EventBasicGuidArtifact(EventModType.Added, COMMON_ID, CoreArtifactTypes.Requirement.getGuid(),
- GUID.create());
+ guidArtA =
+ new EventBasicGuidArtifact(EventModType.Added, COMMON, CoreArtifactTypes.Requirement.getGuid(), GUID.create());
arts.clear();
arts.add(guidArtB);
arts.add(guidArtA);
@@ -68,9 +70,9 @@ public class BranchUuidEventFilterTest {
public void testIsMatchRelationArtifacts() {
BranchUuidEventFilter branchFilter = new BranchUuidEventFilter(COMMON);
- EventBasicGuidArtifact guidArtA = new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(),
+ EventBasicGuidArtifact guidArtA = new EventBasicGuidArtifact(EventModType.Added, TokenFactory.createBranch(),
CoreArtifactTypes.Requirement.getGuid(), GUID.create());
- EventBasicGuidArtifact guidArtB = new EventBasicGuidArtifact(EventModType.Added, Lib.generateUuid(),
+ EventBasicGuidArtifact guidArtB = new EventBasicGuidArtifact(EventModType.Added, TokenFactory.createBranch(),
CoreArtifactTypes.SoftwareRequirement.getGuid(), GUID.create());
List<IBasicGuidRelation> relations = new ArrayList<>();
@@ -81,10 +83,10 @@ public class BranchUuidEventFilterTest {
// neither in relation matches common branch
Assert.assertFalse(branchFilter.isMatchRelationArtifacts(relations));
- guidArtA = new EventBasicGuidArtifact(EventModType.Added, COMMON_ID, CoreArtifactTypes.Requirement.getGuid(),
+ guidArtA =
+ new EventBasicGuidArtifact(EventModType.Added, COMMON, CoreArtifactTypes.Requirement.getGuid(), GUID.create());
+ guidArtB = new EventBasicGuidArtifact(EventModType.Added, COMMON, CoreArtifactTypes.SoftwareRequirement.getGuid(),
GUID.create());
- guidArtB = new EventBasicGuidArtifact(EventModType.Added, COMMON_ID,
- CoreArtifactTypes.SoftwareRequirement.getGuid(), GUID.create());
relations.clear();
relation = new EventBasicGuidRelation(RelationEventType.Added, COMMON_ID,
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/internal/event/EventListenerRegistryTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/internal/event/EventListenerRegistryTest.java
index dbe5ce14cb..529063cf9a 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/internal/event/EventListenerRegistryTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/internal/event/EventListenerRegistryTest.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.skynet.core.internal.event;
import java.util.Collection;
import java.util.List;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.skynet.core.event.filter.IEventFilter;
import org.eclipse.osee.framework.skynet.core.event.listener.EventQosType;
@@ -31,7 +32,7 @@ import org.junit.Test;
/**
* Test Case for @{link EventListenerRegistry}
- *
+ *
* @author Roberto E. Escobar
*/
public class EventListenerRegistryTest {
@@ -66,8 +67,8 @@ public class EventListenerRegistryTest {
Assert.assertEquals(1, listener2.size());
Assert.assertEquals(delegate1, listener2.iterator().next());
- Collection<IEventListener> listener3 =
- registry.getListeners(EventQosType.NORMAL, new BranchEvent(BranchEventType.Added, 3L));
+ Collection<IEventListener> listener3 = registry.getListeners(EventQosType.NORMAL,
+ new BranchEvent(BranchEventType.Added, TokenFactory.createBranch(3L)));
Assert.assertEquals(1, listener3.size());
Assert.assertEquals(delegate2, listener3.iterator().next());
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
index d2c7df882f..9c473652ac 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
@@ -1708,7 +1708,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, I
}
public final DefaultBasicGuidArtifact getBasicGuidArtifact() {
- return new DefaultBasicGuidArtifact(getBranchId(), getArtifactType().getGuid(), getGuid());
+ return new DefaultBasicGuidArtifact(getBranch(), getArtifactType().getGuid(), getGuid());
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
index 383f91e317..45c73f6fc7 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osee.framework.core.client.OseeClientProperties;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
@@ -138,7 +139,7 @@ public final class BranchManager {
return Collections.castAll(getCache().getByName(branchName));
}
- public static Branch getBranch(IOseeBranch branch) throws OseeCoreException {
+ public static Branch getBranch(BranchId branch) throws OseeCoreException {
if (branch instanceof Branch) {
return (Branch) branch;
} else {
@@ -149,9 +150,9 @@ public final class BranchManager {
/**
* Do not call this method unless absolutely neccessary due to performance impacts.
*/
- public static synchronized void checkAndReload(Long uuid) throws OseeCoreException {
- if (!branchExists(uuid)) {
- loadBranchToCache(uuid);
+ public static synchronized void checkAndReload(BranchId branch) throws OseeCoreException {
+ if (!branchExists(branch)) {
+ loadBranchToCache(branch.getId());
}
}
@@ -182,7 +183,7 @@ public final class BranchManager {
}
}
- public static boolean branchExists(IOseeBranch branchToken) throws OseeCoreException {
+ public static boolean branchExists(BranchId branchToken) throws OseeCoreException {
return getCache().get(branchToken) != null;
}
@@ -244,8 +245,8 @@ public final class BranchManager {
return branch;
}
- public static void reloadBranch(long uuid) {
- loadBranchToCache(uuid);
+ public static void reloadBranch(BranchId branch) {
+ loadBranchToCache(branch.getId());
}
public static Collection<Branch> getAll() {
@@ -569,7 +570,7 @@ public final class BranchManager {
Operations.executeWorkAndCheckStatus(operation);
}
- public static Integer getAssociatedArtifactId(IOseeBranch branch) {
+ public static Integer getAssociatedArtifactId(BranchId branch) {
return getBranch(branch).getAssociatedArtifactId();
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ChangeArtifactType.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ChangeArtifactType.java
index f09033a0f0..38041c011d 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ChangeArtifactType.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ChangeArtifactType.java
@@ -145,8 +145,8 @@ public class ChangeArtifactType {
deleteInvalidAttributes(artifact, newArtifactType);
deleteInvalidRelations(artifact, newArtifactType);
addTransaction(artifact, txMap);
- artifactChanges.add(new EventChangeTypeBasicGuidArtifact(artifact.getBranchId(),
- artifact.getArtTypeGuid(), newArtifactType.getGuid(), artifact.getGuid()));
+ artifactChanges.add(new EventChangeTypeBasicGuidArtifact(artifact.getBranch(), artifact.getArtTypeGuid(),
+ newArtifactType.getGuid(), artifact.getGuid()));
}
}
} finally {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/DeleteBranchOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/DeleteBranchOperation.java
index 0e17d40e7f..5639ee0868 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/DeleteBranchOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/DeleteBranchOperation.java
@@ -50,7 +50,7 @@ public class DeleteBranchOperation extends AbstractOperation {
try {
branch.setBranchState(BranchState.DELETE_IN_PROGRESS);
branch.setArchived(true);
- OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.Deleting, branch.getUuid()));
+ OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.Deleting, branch));
BranchManager.persist(branch);
branch.setBranchState(BranchState.DELETED);
@@ -63,7 +63,7 @@ public class DeleteBranchOperation extends AbstractOperation {
try {
branch.setBranchState(originalState);
branch.setArchived(originalArchivedState.isArchived());
- OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.StateUpdated, branch.getUuid()));
+ OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.StateUpdated, branch));
BranchManager.persist(branch);
} catch (Exception ex2) {
log(ex2);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java
index 9924bf115e..d86f7702cb 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java
@@ -90,8 +90,8 @@ public final class FrameworkEventUtil {
public static RemoteBranchEvent1 getRemoteBranchEvent(BranchEvent branchEvent) {
RemoteBranchEvent1 event = new RemoteBranchEvent1();
event.setEventTypeGuid(branchEvent.getEventType().getGuid());
- event.setBranchGuid(getBranchGuidStringForRemoteEvent(branchEvent.getBranchUuid()));
- event.setDestinationBranchGuid(getBranchGuidStringForRemoteEvent(branchEvent.getDestinationBranchUuid()));
+ event.setBranch(branchEvent.getSourceBranch());
+ event.setDestinationBranch(branchEvent.getDestinationBranch());
event.setNetworkSender(getRemoteNetworkSender(branchEvent.getNetworkSender()));
return event;
}
@@ -99,8 +99,8 @@ public final class FrameworkEventUtil {
public static BranchEvent getBranchEvent(RemoteBranchEvent1 branchEvent) {
BranchEventType branchEventType = BranchEventType.getByGuid(branchEvent.getEventTypeGuid());
if (branchEventType != null) {
- BranchEvent event = new BranchEvent(branchEventType, getBranchUuidFromRemoteEvent(branchEvent.getBranchGuid()),
- getBranchUuidFromRemoteEvent(branchEvent.getDestinationBranchGuid()));
+ BranchEvent event =
+ new BranchEvent(branchEventType, branchEvent.getBranch(), branchEvent.getDestinationBranch());
event.setNetworkSender(getNetworkSender(branchEvent.getNetworkSender()));
return event;
} else {
@@ -115,7 +115,7 @@ public final class FrameworkEventUtil {
event.setEventTypeGuid(transEvent.getEventType().getGuid());
for (TransactionChange change : transEvent.getTransactionChanges()) {
RemoteTransactionChange1 remChange = new RemoteTransactionChange1();
- remChange.setBranchGuid(getBranchGuidStringForRemoteEvent(change.getBranchUuid()));
+ remChange.setBranchGuid(change.getBranchUuid());
remChange.setTransactionId(change.getTransactionId());
List<RemoteBasicGuidArtifact1> remChangeArts = remChange.getArtifacts();
for (DefaultBasicGuidArtifact guidArt : change.getArtifacts()) {
@@ -146,7 +146,7 @@ public final class FrameworkEventUtil {
public static RemotePersistEvent1 getRemotePersistEvent(ArtifactEvent transEvent) {
RemotePersistEvent1 event = new RemotePersistEvent1();
event.setNetworkSender(getRemoteNetworkSender(transEvent.getNetworkSender()));
- event.setBranchGuid(getBranchGuidStringForRemoteEvent(transEvent.getBranchUuid()));
+ event.setBranchGuid(transEvent.getBranch());
event.setTransactionId(transEvent.getTransactionId());
for (EventBasicGuidArtifact guidArt : transEvent.getArtifacts()) {
if (guidArt.getModType() == EventModType.Modified) {
@@ -218,7 +218,7 @@ public final class FrameworkEventUtil {
public static RemoteBasicGuidRelation1 getRemoteBasicGuidRelation1(EventBasicGuidRelation guidRel) {
RemoteBasicGuidRelation1 remEvent = new RemoteBasicGuidRelation1();
remEvent.setGammaId(guidRel.getGammaId());
- remEvent.setBranchGuid(getBranchGuidStringForRemoteEvent(guidRel.getBranchId()));
+ remEvent.setBranchGuid(guidRel.getBranch());
remEvent.setRelTypeGuid(guidRel.getRelTypeGuid());
remEvent.setRelationId(guidRel.getRelationId());
remEvent.setArtAId(guidRel.getArtAId());
@@ -232,7 +232,7 @@ public final class FrameworkEventUtil {
public static RemoteBasicGuidArtifact1 getRemoteBasicGuidArtifact(DefaultBasicGuidArtifact guidArt) {
RemoteBasicGuidArtifact1 event = new RemoteBasicGuidArtifact1();
- event.setBranchGuid(getBranchGuidStringForRemoteEvent(guidArt.getBranchId()));
+ event.setBranch(guidArt.getBranch());
event.setArtTypeGuid(guidArt.getArtTypeGuid());
event.setArtGuid(guidArt.getGuid());
return event;
@@ -240,7 +240,7 @@ public final class FrameworkEventUtil {
public static RemoteBasicGuidRelationReorder1 getRemoteBasicGuidRelationReorder1(DefaultBasicUuidRelationReorder guidOrderRel) {
RemoteBasicGuidRelationReorder1 event = new RemoteBasicGuidRelationReorder1();
- event.setBranchGuid(getBranchGuidStringForRemoteEvent(guidOrderRel.getBranchId()));
+ event.setBranchGuid(guidOrderRel.getBranch());
event.setRelTypeGuid(guidOrderRel.getRelTypeGuid());
event.setModTypeGuid(guidOrderRel.getModType().getGuid());
event.setParentArt(getRemoteBasicGuidArtifact(guidOrderRel.getParentArt()));
@@ -251,24 +251,12 @@ public final class FrameworkEventUtil {
* Before 0.17.0, events pass string branch guid for events. After 0.17.0, events will pass long branch uuid for
* events.
*/
- private static String getBranchGuidStringForRemoteEvent(long branchUuid) {
- String result = "";
- if (branchUuid > 0) {
- result = String.valueOf(branchUuid);
+ public static Long getBranchUuidFromRemoteEvent(String remoteBranchId) {
+ Long id = 0L;
+ if (Strings.isNumeric(remoteBranchId)) {
+ id = Long.valueOf(remoteBranchId);
}
- return result;
- }
-
- /**
- * Before 0.17.0, events pass string branch guid for events. After 0.17.0, events will pass long branch uuid for
- * events.
- */
- public static long getBranchUuidFromRemoteEvent(String remoteBranchGuid) {
- long result = 0;
- if (Strings.isValid(remoteBranchGuid)) {
- result = Long.valueOf(remoteBranchGuid);
- }
- return result;
+ return id;
}
public static EventBasicGuidRelation getEventBasicGuidRelation(RemoteBasicGuidRelation1 guidRel) {
@@ -288,13 +276,13 @@ public final class FrameworkEventUtil {
}
public static EventBasicGuidArtifact getEventBasicGuidArtifact(EventModType modType, RemoteBasicGuidArtifact1 remGuidArt) {
- return new EventBasicGuidArtifact(modType, getBranchUuidFromRemoteEvent(remGuidArt.getBranchGuid()),
- remGuidArt.getArtTypeGuid(), remGuidArt.getArtGuid());
+ return new EventBasicGuidArtifact(modType, remGuidArt.getBranch(), remGuidArt.getArtTypeGuid(),
+ remGuidArt.getArtGuid());
}
public static EventChangeTypeBasicGuidArtifact getEventChangeTypeBasicGuidArtifact(EventModType modType, RemoteBasicGuidArtifact1 remGuidArt) {
- return new EventChangeTypeBasicGuidArtifact(getBranchUuidFromRemoteEvent(remGuidArt.getBranchGuid()),
- remGuidArt.getArtTypeGuid(), remGuidArt.getToArtTypeGuid(), remGuidArt.getArtGuid());
+ return new EventChangeTypeBasicGuidArtifact(remGuidArt.getBranch(), remGuidArt.getArtTypeGuid(),
+ remGuidArt.getToArtTypeGuid(), remGuidArt.getArtGuid());
}
public static EventModifiedBasicGuidArtifact getEventModifiedBasicGuidArtifact(EventModType modType, RemoteBasicGuidArtifact1 remGuidArt) {
@@ -302,23 +290,22 @@ public final class FrameworkEventUtil {
for (RemoteAttributeChange1 remAttrChg : remGuidArt.getAttributes()) {
attributeChanges.add(getAttributeChange(remAttrChg));
}
- return new EventModifiedBasicGuidArtifact(getBranchUuidFromRemoteEvent(remGuidArt.getBranchGuid()),
- remGuidArt.getArtTypeGuid(), remGuidArt.getArtGuid(), attributeChanges);
+ return new EventModifiedBasicGuidArtifact(remGuidArt.getBranch(), remGuidArt.getArtTypeGuid(),
+ remGuidArt.getArtGuid(), attributeChanges);
}
public static DefaultBasicGuidArtifact getBasicGuidArtifact(RemoteBasicGuidArtifact1 remGuidArt) {
- return new DefaultBasicGuidArtifact(getBranchUuidFromRemoteEvent(remGuidArt.getBranchGuid()),
- remGuidArt.getArtTypeGuid(), remGuidArt.getArtGuid());
+ return new DefaultBasicGuidArtifact(remGuidArt.getBranch(), remGuidArt.getArtTypeGuid(), remGuidArt.getArtGuid());
}
public static DefaultBasicGuidArtifact getBasicGuidArtifact(Artifact artifact) {
- return new DefaultBasicGuidArtifact(artifact.getBranchId(), artifact.getArtTypeGuid(), artifact.getGuid());
+ return new DefaultBasicGuidArtifact(artifact.getBranch(), artifact.getArtTypeGuid(), artifact.getGuid());
}
public static RemoteBasicGuidArtifact1 getRemoteBasicGuidArtifact(String modTypeGuid, DefaultBasicGuidArtifact guidArt, Collection<AttributeChange> attributeChanges) {
RemoteBasicGuidArtifact1 remoteGuidArt = new RemoteBasicGuidArtifact1();
remoteGuidArt.setArtGuid(guidArt.getGuid());
- remoteGuidArt.setBranchGuid(getBranchGuidStringForRemoteEvent(guidArt.getBranchId()));
+ remoteGuidArt.setBranch(guidArt.getBranch());
remoteGuidArt.setArtTypeGuid(guidArt.getArtTypeGuid());
remoteGuidArt.setModTypeGuid(modTypeGuid);
if (attributeChanges != null) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/OseeEventManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/OseeEventManager.java
index d877fa19d6..18f3827c07 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/OseeEventManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/OseeEventManager.java
@@ -168,7 +168,7 @@ public final class OseeEventManager {
return;
}
ArtifactEvent artifactEvent =
- new ArtifactEvent(artifacts.iterator().next().getBranch().getGuid(), ArtifactEventType.RELOAD_ARTIFACTS);
+ new ArtifactEvent(artifacts.iterator().next().getBranch(), ArtifactEventType.RELOAD_ARTIFACTS);
artifactEvent.getArtifacts().addAll(EventBasicGuidArtifact.get(EventModType.Reloaded, artifacts));
getEventService().send(source, artifactEvent);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactEventFilter.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactEventFilter.java
index ec84c90091..0482bb9734 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactEventFilter.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactEventFilter.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.skynet.core.event.filter;
import java.util.Arrays;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.event.IBasicGuidRelation;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -22,22 +23,22 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
public class ArtifactEventFilter implements IEventFilter {
private final String filterArtifactGuid;
- private final Long filterBranchUuid;
+ private final BranchId filterBranch;
public ArtifactEventFilter(Artifact artifact) {
filterArtifactGuid = artifact.getGuid();
- filterBranchUuid = artifact.getBranchId();
+ filterBranch = artifact.getBranch();
}
@Override
- public boolean isMatch(Long branchUuid) {
- return branchUuid.equals(filterBranchUuid);
+ public boolean isMatch(BranchId branch) {
+ return branch.equals(filterBranch);
}
@Override
public boolean isMatchArtifacts(List<? extends IBasicGuidArtifact> guidArts) {
for (IBasicGuidArtifact art : guidArts) {
- if (art.getGuid().equals(filterArtifactGuid) && art.isOnBranch(filterBranchUuid)) {
+ if (art.getGuid().equals(filterArtifactGuid) && art.isOnBranch(filterBranch)) {
return true;
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilter.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilter.java
index 60535af723..c8d27a61b9 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilter.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/ArtifactTypeEventFilter.java
@@ -14,6 +14,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.logging.Level;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.event.IBasicGuidRelation;
@@ -83,7 +84,7 @@ public class ArtifactTypeEventFilter implements IEventFilter {
}
@Override
- public boolean isMatch(Long branchUuid) {
+ public boolean isMatch(BranchId branch) {
return true;
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilter.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilter.java
index a99e122d79..1f40194dff 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilter.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/BranchUuidEventFilter.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.skynet.core.event.filter;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.event.IBasicGuidRelation;
@@ -30,11 +31,9 @@ public class BranchUuidEventFilter implements IEventFilter {
}
@Override
- public boolean isMatch(Long branchUuid) {
+ public boolean isMatch(BranchId branch) {
if (branchToken != null) {
- if (branchUuid.equals(branchToken.getUuid())) {
- return true;
- }
+ return branchToken.equals(branch);
}
return false;
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/IEventFilter.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/IEventFilter.java
index 91a18f3c34..2ef5bc369f 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/IEventFilter.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/filter/IEventFilter.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.skynet.core.event.filter;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.event.IBasicGuidRelation;
@@ -22,7 +23,7 @@ public interface IEventFilter {
/**
* return true if events for this branch should be passed through to listeners
*/
- public boolean isMatch(Long branchUuid);
+ public boolean isMatch(BranchId branch);
/**
* return true if events for this this guid artifact should be passed through to listeners
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEvent.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEvent.java
index dfc1661384..c17cc85bb1 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEvent.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEvent.java
@@ -16,8 +16,10 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.event.DefaultBasicUuidRelationReorder;
import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact;
@@ -35,7 +37,7 @@ public class ArtifactEvent implements FrameworkEvent, HasNetworkSender {
UPDATE_ARTIFACTS;
}
- private final Long branchUuid;
+ private final BranchId branch;
private int transactionId;
private NetworkSender networkSender;
private final List<EventBasicGuidArtifact> artifacts = new ArrayList<>();
@@ -44,25 +46,25 @@ public class ArtifactEvent implements FrameworkEvent, HasNetworkSender {
new HashSet<DefaultBasicUuidRelationReorder>();
private final ArtifactEventType reloadEvent;
- public ArtifactEvent(IOseeBranch branch) {
- this(branch.getUuid());
+ public ArtifactEvent(BranchId branch) {
+ this(branch, ArtifactEventType.UPDATE_ARTIFACTS);
}
public ArtifactEvent(Long branchUuid) {
- this(branchUuid, ArtifactEventType.UPDATE_ARTIFACTS);
+ this(TokenFactory.createBranch(branchUuid));
}
- public ArtifactEvent(Long branchUuid, ArtifactEventType reloadEvent) {
+ public ArtifactEvent(BranchId branch, ArtifactEventType reloadEvent) {
this.reloadEvent = reloadEvent;
- this.branchUuid = branchUuid;
+ this.branch = branch;
}
public boolean isReloadEvent() {
return ArtifactEventType.RELOAD_ARTIFACTS == reloadEvent;
}
- public Long getBranchUuid() {
- return branchUuid;
+ public BranchId getBranch() {
+ return branch;
}
public Set<DefaultBasicUuidRelationReorder> getRelationOrderRecords() {
@@ -70,7 +72,7 @@ public class ArtifactEvent implements FrameworkEvent, HasNetworkSender {
}
public boolean isForBranch(IOseeBranch branch) {
- return getBranchUuid().equals(branch.getUuid());
+ return getBranch().equals(branch.getUuid());
}
public int getTransactionId() {
@@ -258,8 +260,8 @@ public class ArtifactEvent implements FrameworkEvent, HasNetworkSender {
@Override
public String toString() {
try {
- return String.format("ArtifactEvent: BG[%s] TrId[%d] ARTS[%s] RELS[%s] Sender[%s]", branchUuid, transactionId,
- getArtifactsString(artifacts), getRelationsString(relations), networkSender);
+ return String.format("ArtifactEvent: BG[%s] TrId[%d] ARTS[%s] RELS[%s] Sender[%s]", branch.getId(),
+ transactionId, getArtifactsString(artifacts), getRelationsString(relations), networkSender);
} catch (Exception ex) {
return String.format("ArtifactEvent exception: " + ex.getLocalizedMessage());
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/BranchEvent.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/BranchEvent.java
index fee6300a04..1edd10c4f9 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/BranchEvent.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/BranchEvent.java
@@ -10,76 +10,38 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.event.model;
+import org.eclipse.osee.framework.core.data.BranchId;
+
public class BranchEvent implements FrameworkEvent, HasNetworkSender {
- private long branchUuid;
- private long destinationBranchUuid;
- private BranchEventType eventType;
+ private final BranchId sourceBranch;
+ private final BranchId destinationBranch;
+ private final BranchEventType eventType;
private NetworkSender networkSender;
- public BranchEvent(BranchEventType branchEventType, long branchUuid) {
- this.branchUuid = branchUuid;
- this.eventType = branchEventType;
+ public BranchEvent(BranchEventType branchEventType, BranchId sourceBranch) {
+ this(branchEventType, sourceBranch, null);
}
- public BranchEvent(BranchEventType branchEventType, long sourceBranchUuid, long destinationBranchUuid) {
- this.branchUuid = sourceBranchUuid;
- this.destinationBranchUuid = destinationBranchUuid;
+ public BranchEvent(BranchEventType branchEventType, BranchId sourceBranchUuid, BranchId destinationBranch) {
+ this.sourceBranch = sourceBranchUuid;
+ this.destinationBranch = destinationBranch;
this.eventType = branchEventType;
}
- /**
- * Gets the value of the branchUuid property.
- *
- * @return possible object is {@link String }
- */
- public long getBranchUuid() {
- return branchUuid;
+ public BranchId getSourceBranch() {
+ return sourceBranch;
}
- // TODO: add comment to describe purpose of destinationBranch
- /**
- * Gets the value of the destinationBranchUuid property.
- *
- * @return possible object is {@link String }
- */
- public long getDestinationBranchUuid() {
- return destinationBranchUuid;
+ public BranchId getDestinationBranch() {
+ return destinationBranch;
}
- /**
- * Sets the value of the BranchUuid property.
- *
- * @param value allowed object is {@link String }
- */
- public void setBranchUuid(long value) {
- this.branchUuid = value;
- }
-
- /**
- * Sets the value of the destinationBranchUuid property.
- *
- * @param value allowed object is {@link String }
- */
- public void setDestinationBranchUuid(long value) {
- this.destinationBranchUuid = value;
- }
-
- /**
- * Gets the value of the networkSender property.
- *
- * @return possible object is {@link NetworkSender }
- */
@Override
public NetworkSender getNetworkSender() {
return networkSender;
}
- /**
- * Sets the value of the networkSender property.
- *
- * @param value allowed object is {@link NetworkSender }
- */
@Override
public void setNetworkSender(NetworkSender value) {
this.networkSender = value;
@@ -88,9 +50,4 @@ public class BranchEvent implements FrameworkEvent, HasNetworkSender {
public BranchEventType getEventType() {
return eventType;
}
-
- public void setEventType(BranchEventType eventType) {
- this.eventType = eventType;
- }
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidArtifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidArtifact.java
index 4b83232859..29e88e310b 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidArtifact.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventBasicGuidArtifact.java
@@ -13,13 +13,13 @@ package org.eclipse.osee.framework.skynet.core.event.model;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
import org.eclipse.osee.framework.core.model.event.IBasicGuidArtifact;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.messaging.event.res.msgs.RemoteBasicGuidArtifact1;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.event.FrameworkEventUtil;
/**
* @author Donald G. Dunne
@@ -29,20 +29,20 @@ public class EventBasicGuidArtifact extends DefaultBasicGuidArtifact {
private final EventModType eventModType;
public EventBasicGuidArtifact(EventModType eventModType, DefaultBasicGuidArtifact guidArt) {
- this(eventModType, guidArt.getBranchId(), guidArt.getArtTypeGuid(), guidArt.getGuid());
+ this(eventModType, guidArt.getBranch(), guidArt.getArtTypeGuid(), guidArt.getGuid());
}
public EventBasicGuidArtifact(EventModType eventModType, Artifact artifact) {
- this(eventModType, artifact.getBranchId(), artifact.getArtifactType().getGuid(), artifact.getGuid());
+ this(eventModType, artifact.getBranch(), artifact.getArtifactType().getGuid(), artifact.getGuid());
}
public EventBasicGuidArtifact(EventModType eventModType, IBasicGuidArtifact basicGuidArtifact) {
- this(eventModType, basicGuidArtifact.getBranchId(), basicGuidArtifact.getArtTypeGuid(),
+ this(eventModType, basicGuidArtifact.getBranch(), basicGuidArtifact.getArtTypeGuid(),
basicGuidArtifact.getGuid());
}
- public EventBasicGuidArtifact(EventModType eventModType, Long branchUuid, Long artTypeGuid, String guid) {
- super(branchUuid, artTypeGuid, guid);
+ public EventBasicGuidArtifact(EventModType eventModType, BranchId branch, Long artTypeGuid, String guid) {
+ super(branch, artTypeGuid, guid);
this.eventModType = eventModType;
}
@@ -67,15 +67,14 @@ public class EventBasicGuidArtifact extends DefaultBasicGuidArtifact {
}
Set<EventBasicGuidArtifact> eventArts = new HashSet<>();
for (RemoteBasicGuidArtifact1 guidArt : basicGuidArtifacts) {
- eventArts.add(new EventBasicGuidArtifact(eventModType,
- FrameworkEventUtil.getBranchUuidFromRemoteEvent(guidArt.getBranchGuid()), guidArt.getArtTypeGuid(),
+ eventArts.add(new EventBasicGuidArtifact(eventModType, guidArt.getBranch(), guidArt.getArtTypeGuid(),
guidArt.getArtGuid()));
}
return eventArts;
}
public DefaultBasicGuidArtifact getBasicGuidArtifact() {
- return new DefaultBasicGuidArtifact(getBranchId(), getArtTypeGuid(), getGuid());
+ return new DefaultBasicGuidArtifact(getBranch(), getArtTypeGuid(), getGuid());
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventChangeTypeBasicGuidArtifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventChangeTypeBasicGuidArtifact.java
index f27760f2db..af79730865 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventChangeTypeBasicGuidArtifact.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventChangeTypeBasicGuidArtifact.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.event.model;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
@@ -20,8 +21,8 @@ public class EventChangeTypeBasicGuidArtifact extends EventBasicGuidArtifact {
private final Long fromArtTypeGuid;
- public EventChangeTypeBasicGuidArtifact(Long branchUuid, Long fromArtTypeGuid, Long artTypeGuid, String guid) {
- super(EventModType.ChangeType, branchUuid, artTypeGuid, guid);
+ public EventChangeTypeBasicGuidArtifact(BranchId branch, Long fromArtTypeGuid, Long artTypeGuid, String guid) {
+ super(EventModType.ChangeType, branch, artTypeGuid, guid);
this.fromArtTypeGuid = fromArtTypeGuid;
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventModifiedBasicGuidArtifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventModifiedBasicGuidArtifact.java
index ca6dac2e62..2064b3e997 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventModifiedBasicGuidArtifact.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/EventModifiedBasicGuidArtifact.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.skynet.core.event.model;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.BranchId;
/**
* @author Donald G. Dunne
@@ -19,8 +20,8 @@ public class EventModifiedBasicGuidArtifact extends EventBasicGuidArtifact {
private final Collection<AttributeChange> attributeChanges;
- public EventModifiedBasicGuidArtifact(Long branchUuid, Long artTypeGuid, String guid, Collection<AttributeChange> attributeChanges) {
- super(EventModType.Modified, branchUuid, artTypeGuid, guid);
+ public EventModifiedBasicGuidArtifact(BranchId branch, Long artTypeGuid, String guid, Collection<AttributeChange> attributeChanges) {
+ super(EventModType.Modified, branch, artTypeGuid, guid);
this.attributeChanges = attributeChanges;
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
index de6301ac92..362f1eb5ba 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CommitBranchHttpRequestOperation.java
@@ -86,8 +86,7 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation {
BranchState currentState = sourceBranch.getBranchState();
sourceBranch.setBranchState(BranchState.COMMIT_IN_PROGRESS);
- BranchEvent branchEvent =
- new BranchEvent(BranchEventType.Committing, sourceBranch.getUuid(), destinationBranch.getUuid());
+ BranchEvent branchEvent = new BranchEvent(BranchEventType.Committing, sourceBranch, destinationBranch);
OseeEventManager.kickBranchEvent(getClass(), branchEvent);
OseeClient client = ServiceUtil.getOseeClient();
@@ -105,8 +104,7 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation {
}
} catch (Exception ex) {
sourceBranch.setBranchState(currentState);
- OseeEventManager.kickBranchEvent(getClass(),
- new BranchEvent(BranchEventType.CommitFailed, sourceBranch.getUuid()));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.CommitFailed, sourceBranch));
throw JaxRsExceptions.asOseeException(ex);
}
}
@@ -143,7 +141,7 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation {
TransactionManager.cacheCommittedArtifactTransaction(associatedArtifact, newTransaction);
}
- BranchManager.reloadBranch(sourceBranch.getUuid());
+ BranchManager.reloadBranch(sourceBranch);
if (!skipChecksAndEvents) {
Collection<Change> changes = new ArrayList<>();
@@ -153,7 +151,7 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation {
}
OseeEventManager.kickBranchEvent(getClass(),
- new BranchEvent(BranchEventType.Committed, sourceBranch.getUuid(), destinationBranch.getUuid()));
+ new BranchEvent(BranchEventType.Committed, sourceBranch, destinationBranch));
}
private void handleArtifactEvents(TransactionRecord newTransaction, Collection<Change> changes) throws OseeCoreException {
@@ -196,7 +194,7 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation {
EventModifiedBasicGuidArtifact artEvent = artEventMap.get(artifactId);
if (artEvent == null) {
- artEvent = new EventModifiedBasicGuidArtifact(newTransaction.getBranchId(),
+ artEvent = new EventModifiedBasicGuidArtifact(newTransaction.getBranch(),
change.getArtifactType().getGuid(), changedArtifact.getGuid(),
new ArrayList<org.eclipse.osee.framework.skynet.core.event.model.AttributeChange>());
artifactEvent.getArtifacts().add(artEvent);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java
index e2729e0542..d5a2961029 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/CreateBranchHttpRequestOperation.java
@@ -91,7 +91,7 @@ public final class CreateBranchHttpRequestOperation extends AbstractOperation {
if (Status.CREATED.getStatusCode() == response.getStatus()) {
long branchUuid = getBranchUuid(response);
newBranch = BranchManager.getBranch(branchUuid);
- OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Added, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Added, newBranch));
}
} catch (Exception ex) {
throw JaxRsExceptions.asOseeException(ex);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java
index 5399b5c4cb..42579c7223 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java
@@ -56,7 +56,7 @@ public final class PurgeBranchHttpRequestOperation extends AbstractOperation {
branch.setBranchState(BranchState.PURGE_IN_PROGRESS);
branch.setArchived(true);
- OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Purging, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Purging, branch));
OseeClient client = ServiceUtil.getOseeClient();
BranchEndpoint proxy = client.getBranchEndpoint();
@@ -67,17 +67,17 @@ public final class PurgeBranchHttpRequestOperation extends AbstractOperation {
branch.setBranchState(BranchState.PURGED);
branch.setArchived(true);
BranchManager.decache(branch);
- OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Purged, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Purged, branch));
} else {
branch.setBranchState(currentState);
branch.setArchived(archivedState.isArchived());
- OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.StateUpdated, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.StateUpdated, branch));
}
} catch (Exception ex) {
try {
branch.setBranchState(currentState);
branch.setArchived(archivedState.isArchived());
- OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.StateUpdated, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.StateUpdated, branch));
} catch (Exception ex2) {
log(ex2);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchArchivedStateHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchArchivedStateHttpRequestOperation.java
index bfa8c9a32e..d1fef04434 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchArchivedStateHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchArchivedStateHttpRequestOperation.java
@@ -49,16 +49,14 @@ public final class UpdateBranchArchivedStateHttpRequestOperation extends Abstrac
if (Status.OK.getStatusCode() == response.getStatus()) {
Branch branch = BranchManager.getBranch(branchUuid);
branch.setArchived(true);
- OseeEventManager.kickBranchEvent(getClass(),
- new BranchEvent(BranchEventType.ArchiveStateUpdated, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.ArchiveStateUpdated, branch));
}
} else {
Response response = proxy.unarchiveBranch(branchUuid);
if (Status.OK.getStatusCode() == response.getStatus()) {
Branch branch = BranchManager.getBranch(branchUuid);
branch.setArchived(false);
- OseeEventManager.kickBranchEvent(getClass(),
- new BranchEvent(BranchEventType.ArchiveStateUpdated, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.ArchiveStateUpdated, branch));
}
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchNameHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchNameHttpRequestOperation.java
index 76a54ed75a..de2cc8027c 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchNameHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchNameHttpRequestOperation.java
@@ -30,8 +30,8 @@ import org.eclipse.osee.orcs.rest.model.BranchEndpoint;
*/
public class UpdateBranchNameHttpRequestOperation extends AbstractOperation {
- private long branchUuid;
- private String newBranchName;
+ private final long branchUuid;
+ private final String newBranchName;
public UpdateBranchNameHttpRequestOperation(long branchUuid, String newBranchName) {
super("Update branch name " + branchUuid, Activator.PLUGIN_ID);
@@ -48,7 +48,7 @@ public class UpdateBranchNameHttpRequestOperation extends AbstractOperation {
if (Status.OK.getStatusCode() == response.getStatus()) {
Branch branch = BranchManager.getBranch(branchUuid);
branch.setName(newBranchName);
- OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Renamed, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Renamed, branch));
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchStateHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchStateHttpRequestOperation.java
index 83133b5c8b..5d838683ea 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchStateHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchStateHttpRequestOperation.java
@@ -50,7 +50,7 @@ public class UpdateBranchStateHttpRequestOperation extends AbstractOperation {
if (Status.OK.getStatusCode() == response.getStatus()) {
Branch branch = BranchManager.getBranch(branchUuid);
branch.setBranchState(branchState);
- OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.StateUpdated, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.StateUpdated, branch));
}
} catch (Exception ex) {
throw JaxRsExceptions.asOseeException(ex);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchTypeHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchTypeHttpRequestOperation.java
index 227b46bbbf..4ec7974d77 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchTypeHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/UpdateBranchTypeHttpRequestOperation.java
@@ -50,7 +50,7 @@ public final class UpdateBranchTypeHttpRequestOperation extends AbstractOperatio
if (Status.OK.getStatusCode() == response.getStatus()) {
Branch branch = BranchManager.getBranch(branchUuid);
branch.setBranchType(type);
- OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.TypeUpdated, branchUuid));
+ OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.TypeUpdated, branch));
}
} catch (Exception ex) {
throw JaxRsExceptions.asOseeException(ex);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java
index c044aece5c..2d53104aaa 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java
@@ -188,7 +188,7 @@ public class DatabaseBranchAccessor implements IOseeDataAccessor<Branch> {
for (Branch branch : branches) {
if (branch.getBranchState().isDeleted()) {
try {
- OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.Deleted, branch.getUuid()));
+ OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.Deleted, branch));
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
@@ -196,7 +196,7 @@ public class DatabaseBranchAccessor implements IOseeDataAccessor<Branch> {
try {
if (branch.isFieldDirty(AbstractOseeType.NAME_FIELD_KEY)) {
- OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.Renamed, branch.getUuid()));
+ OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.Renamed, branch));
}
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/ArtifactEventHandler.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/ArtifactEventHandler.java
index 7f8c794f1b..4687c4577e 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/ArtifactEventHandler.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/ArtifactEventHandler.java
@@ -35,7 +35,7 @@ public class ArtifactEventHandler implements EventHandlerLocal<IArtifactEventLis
if (filters != null) {
for (IEventFilter eventFilter : filters) {
// If this branch doesn't match, don't pass events through
- if (!eventFilter.isMatch(event.getBranchUuid())) {
+ if (!eventFilter.isMatch(event.getBranch())) {
return;
}
// Process artifacts and relations only if there were any in this ArtifactEvent
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchEventHandler.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchEventHandler.java
index 5fd043e90b..2a185c25f4 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchEventHandler.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchEventHandler.java
@@ -34,15 +34,14 @@ public class BranchEventHandler implements EventHandlerLocal<IBranchEventListene
List<? extends IEventFilter> filters = ((IEventFilteredListener) listener).getEventFilters();
if (filters != null) {
for (IEventFilter eventFilter : filters) {
- long branchUuid = event.getBranchUuid();
- if (!eventFilter.isMatch(branchUuid) && !eventFilter.isMatch(event.getDestinationBranchUuid())) {
+ if (!eventFilter.isMatch(event.getSourceBranch()) && !eventFilter.isMatch(event.getDestinationBranch())) {
return;
}
}
}
if (event.getEventType() == BranchEventType.Added) {
try {
- BranchManager.checkAndReload(event.getBranchUuid());
+ BranchManager.checkAndReload(event.getSourceBranch());
} catch (OseeCoreException ex) {
EventUtil.eventLog("IEM: updateBranches", ex);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchRemoteEventHandler.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchRemoteEventHandler.java
index 6cc3231d87..0f27d507b7 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchRemoteEventHandler.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/BranchRemoteEventHandler.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.framework.skynet.core.internal.event.handlers;
import static org.eclipse.osee.framework.skynet.core.event.model.BranchEventType.Committed;
import static org.eclipse.osee.framework.skynet.core.event.model.BranchEventType.Deleted;
import static org.eclipse.osee.framework.skynet.core.event.model.BranchEventType.Purged;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -42,11 +43,11 @@ public class BranchRemoteEventHandler implements EventHandlerRemote<RemoteBranch
private void updateBranches(Sender sender, BranchEvent branchEvent) {
BranchEventType eventType = branchEvent.getEventType();
- Long branchUuid = branchEvent.getBranchUuid();
+ BranchId branchId = branchEvent.getSourceBranch();
try {
if (BranchManager.isLoaded()) {
- if (BranchManager.branchExists(branchUuid)) {
- Branch branch = BranchManager.getBranch(branchUuid);
+ if (BranchManager.branchExists(branchId)) {
+ Branch branch = BranchManager.getBranch(branchId);
if (eventType == Committed) {
Artifact artifact = BranchManager.getAssociatedArtifact(branch);
TransactionManager.clearCommitArtifactCacheForAssociatedArtifact(artifact);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java
index 5520fac28a..3cd850f922 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java
@@ -127,8 +127,8 @@ public class RelationOrderData {
relationOrderModType = RelationOrderModType.Absolute;
}
IOseeBranch branch = getIArtifact().getBranch();
- DefaultBasicGuidArtifact guidArtifact = new DefaultBasicGuidArtifact(branch.getUuid(),
- getIArtifact().getArtifactType().getGuid(), getIArtifact().getGuid());
+ DefaultBasicGuidArtifact guidArtifact =
+ new DefaultBasicGuidArtifact(branch, getIArtifact().getArtifactType().getGuid(), getIArtifact().getGuid());
DefaultBasicUuidRelationReorder reorder =
new DefaultBasicUuidRelationReorder(relationOrderModType, branch.getUuid(), type.getGuid(), guidArtifact);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/StoreSkynetTransactionOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/StoreSkynetTransactionOperation.java
index b9d721a51c..629199b54c 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/StoreSkynetTransactionOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/StoreSkynetTransactionOperation.java
@@ -192,7 +192,7 @@ public final class StoreSkynetTransactionOperation extends AbstractDbTxOperation
// Collect attribute events
for (Artifact artifact : artifactReferences) {
if (artifact.hasDirtyAttributes()) {
- EventModifiedBasicGuidArtifact guidArt = new EventModifiedBasicGuidArtifact(artifact.getBranchId(),
+ EventModifiedBasicGuidArtifact guidArt = new EventModifiedBasicGuidArtifact(artifact.getBranch(),
artifact.getArtifactType().getGuid(), artifact.getGuid(), artifact.getDirtyFrameworkAttributeChanges());
artifactEvent.getArtifacts().add(guidArt);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java
index 54af66f25c..0ae4039e8b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java
@@ -139,7 +139,7 @@ public class ArtifactEditorEventManager implements IArtifactEventListener, IBran
for (IArtifactEditorEventHandler handler : handlers) {
if (!handler.isDisposed()) {
if (branchEvent.getEventType() == BranchEventType.Committing || branchEvent.getEventType() == BranchEventType.Committed) {
- if (handler.getArtifactFromEditorInput().getBranch().getGuid() == branchEvent.getBranchUuid()) {
+ if (handler.getArtifactFromEditorInput().isOnBranch(branchEvent.getSourceBranch())) {
handler.closeEditor();
}
}
@@ -155,7 +155,8 @@ public class ArtifactEditorEventManager implements IArtifactEventListener, IBran
if (AccessTopicEventType.ACCESS_ARTIFACT_LOCK_MODIFIED.matches(event)) {
for (final IArtifactEditorEventHandler handler : handlers) {
if (!handler.isDisposed()) {
- AccessArtifactLockTopicEvent payload = EventUtil.getTopicJson(event, AccessArtifactLockTopicEvent.class);
+ AccessArtifactLockTopicEvent payload =
+ EventUtil.getTopicJson(event, AccessArtifactLockTopicEvent.class);
if (payload.matches(handler.getArtifactFromEditorInput())) {
Displays.ensureInDisplayThread(new Runnable() {
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportEditor.java
index 733146cc51..fb6be8c17d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportEditor.java
@@ -174,7 +174,7 @@ public class ChangeReportEditor extends FormEditor implements IChangeReportView
OseeLog.log(Activator.class, Level.SEVERE, "Error obtaining change report branches for branch event", ex);
}
for (IOseeBranch branch : branches) {
- if (branch != null && branch.getUuid().equals(branchEvent.getBranchUuid())) {
+ if (branch != null && branch.equals(branchEvent.getSourceBranch())) {
switch (branchEvent.getEventType()) {
case Deleting:
case Deleted:
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java
index 8b8211cc03..ffd735ffe5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java
@@ -51,7 +51,7 @@ public class ArchiveBranchHandler extends CommandHandler {
branch.setArchived(true);
BranchManager.updateBranchArchivedState(null, branch.getUuid(), BranchArchivedState.ARCHIVED);
}
- OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.Committed, branch.getUuid()));
+ OseeEventManager.kickBranchEvent(this, new BranchEvent(BranchEventType.Committed, branch));
}
return null;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java
index b07ccbe811..92f4e6f99d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java
@@ -36,7 +36,7 @@ public class ToggleFavoriteBranchHandler extends CommandHandler {
UserManager.getUser().toggleFavoriteBranch(selectedBranch);
OseeEventManager.kickBranchEvent(this,
- new BranchEvent(BranchEventType.FavoritesUpdated, selectedBranch.getUuid()));
+ new BranchEvent(BranchEventType.FavoritesUpdated, selectedBranch));
return null;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorer.java
index 60dcf27d5b..6771c652f8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorer.java
@@ -490,13 +490,13 @@ public class ArtifactExplorer extends GenericViewPart implements IArtifactExplor
if (branch == null) {
return;
}
- if (branch.getUuid().equals(branchEvent.getBranchUuid())) {
+ if (branch.equals(branchEvent.getSourceBranch())) {
if (branchEvent.getEventType() == BranchEventType.Committing || branchEvent.getEventType() == BranchEventType.Committed) {
SkynetViews.closeView(VIEW_ID, getViewSite().getSecondaryId());
} else {
refreshBranchWarning();
}
- } else if (branch.getUuid().equals(branchEvent.getDestinationBranchUuid())) {
+ } else if (branch.equals(branchEvent.getDestinationBranch())) {
if (branchEvent.getEventType() == BranchEventType.Committed) {
Displays.ensureInDisplayThread(new Runnable() {
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerEventManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerEventManager.java
index 8df48eedba..d43a814d16 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerEventManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerEventManager.java
@@ -15,6 +15,7 @@ import java.util.Collection;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -71,12 +72,11 @@ public class ArtifactExplorerEventManager implements IArtifactEventListener, Eve
/**
* @return true if branch is not null, matches the branch for the event and is not deleted or purged
*/
- private boolean isArtifactExplorerValidForEvents(ArtifactExplorer artifactExplorer, Long branchUuidFromEvent) {
+ private boolean isArtifactExplorerValidForEvents(ArtifactExplorer artifactExplorer, BranchId brancFromEvent) {
boolean toReturn = false;
if (artifactExplorer != null) {
Branch branch = artifactExplorer.getBranch();
- toReturn =
- branch != null && branchUuidFromEvent.equals(branch.getUuid()) && !branch.isDeleted() && !branch.isPurged();
+ toReturn = branch != null && brancFromEvent.equals(branch) && !branch.isDeleted() && !branch.isPurged();
}
return toReturn;
}
@@ -93,7 +93,7 @@ public class ArtifactExplorerEventManager implements IArtifactEventListener, Eve
for (IArtifactExplorerEventHandler handler : handlers) {
if (handler.isDisposed()) {
handlers.remove(handler);
- } else if (isArtifactExplorerValidForEvents(handler.getArtifactExplorer(), artifactEvent.getBranchUuid())) {
+ } else if (isArtifactExplorerValidForEvents(handler.getArtifactExplorer(), artifactEvent.getBranch())) {
handlersToProcess.add(handler);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java
index 9113e469f0..a5c3dabff6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java
@@ -79,7 +79,7 @@ public class UpdateArtifactOperation extends AbstractOperation {
private void postProcessChange(WordUpdateChange change) {
// Collect attribute events
Integer tx = change.getTx();
- ArtifactEvent artifactEvent = new ArtifactEvent(change.getBranchUuid());
+ ArtifactEvent artifactEvent = new ArtifactEvent(change.getBranch());
artifactEvent.setTransactionId(tx);
for (Artifact artifact : artifacts) {
@@ -88,7 +88,7 @@ public class UpdateArtifactOperation extends AbstractOperation {
artifact.reloadAttributesAndRelations();
Collection<AttributeChange> attrChanges = getAttributeChanges(artifact, artChange);
if (!attrChanges.isEmpty()) {
- EventModifiedBasicGuidArtifact guidArt = new EventModifiedBasicGuidArtifact(artifact.getBranchId(),
+ EventModifiedBasicGuidArtifact guidArt = new EventModifiedBasicGuidArtifact(artifact.getBranch(),
artifact.getArtifactType().getGuid(), artifact.getGuid(), attrChanges);
artifactEvent.getArtifacts().add(guidArt);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java
index b9e679ce8c..52be6275db 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java
@@ -19,11 +19,13 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.MergeBranch;
import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.help.ui.OseeHelpContext;
+import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -269,13 +271,12 @@ public class MergeView extends GenericViewPart implements IBranchEventListener,
showConflicts = show;
}
- private boolean isApplicableEvent(Long branchUuid, Branch mergeBranch) {
- return Conditions.in(branchUuid, mergeBranch.getUuid()) || isApplicableSourceOrDestEvent(branchUuid);
+ private boolean isApplicableEvent(BranchId branch, BranchId mergeBranch) {
+ return mergeBranch.equals(branch) || isApplicableSourceOrDestEvent(branch);
}
- private boolean isApplicableSourceOrDestEvent(Long branchUuid) {
- return Conditions.notNull(sourceBranch, destBranch) && Conditions.in(branchUuid, sourceBranch.getUuid(),
- destBranch.getUuid());
+ private boolean isApplicableSourceOrDestEvent(Id branch) {
+ return branch.matches(sourceBranch, destBranch);
}
protected MergeBranch getMergeBranchForView() {
@@ -295,17 +296,17 @@ public class MergeView extends GenericViewPart implements IBranchEventListener,
case Deleted:
break;
case Purged:
- if (mergeBranch.getUuid().equals(branchEvent.getBranchUuid())) {
+ if (mergeBranch.equals(branchEvent.getSourceBranch())) {
close();
}
case Committed:
- if (isApplicableSourceOrDestEvent(branchEvent.getBranchUuid())) {
+ if (isApplicableSourceOrDestEvent(branchEvent.getSourceBranch())) {
getSite().getPage().hideView(MergeView.this);
}
break;
default:
if (isApplicableSourceOrDestEvent(
- branchEvent.getBranchUuid()) && mergeXWidget != null && Widgets.isAccessible(
+ branchEvent.getSourceBranch()) && mergeXWidget != null && Widgets.isAccessible(
mergeXWidget.getXViewer().getTree())) {
mergeXWidget.refresh();
}
@@ -348,10 +349,10 @@ public class MergeView extends GenericViewPart implements IBranchEventListener,
Branch mergeBranch = null;
try {
mergeBranch = BranchManager.getMergeBranch(sourceBranch, destBranch);
- if (mergeBranch == null || !mergeBranch.getUuid().equals(artifactEvent.getBranchUuid())) {
+ if (mergeBranch == null || !mergeBranch.equals(artifactEvent.getBranch())) {
return;
}
- if (!isApplicableEvent(artifactEvent.getBranchUuid(), mergeBranch)) {
+ if (!isApplicableEvent(artifactEvent.getBranch(), mergeBranch)) {
return;
}
} catch (OseeCoreException ex1) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java
index 743c3a757b..b3de425857 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java
@@ -149,7 +149,7 @@ public class MergeXViewer extends XViewer {
} else if (isXViewerColumn(treeColumn, MergeXViewerFactory.Conflict_Resolved)) {
conflict.handleResolvedSelection();
OseeEventManager.kickBranchEvent(CreateBranchHttpRequestOperation.class,
- new BranchEvent(BranchEventType.MergeConflictResolved, conflict.getMergeBranch().getGuid()));
+ new BranchEvent(BranchEventType.MergeConflictResolved, conflict.getMergeBranch()));
} else if (isXViewerColumn(treeColumn, MergeXViewerFactory.Merged)) {
if (!conflict.getConflictType().equals(ConflictType.ARTIFACT)) {
AttributeConflict attributeConflict = (AttributeConflict) conflict;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java
index e0b8697321..f064e482fe 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
@@ -115,15 +116,15 @@ public class BranchQueryBuilderImpl<T> implements BranchQueryBuilder<T> {
}
@Override
- public T andIds(IOseeBranch... ids) throws OseeCoreException {
+ public T andIds(BranchId... ids) throws OseeCoreException {
return andIds(Arrays.asList(ids));
}
@Override
- public T andIds(Collection<? extends IOseeBranch> ids) throws OseeCoreException {
+ public T andIds(Collection<? extends BranchId> ids) throws OseeCoreException {
Set<Long> allIds = new HashSet<>();
- for (IOseeBranch token : ids) {
- allIds.add(token.getUuid());
+ for (BranchId token : ids) {
+ allIds.add(token.getId());
}
return andUuids(allIds);
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java
index 4a149f4dcb..500faf7fc8 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/BranchQueryBuilder.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.search;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
@@ -42,9 +43,9 @@ public interface BranchQueryBuilder<T> {
T andUuids(Collection<Long> uuids) throws OseeCoreException;
- T andIds(Collection<? extends IOseeBranch> ids) throws OseeCoreException;
+ T andIds(Collection<? extends BranchId> ids) throws OseeCoreException;
- T andIds(IOseeBranch... ids) throws OseeCoreException;
+ T andIds(BranchId... ids) throws OseeCoreException;
T andIsOfType(BranchType... branchType) throws OseeCoreException;

Back to the top