diff options
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core')
67 files changed, 351 insertions, 350 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/AccessPolicy.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/AccessPolicy.java index 17d2a6e5d46..5a31fa623bf 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/AccessPolicy.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/AccessPolicy.java @@ -14,7 +14,7 @@ import java.util.Collection; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IRelationTypeSide; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.model.IBasicArtifact; @@ -26,13 +26,13 @@ public interface AccessPolicy { boolean isReadOnly(Artifact artifact); - void removePermissions(IOseeBranch branch) throws OseeCoreException; + void removePermissions(BranchId branch) throws OseeCoreException; - PermissionStatus hasBranchPermission(IOseeBranch branch, PermissionEnum permission, Level level) throws OseeCoreException; + PermissionStatus hasBranchPermission(BranchId branch, PermissionEnum permission, Level level) throws OseeCoreException; PermissionStatus hasAttributeTypePermission(Collection<? extends IBasicArtifact<?>> artifacts, IAttributeType attributeType, PermissionEnum permission, Level level) throws OseeCoreException; - PermissionStatus hasArtifactTypePermission(IOseeBranch branch, Collection<? extends IArtifactType> artifactTypes, PermissionEnum permission, Level level) throws OseeCoreException; + PermissionStatus hasArtifactTypePermission(BranchId branch, Collection<? extends IArtifactType> artifactTypes, PermissionEnum permission, Level level) throws OseeCoreException; PermissionStatus hasArtifactPermission(Collection<? extends IBasicArtifact<?>> artifacts, PermissionEnum permission, Level level) throws OseeCoreException; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeGroup.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeGroup.java index 07115865bf9..124e9862745 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeGroup.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeGroup.java @@ -14,7 +14,7 @@ import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON; import java.util.HashMap; import java.util.Map; import org.eclipse.osee.framework.core.data.IArtifactToken; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTokens; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreRelationTypes; @@ -119,7 +119,7 @@ public class OseeGroup { return groupArtifact; } - private Artifact getOrCreateUserGroupsFolder(IOseeBranch branch) throws OseeCoreException { + private Artifact getOrCreateUserGroupsFolder(BranchId branch) throws OseeCoreException { String cacheKey = CoreArtifactTypes.Folder.getName() + "." + CoreArtifactTokens.UserGroups.getName(); Artifact usersGroupFolder = ArtifactCache.getByTextId(cacheKey, branch); if (usersGroupFolder == null) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java index 84e40471625..21ef6930564 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/OseeSystemArtifacts.java @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.skynet.core; import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON; import org.eclipse.osee.framework.core.data.IArtifactToken; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTokens; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; @@ -37,7 +37,7 @@ public final class OseeSystemArtifacts { COMMON); } - public static Artifact getDefaultHierarchyRootArtifact(IOseeBranch branch) throws OseeCoreException { + public static Artifact getDefaultHierarchyRootArtifact(BranchId branch) throws OseeCoreException { return ArtifactQuery.getArtifactFromToken(CoreArtifactTokens.DefaultHierarchyRoot, branch); } @@ -54,20 +54,20 @@ public final class OseeSystemArtifacts { return getOrCreateCachedArtifact(artifactType, artifactName, branch, null, true); } - public static Artifact getOrCreateArtifact(IArtifactToken artifactToken, IOseeBranch branch) throws OseeCoreException { + public static Artifact getOrCreateArtifact(IArtifactToken artifactToken, BranchId branch) throws OseeCoreException { return getOrCreateCachedArtifact(artifactToken.getArtifactType(), artifactToken.getName(), branch, artifactToken.getGuid(), artifactToken.getUuid(), true); } - public static Artifact getCachedArtifact(IArtifactType artifactType, String artifactName, IOseeBranch branch) throws OseeCoreException { + public static Artifact getCachedArtifact(IArtifactType artifactType, String artifactName, BranchId branch) throws OseeCoreException { return getOrCreateCachedArtifact(artifactType, artifactName, branch, null, false); } - private static Artifact getOrCreateCachedArtifact(IArtifactType artifactType, String artifactName, IOseeBranch branch, String guid, boolean create) throws OseeCoreException { + private static Artifact getOrCreateCachedArtifact(IArtifactType artifactType, String artifactName, BranchId branch, String guid, boolean create) throws OseeCoreException { return getOrCreateCachedArtifact(artifactType, artifactName, branch, guid, null, create); } - private static Artifact getOrCreateCachedArtifact(IArtifactType artifactType, String artifactName, IOseeBranch branch, String guid, Long uuid, boolean create) throws OseeCoreException { + private static Artifact getOrCreateCachedArtifact(IArtifactType artifactType, String artifactName, BranchId branch, String guid, Long uuid, boolean create) throws OseeCoreException { Artifact artifact = ArtifactCache.getByTextId(artifactType.getName() + "." + artifactName, branch); if (artifact == null) { artifact = ArtifactQuery.checkArtifactFromTypeAndName(artifactType, artifactName, branch); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java index 679611e995d..c4b9d61e5c9 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java @@ -16,7 +16,7 @@ import java.io.StringWriter; import java.util.Collection; import java.util.HashSet; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; @@ -35,7 +35,7 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; public class User extends Artifact { private PropertyStore userSettings; - public User(String guid, IOseeBranch branch, IArtifactType artifactType) throws OseeCoreException { + public User(String guid, BranchId branch, IArtifactType artifactType) throws OseeCoreException { super(guid, branch, artifactType); } @@ -88,10 +88,10 @@ public class User extends Artifact { setSoleAttributeValue(CoreAttributeTypes.Active, active); } - public void toggleFavoriteBranch(IOseeBranch favoriteBranch) throws OseeCoreException { + public void toggleFavoriteBranch(BranchId favoriteBranch) throws OseeCoreException { Conditions.checkNotNull(favoriteBranch, "Branch"); HashSet<Long> branchUuids = new HashSet<>(); - for (IOseeBranch branch : BranchManager.getBranches(BranchArchivedState.UNARCHIVED, BranchType.WORKING, + for (BranchId branch : BranchManager.getBranches(BranchArchivedState.UNARCHIVED, BranchType.WORKING, BranchType.BASELINE)) { branchUuids.add(branch.getUuid()); } @@ -124,7 +124,7 @@ public class User extends Artifact { saveSettings(); } - public boolean isFavoriteBranch(IOseeBranch branch) throws OseeCoreException { + public boolean isFavoriteBranch(BranchId branch) throws OseeCoreException { Collection<String> attributes = getAttributesToStringList(CoreAttributeTypes.FavoriteBranch); for (String value : attributes) { try { 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 9c473652acd..ad8d96f1459 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 @@ -26,6 +26,7 @@ import java.util.logging.Level; import java.util.regex.Pattern; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.osee.framework.core.data.ArtifactId; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IArtifactToken; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; @@ -100,7 +101,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, I new HashCollection<IAttributeType, Attribute<?>>(false, LinkedList.class, 12); private final Set<DefaultBasicUuidRelationReorder> relationOrderRecords = new HashSet<DefaultBasicUuidRelationReorder>(); - private final IOseeBranch branch; + private final BranchId branch; private int transactionId = TRANSACTION_SENTINEL; private int artId; private int gammaId; @@ -112,7 +113,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, I private boolean useBackingData; private IArtifactType artifactTypeToken; - public Artifact(String guid, IOseeBranch branch, IArtifactType artifactType) throws OseeCoreException { + public Artifact(String guid, BranchId branch, IArtifactType artifactType) throws OseeCoreException { super(GUID.checkOrCreate(guid), ""); this.artifactTypeToken = artifactType; objectEditState = EditState.NO_CHANGE; @@ -232,10 +233,14 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, I } @Override - public final IOseeBranch getBranch() { + public final BranchId getBranch() { return branch; } + public final IOseeBranch getBranchToken() { + return BranchManager.getBranch(branch); + } + public final Branch getFullBranch() throws OseeCoreException { return BranchManager.getBranch(branch); } @@ -1410,15 +1415,15 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, I /** * Creates a new artifact and duplicates all of its attribute data. */ - public final Artifact duplicate(IOseeBranch branch) throws OseeCoreException { + public final Artifact duplicate(BranchId branch) throws OseeCoreException { return duplicate(branch, new ArrayList<IAttributeType>()); } - public final Artifact duplicate(IOseeBranch branch, Collection<IAttributeType> excludeAttributeTypes) throws OseeCoreException { + public final Artifact duplicate(BranchId branch, Collection<IAttributeType> excludeAttributeTypes) throws OseeCoreException { return duplicate(branch, getArtifactType(), excludeAttributeTypes); } - public final Artifact duplicate(IOseeBranch branch, IArtifactType newType, Collection<IAttributeType> excludeAttributeTypes) throws OseeCoreException { + public final Artifact duplicate(BranchId branch, IArtifactType newType, Collection<IAttributeType> excludeAttributeTypes) throws OseeCoreException { Artifact newArtifact = ArtifactTypeManager.addArtifact(newType, branch); // we do this because attributes were added on creation to meet the // minimum attribute requirements @@ -1450,11 +1455,11 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, I * * @return the newly created artifact or this artifact if the destinationBranch is this artifact's branch */ - public final Artifact reflect(IOseeBranch destinationBranch) throws OseeCoreException { + public final Artifact reflect(BranchId destinationBranch) throws OseeCoreException { return new IntroduceArtifactOperation(destinationBranch).introduce(this); } - Artifact introduceShallowArtifact(IOseeBranch destinationBranch) throws OseeCoreException { + Artifact introduceShallowArtifact(BranchId destinationBranch) throws OseeCoreException { Artifact shallowArt = ArtifactTypeManager.getFactory(getArtifactType()).reflectExisitingArtifact(artId, getGuid(), getArtifactType(), gammaId, destinationBranch, modType); return shallowArt; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCache.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCache.java index abebab2dcec..136e5a1bc21 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCache.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCache.java @@ -16,7 +16,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +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.core.model.event.IBasicGuidRelation; @@ -59,7 +59,7 @@ public final class ArtifactCache { * * @param branch of which artifacts (all) will be de-cache'ed. */ - public static void deCache(IOseeBranch branch) { + public static void deCache(BranchId branch) { for (Artifact artifact : ACTIVE_CACHE.getAll()) { if (artifact.isOnBranch(branch)) { ACTIVE_CACHE.deCache(artifact); @@ -166,7 +166,7 @@ public final class ArtifactCache { return arts; } - public static Artifact getActive(Integer artId, IOseeBranch branch) { + public static Artifact getActive(Integer artId, BranchId branch) { return getActive(artId, branch.getUuid()); } @@ -178,7 +178,7 @@ public final class ArtifactCache { return ACTIVE_CACHE.getByGuid(artGuid, uuid); } - public static Artifact getActive(String artGuid, IOseeBranch branch) throws OseeCoreException { + public static Artifact getActive(String artGuid, BranchId branch) throws OseeCoreException { return getActive(artGuid, branch.getUuid()); } @@ -187,7 +187,7 @@ public final class ArtifactCache { * * @throws OseeStateException if more than one artifact stored. */ - public static Artifact getByTextId(String key, IOseeBranch branch) throws OseeCoreException { + public static Artifact getByTextId(String key, BranchId branch) throws OseeCoreException { Artifact artifact = ACTIVE_CACHE.getByText(key, BranchManager.getBranch(branch)); // decache if deleted if (artifact != null && artifact.isDeleted()) { @@ -196,13 +196,13 @@ public final class ArtifactCache { return artifact; } - public static Artifact deCacheByTextId(String key, IOseeBranch branch) throws OseeCoreException { + public static Artifact deCacheByTextId(String key, BranchId branch) throws OseeCoreException { Artifact artifact = ACTIVE_CACHE.getByText(key, BranchManager.getBranch(branch)); ACTIVE_CACHE.deCacheByText(key, branch, artifact); return artifact; } - public static Collection<Artifact> getListByTextId(String key, IOseeBranch branch) throws OseeCoreException { + public static Collection<Artifact> getListByTextId(String key, BranchId branch) throws OseeCoreException { List<Artifact> artifacts = new ArrayList<>(); Collection<Artifact> cached = ACTIVE_CACHE.getListByText(key, BranchManager.getBranch(branch)); // decache any deleted artifacts diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCacheQuery.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCacheQuery.java index 8006a78a745..479348650a0 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCacheQuery.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCacheQuery.java @@ -15,7 +15,7 @@ import java.util.Set; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.MultipleArtifactsExist; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; @@ -32,7 +32,7 @@ public class ArtifactCacheQuery { * Return non-deleted artifacts stored in ArtifactCache. If queryIfNotFound, query artifacts and cacheByText results * before returning. */ - public static Set<Artifact> getArtifactsFromArtifactByText(IArtifactType artifactType, IAttributeType attributeType, String text, IOseeBranch branch, boolean queryIfNotFound) throws OseeCoreException { + public static Set<Artifact> getArtifactsFromArtifactByText(IArtifactType artifactType, IAttributeType attributeType, String text, BranchId branch, boolean queryIfNotFound) throws OseeCoreException { Set<Artifact> artifacts = new HashSet<>(); // Retrieve cached artifacts first for (Artifact artifact : ArtifactCache.getListByTextId(text, branch)) { @@ -57,7 +57,7 @@ public class ArtifactCacheQuery { /** * Get artifact, query if not already found and cacheByText. */ - public static Artifact getSingletonArtifactByTextOrException(IArtifactType artifactType, IAttributeType attributeType, String text, IOseeBranch branch) throws OseeCoreException { + public static Artifact getSingletonArtifactByTextOrException(IArtifactType artifactType, IAttributeType attributeType, String text, BranchId branch) throws OseeCoreException { Set<Artifact> artifacts = getArtifactsFromArtifactByText(artifactType, attributeType, text, branch, true); // Exception on problems if (artifacts.isEmpty()) { @@ -72,7 +72,7 @@ public class ArtifactCacheQuery { /** * Return singleton artifact from ArtifactCache. If queryIfNotFound, perform query and cacheByText result. */ - public static Artifact getSingletonArtifactByText(IArtifactType artifactType, IAttributeType attributeType, String text, IOseeBranch branch, boolean queryIfNotFound) throws OseeCoreException { + public static Artifact getSingletonArtifactByText(IArtifactType artifactType, IAttributeType attributeType, String text, BranchId branch, boolean queryIfNotFound) throws OseeCoreException { if (queryIfNotFound) { return getOrCreateSingletonArtifactHelper(artifactType, attributeType, text, branch, false); } else { @@ -87,7 +87,7 @@ public class ArtifactCacheQuery { /** * Return first artifact with attribute (multiples may exist) or create one if non exist */ - public static Artifact getOrCreateSingletonArtifactByText(IArtifactType artifactType, IAttributeType attributeType, String text, IOseeBranch branch) throws OseeCoreException { + public static Artifact getOrCreateSingletonArtifactByText(IArtifactType artifactType, IAttributeType attributeType, String text, BranchId branch) throws OseeCoreException { return getOrCreateSingletonArtifactHelper(artifactType, attributeType, text, branch, true); } @@ -96,7 +96,7 @@ public class ArtifactCacheQuery { * * @param create will create artifact and add attribute value not found */ - private static Artifact getOrCreateSingletonArtifactHelper(IArtifactType artifactType, IAttributeType attributeType, String text, IOseeBranch branch, boolean create) throws OseeCoreException { + private static Artifact getOrCreateSingletonArtifactHelper(IArtifactType artifactType, IAttributeType attributeType, String text, BranchId branch, boolean create) throws OseeCoreException { Set<Artifact> artifacts = getArtifactsFromArtifactByText(artifactType, attributeType, text, branch, true); if (artifacts.isEmpty() && create) { Artifact artifact = ArtifactTypeManager.addArtifact(artifactType, branch); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactFactory.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactFactory.java index 80b5f6e5e52..ae0593fbd7e 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactFactory.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactFactory.java @@ -15,7 +15,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.OseeData; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.model.type.ArtifactType; @@ -38,18 +38,18 @@ public abstract class ArtifactFactory { } } - public Artifact makeNewArtifact(IOseeBranch branch, IArtifactType artifactTypeToken, String guid) throws OseeCoreException { + public Artifact makeNewArtifact(BranchId branch, IArtifactType artifactTypeToken, String guid) throws OseeCoreException { return makeNewArtifact(branch, artifactTypeToken, null, guid); } /** * Used to create a new artifact (one that has never been saved into the datastore) */ - public Artifact makeNewArtifact(IOseeBranch branch, IArtifactType artifactTypeToken, String artifactName, String guid) throws OseeCoreException { + public Artifact makeNewArtifact(BranchId branch, IArtifactType artifactTypeToken, String artifactName, String guid) throws OseeCoreException { return makeNewArtifact(branch, artifactTypeToken, artifactName, guid, null); } - public Artifact makeNewArtifact(IOseeBranch branch, IArtifactType artifactTypeToken, String artifactName, String guid, Long uuid) { + public Artifact makeNewArtifact(BranchId branch, IArtifactType artifactTypeToken, String artifactName, String guid, Long uuid) { ArtifactType artifactType = ArtifactTypeManager.getType(artifactTypeToken); Conditions.checkExpressionFailOnTrue(artifactType.isAbstract(), "Cannot create an instance of abstract type [%s]", @@ -80,7 +80,7 @@ public abstract class ArtifactFactory { return uuid == null ? (int) ConnectionHandler.getNextSequence(OseeData.ART_ID_SEQ, true) : uuid.intValue(); } - public synchronized Artifact reflectExisitingArtifact(int artId, String guid, IArtifactType artifactType, int gammaId, IOseeBranch branch, ModificationType modificationType) throws OseeCoreException { + public synchronized Artifact reflectExisitingArtifact(int artId, String guid, IArtifactType artifactType, int gammaId, BranchId branch, ModificationType modificationType) throws OseeCoreException { Artifact toReturn = internalExistingArtifact(artId, guid, artifactType, gammaId, branch, modificationType, false, Artifact.TRANSACTION_SENTINEL, true); ArtifactCache.cache(toReturn); @@ -90,7 +90,7 @@ public abstract class ArtifactFactory { /** * This method does not cache the artifact, ArtifactLoader will cache existing artifacts */ - private Artifact internalExistingArtifact(int artId, String guid, IArtifactType artifactType, int gammaId, IOseeBranch branch, ModificationType modType, boolean historical, int transactionId, boolean useBackingData) throws OseeCoreException { + private Artifact internalExistingArtifact(int artId, String guid, IArtifactType artifactType, int gammaId, BranchId branch, ModificationType modType, boolean historical, int transactionId, boolean useBackingData) throws OseeCoreException { Artifact artifact = getArtifactInstance(guid, branch, artifactType, true); artifact.setArtId(artId); @@ -102,7 +102,7 @@ public abstract class ArtifactFactory { /** * This method does not cache the artifact, ArtifactLoader will cache existing artifacts */ - public synchronized Artifact loadExisitingArtifact(int artId, String guid, IArtifactType artifactType, int gammaId, IOseeBranch branch, int transactionId, ModificationType modType, boolean historical) throws OseeCoreException { + public synchronized Artifact loadExisitingArtifact(int artId, String guid, IArtifactType artifactType, int gammaId, BranchId branch, int transactionId, ModificationType modType, boolean historical) throws OseeCoreException { return internalExistingArtifact(artId, guid, artifactType, gammaId, branch, modType, historical, transactionId, false); } @@ -116,7 +116,7 @@ public abstract class ArtifactFactory { * @param branch branch on which this instance of this artifact will be associated * @param hrid */ - protected abstract Artifact getArtifactInstance(String guid, IOseeBranch branch, IArtifactType artifactType, boolean inDataStore) throws OseeCoreException; + protected abstract Artifact getArtifactInstance(String guid, BranchId branch, IArtifactType artifactType, boolean inDataStore) throws OseeCoreException; @Override public String toString() { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactKey.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactKey.java index 5ad232cac63..f6d964e3f15 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactKey.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactKey.java @@ -10,13 +10,13 @@ *******************************************************************************/ package org.eclipse.osee.framework.skynet.core.artifact; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.skynet.core.types.IArtifact; public final class ArtifactKey { private int artId; - private IOseeBranch branch; + private BranchId branch; public ArtifactKey(IArtifact artifact) { this.artId = artifact.getArtId(); @@ -33,7 +33,7 @@ public final class ArtifactKey { return this; } - public ArtifactKey setKey(int artId, IOseeBranch branch) { + public ArtifactKey setKey(int artId, BranchId branch) { this.artId = artId; this.branch = branch; return this; @@ -69,7 +69,7 @@ public final class ArtifactKey { return true; } - public IOseeBranch getBranch() { + public BranchId getBranch() { return branch; } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java index 89861e23a84..0ced616a7cd 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java @@ -22,7 +22,7 @@ import java.util.Set; import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.enums.LoadLevel; import org.eclipse.osee.framework.core.enums.ModificationType; @@ -62,7 +62,7 @@ public final class ArtifactLoader { return new LinkedList<Artifact>(artifacts); } - public static List<Artifact> loadArtifacts(Collection<Integer> artIds, IOseeBranch branch, LoadLevel loadLevel, LoadType reload, DeletionFlag allowDeleted, TransactionRecord transactionId) throws OseeCoreException { + public static List<Artifact> loadArtifacts(Collection<Integer> artIds, BranchId branch, LoadLevel loadLevel, LoadType reload, DeletionFlag allowDeleted, TransactionRecord transactionId) throws OseeCoreException { List<Pair<Integer, Long>> toLoad = new LinkedList<>(); Long branchUuid = branch.getUuid(); for (Integer artId : new HashSet<Integer>(artIds)) { @@ -72,7 +72,7 @@ public final class ArtifactLoader { return artifacts; } - public static List<Artifact> loadArtifacts(Collection<Integer> artIds, IOseeBranch branch, LoadLevel loadLevel, LoadType reload, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> loadArtifacts(Collection<Integer> artIds, BranchId branch, LoadLevel loadLevel, LoadType reload, DeletionFlag allowDeleted) throws OseeCoreException { return loadArtifacts(artIds, branch, loadLevel, reload, allowDeleted, null); } @@ -305,7 +305,7 @@ public final class ArtifactLoader { */ private static Artifact retrieveShallowArtifact(JdbcStatement chStmt, LoadType reload, boolean historical) throws OseeCoreException { int artifactId = chStmt.getInt("art_id"); - IOseeBranch branch = BranchManager.getBranch(chStmt.getLong("branch_id")); + BranchId branch = BranchManager.getBranch(chStmt.getLong("branch_id")); int transactionId = Artifact.TRANSACTION_SENTINEL; if (historical) { int stripeTransactionNumber = chStmt.getInt("stripe_transaction_id"); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPersistenceManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPersistenceManager.java index d76821916f6..65f624eff3b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPersistenceManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactPersistenceManager.java @@ -14,7 +14,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import org.eclipse.core.runtime.IStatus; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; @@ -83,7 +83,7 @@ public class ArtifactPersistenceManager { artIds.add(link.getBArtifactId()); } } - IOseeBranch branch = artifacts.iterator().next().getBranch(); + BranchId branch = artifacts.iterator().next().getBranch(); ArtifactQuery.getArtifactListFromIds(artIds, branch); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java index 6a0775704e7..80bb924a06d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java @@ -24,7 +24,7 @@ import java.util.Set; import org.eclipse.osee.framework.core.data.IArtifactToken; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.exception.OseeTypeDoesNotExist; @@ -66,7 +66,7 @@ public class ArtifactTypeManager { return ServiceUtil.getOseeCacheService(); } - public static Collection<ArtifactType> getArtifactTypesFromAttributeType(IAttributeType attributeType, IOseeBranch branchToken) throws OseeCoreException { + public static Collection<ArtifactType> getArtifactTypesFromAttributeType(IAttributeType attributeType, BranchId branchToken) throws OseeCoreException { Branch branch = getCacheService().getBranchCache().get(branchToken); List<ArtifactType> artifactTypes = new ArrayList<>(); for (ArtifactType artifactType : getAllTypes()) { @@ -77,12 +77,12 @@ public class ArtifactTypeManager { return artifactTypes; } - public static Collection<ArtifactType> getValidArtifactTypes(IOseeBranch branch) throws OseeCoreException { + public static Collection<ArtifactType> getValidArtifactTypes(BranchId branch) throws OseeCoreException { // TODO Filter artifact types by branch return getAllTypes(); } - public static Collection<ArtifactType> getConcreteArtifactTypes(IOseeBranch branch) throws OseeCoreException { + public static Collection<ArtifactType> getConcreteArtifactTypes(BranchId branch) throws OseeCoreException { Collection<ArtifactType> types = getAllTypes(); Iterator<ArtifactType> iterator = types.iterator(); while (iterator.hasNext()) { @@ -147,29 +147,29 @@ public class ArtifactTypeManager { /** * Get a new instance of type artifactTypeName */ - public static Artifact addArtifact(IArtifactType artifactType, IOseeBranch branch) throws OseeCoreException { + public static Artifact addArtifact(IArtifactType artifactType, BranchId branch) throws OseeCoreException { return getFactory(artifactType).makeNewArtifact(branch, artifactType, null, null); } /** * Get a new instance of type artifactTypeName and set it's name. */ - public static Artifact addArtifact(IArtifactType artifactType, IOseeBranch branch, String name) throws OseeCoreException { + public static Artifact addArtifact(IArtifactType artifactType, BranchId branch, String name) throws OseeCoreException { Artifact artifact = addArtifact(artifactType, branch); artifact.setName(name); return artifact; } - public static Artifact addArtifact(IArtifactType artifactType, IOseeBranch branch, String name, String guid) throws OseeCoreException { + public static Artifact addArtifact(IArtifactType artifactType, BranchId branch, String name, String guid) throws OseeCoreException { return getFactory(artifactType).makeNewArtifact(branch, artifactType, name, guid); } - public static Artifact addArtifact(IArtifactType artifactType, IOseeBranch branch, String name, String guid, long uuid) { + public static Artifact addArtifact(IArtifactType artifactType, BranchId branch, String name, String guid, long uuid) { Conditions.checkExpressionFailOnTrue(uuid <= 0L, "Invalid Uuid %d. Must be > 0", uuid); return getFactory(artifactType).makeNewArtifact(branch, artifactType, name, guid, uuid); } - public static Artifact addArtifact(IArtifactToken artifactToken, IOseeBranch branch) throws OseeCoreException { + public static Artifact addArtifact(IArtifactToken artifactToken, BranchId branch) throws OseeCoreException { Conditions.checkExpressionFailOnTrue(artifactToken.getUuid() <= 0L, "Invalid Uuid %d. Must be > 0", artifactToken.getUuid()); return getFactory(artifactToken.getArtifactType()).makeNewArtifact(branch, artifactToken.getArtifactType(), @@ -201,7 +201,7 @@ public class ArtifactTypeManager { for (IArtifactType purgeArtifactType : purgeArtifactTypes) { // find all artifact of this type on all branches and make a unique list for type change (since it is not by branch) Set<Artifact> artifacts = new LinkedHashSet<>(); - for (IOseeBranch branch : BranchManager.getBranches(new BranchFilter())) { + for (BranchId branch : BranchManager.getBranches(new BranchFilter())) { artifacts.addAll(ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, branch, DeletionFlag.INCLUDE_DELETED)); } @@ -211,7 +211,7 @@ public class ArtifactTypeManager { artifactMap.put(artifact.getArtId(), artifact); } if (newArtifactType == null) { - HashSet<IOseeBranch> branches = new HashSet<>(); + HashSet<BranchId> branches = new HashSet<>(); for (Artifact artifact : artifacts) { branches.add(artifact.getBranch()); } 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 45c73f6fc7b..0fef9122f6e 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 @@ -194,7 +194,7 @@ public final class BranchManager { /** * returns the merge branch for this source destination pair from the cache or null if not found */ - public static MergeBranch getMergeBranch(IOseeBranch sourceBranch, IOseeBranch destinationBranch) throws OseeCoreException { + public static MergeBranch getMergeBranch(BranchId sourceBranch, BranchId destinationBranch) throws OseeCoreException { MergeBranch mergeBranch = getCache().findMergeBranch(sourceBranch, destinationBranch); return mergeBranch; } @@ -202,15 +202,14 @@ public final class BranchManager { /** * returns the first merge branch for this source destination pair from the cache or null if not found */ - public static MergeBranch getFirstMergeBranch(Branch sourceBranch) throws OseeCoreException { - MergeBranch mergeBranch = getCache().findFirstMergeBranch(sourceBranch); - return mergeBranch; + public static MergeBranch getFirstMergeBranch(BranchId sourceBranch) throws OseeCoreException { + return getCache().findFirstMergeBranch(sourceBranch); } /** * returns a list tof all the merge branches for this source branch from the cache or null if not found */ - public static List<MergeBranch> getMergeBranches(Branch sourceBranch) throws OseeCoreException { + public static List<MergeBranch> getMergeBranches(BranchId sourceBranch) throws OseeCoreException { List<MergeBranch> mergeBranches = getCache().findAllMergeBranches(sourceBranch); return mergeBranches; } @@ -229,7 +228,7 @@ public final class BranchManager { /** * returns whether a merge branch exists for a source and dest branch pair */ - public static boolean doesMergeBranchExist(IOseeBranch sourceBranch, IOseeBranch destBranch) throws OseeCoreException { + public static boolean doesMergeBranchExist(BranchId sourceBranch, BranchId destBranch) throws OseeCoreException { return getMergeBranch(sourceBranch, destBranch) != null; } @@ -271,7 +270,7 @@ public final class BranchManager { return Operations.executeAsJob(operation, true); } - public static void purgeBranch(final IOseeBranch branch) throws OseeCoreException { + public static void purgeBranch(final BranchId branch) throws OseeCoreException { Operations.executeWorkAndCheckStatus(new PurgeBranchHttpRequestOperation(branch, false)); } @@ -299,11 +298,11 @@ public final class BranchManager { * Delete a branch from the system. (This operation will set the branch state to deleted. This operation is * undo-able) */ - public static Job deleteBranch(final IOseeBranch branch) { + public static Job deleteBranch(final BranchId branch) { return Operations.executeAsJob(new DeleteBranchOperation(branch), true); } - public static IStatus deleteBranchAndPend(final IOseeBranch branch) { + public static IStatus deleteBranchAndPend(final BranchId branch) { return Operations.executeWork(new DeleteBranchOperation(branch)); } @@ -312,9 +311,9 @@ public final class BranchManager { * * @throws OseeCoreException */ - public static Job deleteBranch(final List<? extends IOseeBranch> branches) { + public static Job deleteBranch(final List<? extends BranchId> branches) { List<IOperation> ops = new ArrayList<>(); - for (IOseeBranch branch : branches) { + for (BranchId branch : branches) { ops.add(new DeleteBranchOperation(branch)); } OperationBuilder builder = Operations.createBuilder("Deleting multiple branches..."); @@ -401,7 +400,7 @@ public final class BranchManager { public static Branch createWorkingBranch(TransactionRecord parentTransactionId, String childBranchName, Long childBranchUuid, Artifact associatedArtifact) throws OseeCoreException { Conditions.notNull(childBranchUuid, "childBranchUuid"); - String creationComment = String.format("New Branch from %s (%s)", parentTransactionId.getBranch().getName(), + String creationComment = String.format("New Branch from %s (%s)", parentTransactionId.getBranchToken().getName(), parentTransactionId.getId()); final String truncatedName = Strings.truncate(childBranchName, 195, true); @@ -414,7 +413,7 @@ public final class BranchManager { */ public static Branch createWorkingBranchFromTx(TransactionRecord parentTransactionId, String childBranchName, Artifact associatedArtifact) throws OseeCoreException { String creationComment = String.format("New branch, copy of %s from transaction %s", - parentTransactionId.getBranch().getName(), parentTransactionId.getId()); + parentTransactionId.getBranchToken().getName(), parentTransactionId.getId()); final String truncatedName = Strings.truncate(childBranchName, 195, true); @@ -427,7 +426,7 @@ public final class BranchManager { public static Branch createPortBranchFromTx(TransactionRecord parentTransactionId, String childBranchName, Artifact associatedArtifact) throws OseeCoreException { String creationComment = String.format("New port branch, copy of %s from transaction %s", - parentTransactionId.getBranch().getName(), parentTransactionId.getId()); + parentTransactionId.getBranchToken().getName(), parentTransactionId.getId()); final String truncatedName = Strings.truncate(childBranchName, 195, true); @@ -438,11 +437,11 @@ public final class BranchManager { return operation.getNewBranch(); } - public static Branch createWorkingBranch(IOseeBranch parentBranch, String childBranchName) throws OseeCoreException { + public static Branch createWorkingBranch(BranchId parentBranch, String childBranchName) throws OseeCoreException { return createWorkingBranch(parentBranch, childBranchName, UserManager.getUser(SystemUser.OseeSystem)); } - public static Branch createWorkingBranch(IOseeBranch parentBranch, String childBranchName, Artifact associatedArtifact) throws OseeCoreException { + public static Branch createWorkingBranch(BranchId parentBranch, String childBranchName, Artifact associatedArtifact) throws OseeCoreException { Conditions.checkNotNull(parentBranch, "Parent Branch"); Conditions.checkNotNull(childBranchName, "Child Branch Name"); Conditions.checkNotNull(associatedArtifact, "Associated Artifact"); @@ -450,11 +449,11 @@ public final class BranchManager { return createWorkingBranch(parentTransactionId, childBranchName, Lib.generateUuid(), associatedArtifact); } - public static IOseeBranch createWorkingBranch(IOseeBranch parentBranch, IOseeBranch childBranch) throws OseeCoreException { + public static BranchId createWorkingBranch(BranchId parentBranch, IOseeBranch childBranch) throws OseeCoreException { return createWorkingBranch(parentBranch, childBranch, UserManager.getUser(SystemUser.OseeSystem)); } - public static IOseeBranch createWorkingBranch(IOseeBranch parentBranch, IOseeBranch childBranch, Artifact associatedArtifact) throws OseeCoreException { + public static BranchId createWorkingBranch(BranchId parentBranch, IOseeBranch childBranch, Artifact associatedArtifact) throws OseeCoreException { TransactionRecord parentTransactionId = TransactionManager.getHeadTransaction(parentBranch); return createWorkingBranch(parentTransactionId, childBranch.getName(), childBranch.getUuid(), associatedArtifact); } @@ -462,11 +461,11 @@ public final class BranchManager { /** * Creates a new Branch based on the most recent transaction on the parent branch. */ - public static IOseeBranch createBaselineBranch(IOseeBranch parentBranch, IOseeBranch childBranch) throws OseeCoreException { + public static BranchId createBaselineBranch(BranchId parentBranch, IOseeBranch childBranch) throws OseeCoreException { return createBaselineBranch(parentBranch, childBranch, UserManager.getUser(SystemUser.OseeSystem)); } - public static IOseeBranch createBaselineBranch(IOseeBranch parentBranch, IOseeBranch childBranch, Artifact associatedArtifact) throws OseeCoreException { + public static BranchId createBaselineBranch(BranchId parentBranch, IOseeBranch childBranch, Artifact associatedArtifact) throws OseeCoreException { TransactionRecord parentTransactionId = TransactionManager.getHeadTransaction(parentBranch); String creationComment = String.format("Branch Creation for %s", childBranch.getName()); return createBranch(BranchType.BASELINE, parentTransactionId, childBranch.getName(), childBranch.getUuid(), @@ -485,11 +484,11 @@ public final class BranchManager { * * @param initializeArtifacts adds common artifacts needed by most normal root branches */ - public static IOseeBranch createTopLevelBranch(IOseeBranch branch) throws OseeCoreException { + public static BranchId createTopLevelBranch(IOseeBranch branch) throws OseeCoreException { return createBaselineBranch(CoreBranches.SYSTEM_ROOT, branch, null); } - public static IOseeBranch createTopLevelBranch(final String branchName) throws OseeCoreException { + public static BranchId createTopLevelBranch(final String branchName) throws OseeCoreException { return createTopLevelBranch(TokenFactory.createBranch(branchName)); } @@ -559,7 +558,7 @@ public final class BranchManager { return branch.getBaseTransaction() != TransactionManager.getHeadTransaction(branch); } - public static boolean isChangeManaged(IOseeBranch branch) throws OseeCoreException { + public static boolean isChangeManaged(BranchId branch) throws OseeCoreException { Integer associatedArtifactId = getAssociatedArtifactId(branch); return associatedArtifactId > 0 && !associatedArtifactId.equals(SystemUser.OseeSystem); } @@ -574,7 +573,7 @@ public final class BranchManager { return getBranch(branch).getAssociatedArtifactId(); } - public static Artifact getAssociatedArtifact(IOseeBranch branch) throws OseeCoreException { + public static Artifact getAssociatedArtifact(BranchId branch) throws OseeCoreException { Integer associatedArtifactId = getAssociatedArtifactId(branch); if (associatedArtifactId == null || associatedArtifactId == -1) { return UserManager.getUser(SystemUser.OseeSystem); @@ -591,7 +590,7 @@ public final class BranchManager { associatedArtifact = ArtifactQuery.getArtifactFromId(commitArtId, COMMON); } } else { - IOseeBranch sourceBranch = txDelta.getStartTx().getBranch(); + BranchId sourceBranch = txDelta.getStartTx().getBranch(); associatedArtifact = BranchManager.getAssociatedArtifact(sourceBranch); } return associatedArtifact; @@ -601,31 +600,31 @@ public final class BranchManager { getCache().invalidate(); } - public static Branch getParentBranch(IOseeBranch branch) { + public static Branch getParentBranch(BranchId branch) { return getBranch(branch).getParentBranch(); } - public static boolean isParentSystemRoot(IOseeBranch branch) { + public static boolean isParentSystemRoot(BranchId branch) { return CoreBranches.SYSTEM_ROOT.equals(getParentBranch(branch)); } - public static TransactionRecord getBaseTransaction(IOseeBranch branch) { + public static TransactionRecord getBaseTransaction(BranchId branch) { return getBranch(branch).getBaseTransaction(); } - public static BranchState getState(IOseeBranch branch) { + public static BranchState getState(BranchId branch) { return getBranch(branch).getBranchState(); } - public static boolean hasChanges(IOseeBranch branch) { + public static boolean hasChanges(BranchId branch) { return hasChanges(getBranch(branch)); } - public static BranchType getBranchType(IOseeBranch branch) { + public static BranchType getBranchType(BranchId branch) { return getBranch(branch).getBranchType(); } - public static boolean isEditable(IOseeBranch branch) { + public static boolean isEditable(BranchId branch) { Branch fullBranch = getBranch(branch); BranchState state = fullBranch.getBranchState(); return (state.isCreated() || state.isModified() || state.isRebaselineInProgress()) && fullBranch.getArchiveState().isUnArchived(); 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 38041c011d7..93b76898b42 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 @@ -24,7 +24,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchState; @@ -60,7 +60,7 @@ import org.eclipse.osee.jdbc.JdbcStatement; public class ChangeArtifactType { private final HashSet<IAttributeType> attributeTypes = new HashSet<>(); private final HashSet<IRelationType> relationTypes = new HashSet<>(); - private final HashMap<IOseeBranch, SkynetTransaction> txMap = new HashMap<>(); + private final HashMap<BranchId, SkynetTransaction> txMap = new HashMap<>(); private final Set<EventBasicGuidArtifact> artifactChanges = new HashSet<>(); private final List<Artifact> modifiedArtifacts = new ArrayList<>(); private static final IStatus promptStatus = new Status(IStatus.WARNING, Activator.PLUGIN_ID, 257, "", null); @@ -138,7 +138,7 @@ public class ChangeArtifactType { while (chStmt.next()) { int gammaId = chStmt.getInt("gamma_id"); long branchUuid = chStmt.getLong("branch_id"); - IOseeBranch branch = BranchManager.getBranch(branchUuid); + BranchId branch = BranchManager.getBranch(branchUuid); int artId = gammaToArtId.get(gammaId); Artifact artifact = ArtifactQuery.checkArtifactFromId(artId, branch, DeletionFlag.EXCLUDE_DELETED); if (artifact != null) { @@ -157,8 +157,8 @@ public class ChangeArtifactType { } } - private void addTransaction(Artifact artifact, HashMap<IOseeBranch, SkynetTransaction> txMap) throws OseeCoreException { - IOseeBranch branch = artifact.getBranch(); + private void addTransaction(Artifact artifact, HashMap<BranchId, SkynetTransaction> txMap) throws OseeCoreException { + BranchId branch = artifact.getBranch(); SkynetTransaction transaction = txMap.get(branch); if (transaction == null) { transaction = TransactionManager.createTransaction(branch, "Change Artifact Type"); @@ -276,7 +276,7 @@ public class ChangeArtifactType { BranchFilter branchFilter = new BranchFilter(BranchArchivedState.UNARCHIVED); branchFilter.setNegatedBranchStates(BranchState.PURGED, BranchState.DELETED); - for (IOseeBranch branch : BranchManager.getBranches(branchFilter)) { + for (BranchId branch : BranchManager.getBranches(branchFilter)) { branchJoin.add(branch.getUuid()); } 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 5639ee0868f..39370efa785 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 @@ -12,7 +12,7 @@ package org.eclipse.osee.framework.skynet.core.artifact; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchState; import org.eclipse.osee.framework.core.model.Branch; @@ -30,9 +30,9 @@ import org.eclipse.osee.orcs.rest.model.BranchEndpoint; */ public class DeleteBranchOperation extends AbstractOperation { - private final IOseeBranch branch; + private final BranchId branch; - public DeleteBranchOperation(IOseeBranch branch) { + public DeleteBranchOperation(BranchId branch) { super("Delete Branch: " + branch, Activator.PLUGIN_ID); this.branch = branch; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/IntroduceArtifactOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/IntroduceArtifactOperation.java index 50ecf7bd41f..f7e68f0b52d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/IntroduceArtifactOperation.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/IntroduceArtifactOperation.java @@ -15,7 +15,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.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.exception.MultipleArtifactsExist; @@ -35,11 +35,11 @@ import org.eclipse.osee.framework.skynet.core.relation.RelationManager; */ public class IntroduceArtifactOperation { private final Artifact fosterParent; - private final IOseeBranch destinationBranch; + private final BranchId destinationBranch; private Collection<Artifact> sourceArtifacts; private List<Artifact> destinationArtifacts; - public IntroduceArtifactOperation(IOseeBranch destinationBranch) throws OseeCoreException { + public IntroduceArtifactOperation(BranchId destinationBranch) throws OseeCoreException { this(OseeSystemArtifacts.getDefaultHierarchyRootArtifact(destinationBranch)); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/UniversalGroup.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/UniversalGroup.java index a127146233b..84361e274f5 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/UniversalGroup.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/UniversalGroup.java @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; import java.util.logging.Level; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTokens; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreRelationTypes; @@ -31,7 +31,7 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; */ public class UniversalGroup { - public static Collection<Artifact> getGroups(IOseeBranch branch) { + public static Collection<Artifact> getGroups(BranchId branch) { Collection<Artifact> artifacts = null; try { artifacts = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.UniversalGroup, branch); @@ -42,7 +42,7 @@ public class UniversalGroup { return artifacts; } - public static Collection<Artifact> getGroupsNotRoot(IOseeBranch branch) { + public static Collection<Artifact> getGroupsNotRoot(BranchId branch) { Collection<Artifact> groups = new HashSet<>(); for (Artifact group : UniversalGroup.getGroups(branch)) { if (!group.getName().equals("Root Artifact")) { @@ -52,7 +52,7 @@ public class UniversalGroup { return groups; } - public static Collection<Artifact> getGroups(String groupName, IOseeBranch branch) { + public static Collection<Artifact> getGroups(String groupName, BranchId branch) { try { return ArtifactQuery.getArtifactListFromTypeAndName(CoreArtifactTypes.UniversalGroup, groupName, branch); } catch (OseeCoreException ex) { @@ -61,7 +61,7 @@ public class UniversalGroup { return new ArrayList<Artifact>(); } - public static Artifact addGroup(String name, IOseeBranch branch, SkynetTransaction transaction) throws OseeCoreException { + public static Artifact addGroup(String name, BranchId branch, SkynetTransaction transaction) throws OseeCoreException { if (!getGroups(name, branch).isEmpty()) { throw new OseeArgumentException("Group Already Exists"); } @@ -76,7 +76,7 @@ public class UniversalGroup { return groupArt; } - public static Artifact getTopUniversalGroupArtifact(IOseeBranch branch) throws OseeCoreException { + public static Artifact getTopUniversalGroupArtifact(BranchId branch) throws OseeCoreException { return ArtifactQuery.getArtifactFromToken(CoreArtifactTokens.UniversalGroupRoot, branch); } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/cache/ActiveArtifactCache.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/cache/ActiveArtifactCache.java index 719af9e4115..b6324cca225 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/cache/ActiveArtifactCache.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/cache/ActiveArtifactCache.java @@ -19,7 +19,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.jdk.core.type.OseeStateException; @@ -102,7 +102,7 @@ public class ActiveArtifactCache extends AbstractArtifactCache { return items; } - public void deCacheByText(String text, IOseeBranch branch, Artifact artifact) { + public void deCacheByText(String text, BranchId branch, Artifact artifact) { super.deCache(artifact); Set<Object> objects = keyedArtifactCache.get(text, branch.getUuid()); objects.remove(artifact); @@ -113,7 +113,7 @@ public class ActiveArtifactCache extends AbstractArtifactCache { * * @throws OseeStateException if more than one artifact stored. */ - public Artifact getByText(String text, IOseeBranch branch) throws OseeCoreException { + public Artifact getByText(String text, BranchId branch) throws OseeCoreException { Set<Object> objects = keyedArtifactCache.get(text, branch.getUuid()); if (objects != null) { if (objects.size() > 1) { @@ -126,7 +126,7 @@ public class ActiveArtifactCache extends AbstractArtifactCache { return null; } - public Collection<Artifact> getListByText(String text, IOseeBranch branch) { + public Collection<Artifact> getListByText(String text, BranchId branch) { Set<Object> objects = keyedArtifactCache.get(text, branch.getUuid()); if (objects == null) { return Collections.emptyList(); @@ -164,7 +164,7 @@ public class ActiveArtifactCache extends AbstractArtifactCache { public void deCache(Long uuid, Long branchUuid) { ArtifactKey artifactKey = uuidToArtifactKey.get(uuid); if (artifactKey != null) { - IOseeBranch branch = artifactKey.getBranch(); + BranchId branch = artifactKey.getBranch(); keyedArtifactCache.remove(uuid, branch); } String guid = uuidBranchUuidToGuid.get(uuid, branchUuid); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/DefaultArtifactFactory.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/DefaultArtifactFactory.java index ed764deca89..eb5c81a6547 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/DefaultArtifactFactory.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/DefaultArtifactFactory.java @@ -11,7 +11,7 @@ package org.eclipse.osee.framework.skynet.core.artifact.factory; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -30,7 +30,7 @@ public final class DefaultArtifactFactory extends ArtifactFactory { } @Override - public Artifact getArtifactInstance(String guid, IOseeBranch branch, IArtifactType artifactType, boolean inDataStore) throws OseeCoreException { + public Artifact getArtifactInstance(String guid, BranchId branch, IArtifactType artifactType, boolean inDataStore) throws OseeCoreException { return new Artifact(guid, branch, artifactType); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/UserArtifactFactory.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/UserArtifactFactory.java index 821df7cd842..66a9bf25787 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/UserArtifactFactory.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/UserArtifactFactory.java @@ -11,7 +11,7 @@ package org.eclipse.osee.framework.skynet.core.artifact.factory; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.skynet.core.User; @@ -28,7 +28,7 @@ public class UserArtifactFactory extends ArtifactFactory { } @Override - public Artifact getArtifactInstance(String guid, IOseeBranch branch, IArtifactType artifactType, boolean inDataStore) throws OseeCoreException { + public Artifact getArtifactInstance(String guid, BranchId branch, IArtifactType artifactType, boolean inDataStore) throws OseeCoreException { return new User(guid, branch, artifactType); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java index 00019209f48..68c3d327506 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java @@ -29,10 +29,10 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IArtifactToken; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.data.TokenFactory; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; @@ -75,7 +75,7 @@ public class ArtifactQuery { private static Map<String, Long> guidToUuid; private static Map<Long, String> uuidToGuid; - public static Artifact getArtifactFromToken(IArtifactToken artifactToken, IOseeBranch branch) throws OseeCoreException { + public static Artifact getArtifactFromToken(IArtifactToken artifactToken, BranchId branch) throws OseeCoreException { return getArtifactFromId(artifactToken.getGuid(), branch); } @@ -94,11 +94,11 @@ public class ArtifactQuery { * @return exactly one artifact by one its id - otherwise throw an exception * @throws ArtifactDoesNotExist if no artifacts are found */ - public static Artifact getArtifactFromId(int artId, IOseeBranch branch) throws OseeCoreException { + public static Artifact getArtifactFromId(int artId, BranchId branch) throws OseeCoreException { return getArtifactFromId(artId, branch, EXCLUDE_DELETED); } - public static Artifact getArtifactFromId(long artId, IOseeBranch branch) throws OseeCoreException { + public static Artifact getArtifactFromId(long artId, BranchId branch) throws OseeCoreException { return getArtifactFromId(new Long(artId).intValue(), branch, EXCLUDE_DELETED); } @@ -110,15 +110,15 @@ public class ArtifactQuery { * @return exactly one artifact by one its id - otherwise throw an exception * @throws ArtifactDoesNotExist if no artifacts are found */ - public static Artifact getArtifactFromId(int artId, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static Artifact getArtifactFromId(int artId, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return getOrCheckArtifactFromId(artId, branch, allowDeleted, QueryType.GET); } - - public static Artifact getArtifactFromId(Long artId, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + + public static Artifact getArtifactFromId(Long artId, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return getOrCheckArtifactFromId(artId.intValue(), branch, allowDeleted, QueryType.GET); } - private static Artifact getOrCheckArtifactFromId(int artId, IOseeBranch branch, DeletionFlag allowDeleted, QueryType queryType) throws OseeCoreException { + private static Artifact getOrCheckArtifactFromId(int artId, BranchId branch, DeletionFlag allowDeleted, QueryType queryType) throws OseeCoreException { Artifact artifact = ArtifactCache.getActive(artId, branch); if (artifact != null) { if (artifact.isDeleted() && allowDeleted == EXCLUDE_DELETED) { @@ -141,7 +141,7 @@ public class ArtifactQuery { * @param allowDeleted whether to return the artifact even if it has been deleted * @return one artifact by one its id if it exists, otherwise null */ - public static Artifact checkArtifactFromId(int artifactId, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static Artifact checkArtifactFromId(int artifactId, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return getOrCheckArtifactFromId(artifactId, branch, allowDeleted, QueryType.CHECK); } @@ -152,7 +152,7 @@ public class ArtifactQuery { * @param allowDeleted whether to return the artifact even if it has been deleted * @return one artifact by one its id if it exists, otherwise null */ - public static Artifact checkArtifactFromId(String guid, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static Artifact checkArtifactFromId(String guid, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return getOrCheckArtifactFromId(guid, branch, allowDeleted, QueryType.CHECK); } @@ -162,7 +162,7 @@ public class ArtifactQuery { * @param uuid of the desired artifact * @return one artifact by its guid if it exists, otherwise null */ - public static Artifact checkArtifactFromId(long uuid, IOseeBranch branch) throws OseeCoreException { + public static Artifact checkArtifactFromId(long uuid, BranchId branch) throws OseeCoreException { return getOrCheckArtifactFromId(new Long(uuid).intValue(), branch, EXCLUDE_DELETED, QueryType.CHECK); } @@ -174,7 +174,7 @@ public class ArtifactQuery { * @throws ArtifactDoesNotExist if no artifacts are found * @throws MultipleArtifactsExist if more than one artifact is found */ - public static Artifact getArtifactFromId(String guid, IOseeBranch branch) throws OseeCoreException { + public static Artifact getArtifactFromId(String guid, BranchId branch) throws OseeCoreException { return getOrCheckArtifactFromId(guid, branch, EXCLUDE_DELETED, QueryType.GET); } @@ -187,11 +187,11 @@ public class ArtifactQuery { * @throws ArtifactDoesNotExist if no artifacts are found * @throws MultipleArtifactsExist if more than one artifact is found */ - public static Artifact getArtifactFromId(String guid, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static Artifact getArtifactFromId(String guid, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return getOrCheckArtifactFromId(guid, branch, allowDeleted, QueryType.GET); } - private static Artifact getOrCheckArtifactFromId(String guid, IOseeBranch branch, DeletionFlag allowDeleted, QueryType queryType) throws OseeCoreException { + private static Artifact getOrCheckArtifactFromId(String guid, BranchId branch, DeletionFlag allowDeleted, QueryType queryType) throws OseeCoreException { Artifact artifact = ArtifactCache.getActive(guid, branch); if (artifact != null) { if (artifact.isDeleted() && allowDeleted == EXCLUDE_DELETED) { @@ -213,7 +213,7 @@ public class ArtifactQuery { * @throws ArtifactDoesNotExist if no artifacts are found * @throws MultipleArtifactsExist if more than one artifact is found */ - public static Artifact getArtifactFromTypeAndName(IArtifactType artifactType, String artifactName, IOseeBranch branch, QueryOption... options) throws OseeCoreException { + public static Artifact getArtifactFromTypeAndName(IArtifactType artifactType, String artifactName, BranchId branch, QueryOption... options) throws OseeCoreException { return queryFromTypeAndAttribute(artifactType, CoreAttributeTypes.Name, artifactName, branch, options).getOrCheckArtifact(QueryType.GET); } @@ -224,7 +224,7 @@ public class ArtifactQuery { * @return exactly one artifact based on its type and name, otherwise null * @throws MultipleArtifactsExist if more than one artifact is found */ - public static Artifact getArtifactFromTypeAndNameNoException(IArtifactType artifactType, String artifactName, IOseeBranch branch, QueryOption... options) throws OseeCoreException { + public static Artifact getArtifactFromTypeAndNameNoException(IArtifactType artifactType, String artifactName, BranchId branch, QueryOption... options) throws OseeCoreException { try { return queryFromTypeAndAttribute(artifactType, CoreAttributeTypes.Name, artifactName, branch, options).getOrCheckArtifact(QueryType.GET); @@ -234,12 +234,12 @@ public class ArtifactQuery { return null; } - public static List<Integer> selectArtifactIdsFromTypeAndName(IArtifactType artifactType, String artifactName, IOseeBranch branch, QueryOption... options) throws OseeCoreException { + public static List<Integer> selectArtifactIdsFromTypeAndName(IArtifactType artifactType, String artifactName, BranchId branch, QueryOption... options) throws OseeCoreException { return queryFromTypeAndAttribute(artifactType, CoreAttributeTypes.Name, artifactName, branch, options).selectArtifacts(2); } - public static List<Integer> selectArtifactIdsFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, String attributeValue, IOseeBranch branch, QueryOption... options) throws OseeCoreException { + public static List<Integer> selectArtifactIdsFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, String attributeValue, BranchId branch, QueryOption... options) throws OseeCoreException { return queryFromTypeAndAttribute(artifactType, attributeType, attributeValue, branch, options).selectArtifacts( 10000); } @@ -249,7 +249,7 @@ public class ArtifactQuery { * * @return one artifact based on its type and name if it exists, otherwise null */ - public static Artifact checkArtifactFromTypeAndName(IArtifactType artifactTypeToken, String artifactName, IOseeBranch branch, QueryOption... options) throws OseeCoreException { + public static Artifact checkArtifactFromTypeAndName(IArtifactType artifactTypeToken, String artifactName, BranchId branch, QueryOption... options) throws OseeCoreException { return queryFromTypeAndAttribute(artifactTypeToken, CoreAttributeTypes.Name, artifactName, branch, options).getOrCheckArtifact(QueryType.CHECK); } @@ -259,7 +259,7 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromIds(Collection<Integer> artifactIds, IOseeBranch branch) throws OseeCoreException { + public static List<Artifact> getArtifactListFromIds(Collection<Integer> artifactIds, BranchId branch) throws OseeCoreException { return ArtifactLoader.loadArtifacts(artifactIds, branch, LoadLevel.ALL, INCLUDE_CACHE, INCLUDE_DELETED); } @@ -268,7 +268,7 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromIds(Collection<Integer> artifactIds, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> getArtifactListFromIds(Collection<Integer> artifactIds, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return ArtifactLoader.loadArtifacts(artifactIds, branch, LoadLevel.ALL, INCLUDE_CACHE, allowDeleted); } @@ -277,11 +277,11 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromIds(List<String> guids, IOseeBranch branch) throws OseeCoreException { + public static List<Artifact> getArtifactListFromIds(List<String> guids, BranchId branch) throws OseeCoreException { return new ArtifactQueryBuilder(guids, branch, ALL).getArtifacts(30, null); } - public static List<Artifact> getArtifactListFromIds(List<String> guids, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> getArtifactListFromIds(List<String> guids, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(guids, branch, allowDeleted, ALL).getArtifacts(30, null); } @@ -311,12 +311,12 @@ public class ArtifactQuery { QueryType.CHECK); } - public static List<Artifact> getArtifactListFromName(String artifactName, IOseeBranch branch, DeletionFlag allowDeleted, QueryOption... options) throws OseeCoreException { + public static List<Artifact> getArtifactListFromName(String artifactName, BranchId branch, DeletionFlag allowDeleted, QueryOption... options) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, allowDeleted, new AttributeCriteria(CoreAttributeTypes.Name, artifactName, options)).getArtifacts(30, null); } - public static List<Artifact> getArtifactListFromTypeAndName(IArtifactType artifactType, String artifactName, IOseeBranch branch, QueryOption... options) throws OseeCoreException { + public static List<Artifact> getArtifactListFromTypeAndName(IArtifactType artifactType, String artifactName, BranchId branch, QueryOption... options) throws OseeCoreException { return getArtifactListFromTypeAndAttribute(artifactType, CoreAttributeTypes.Name, artifactName, branch, options); } @@ -328,7 +328,7 @@ public class ArtifactQuery { * @throws ArtifactDoesNotExist if no artifacts are found * @throws MultipleArtifactsExist if more than one artifact is found */ - public static Artifact getArtifactFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, String attributeValue, IOseeBranch branch) throws OseeCoreException { + public static Artifact getArtifactFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, String attributeValue, BranchId branch) throws OseeCoreException { return queryFromTypeAndAttribute(artifactType, attributeType, attributeValue, branch).getOrCheckArtifact( QueryType.GET); } @@ -341,7 +341,7 @@ public class ArtifactQuery { * @throws ArtifactDoesNotExist if no artifacts are found * @throws MultipleArtifactsExist if more than one artifact is found */ - public static Artifact getArtifactFromAttribute(IAttributeType attributeType, String attributeValue, IOseeBranch branch) throws OseeCoreException { + public static Artifact getArtifactFromAttribute(IAttributeType attributeType, String attributeValue, BranchId branch) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, EXCLUDE_DELETED, new AttributeCriteria(attributeType, attributeValue)).getOrCheckArtifact(QueryType.GET); } @@ -355,60 +355,60 @@ public class ArtifactQuery { * @return * @throws OseeCoreException */ - public static List<Artifact> getArtifactListFromType(IArtifactType artifactTypeToken, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> getArtifactListFromType(IArtifactType artifactTypeToken, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(artifactTypeToken, branch, ALL, allowDeleted).getArtifacts(1000, null); } - public static List<Artifact> getArtifactListFromType(List<IArtifactType> artifactTypeTokens, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> getArtifactListFromType(List<IArtifactType> artifactTypeTokens, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(artifactTypeTokens, branch, ALL, allowDeleted).getArtifacts(1000, null); } - public static List<Artifact> getArtifactListFromType(IArtifactType artifactTypeToken, IOseeBranch branch) throws OseeCoreException { + public static List<Artifact> getArtifactListFromType(IArtifactType artifactTypeToken, BranchId branch) throws OseeCoreException { return getArtifactListFromType(artifactTypeToken, branch, EXCLUDE_DELETED); } - public static List<Artifact> getArtifactListFromBranch(IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> getArtifactListFromBranch(BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, allowDeleted).getArtifacts(10000, null); } - public static List<Integer> selectArtifactListFromType(IArtifactType artifactTypeToken, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Integer> selectArtifactListFromType(IArtifactType artifactTypeToken, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(artifactTypeToken, branch, ALL, allowDeleted).selectArtifacts(10000); } - public static List<Integer> selectArtifactListFromBranch(IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Integer> selectArtifactListFromBranch(BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, allowDeleted).selectArtifacts(10000); } - public static List<Artifact> getArtifactListFromBranch(IOseeBranch branch, LoadLevel loadLevel, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> getArtifactListFromBranch(BranchId branch, LoadLevel loadLevel, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(branch, loadLevel, allowDeleted).getArtifacts(10000, null); } - public static List<Artifact> reloadArtifactListFromBranch(IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> reloadArtifactListFromBranch(BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, allowDeleted).reloadArtifacts(10000); } /** * do not use this method if searching for a super type and its descendants, instead use getArtifactListFromTypeAnd */ - public static List<Artifact> getArtifactListFromTypes(Collection<? extends IArtifactType> artifactTypes, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> getArtifactListFromTypes(Collection<? extends IArtifactType> artifactTypes, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(artifactTypes, branch, ALL, allowDeleted).getArtifacts(1000, null); } - public static List<Artifact> getArtifactListFromTypeWithInheritence(IArtifactType artifactType, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static List<Artifact> getArtifactListFromTypeWithInheritence(IArtifactType artifactType, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { ArtifactType artifactTypeFull = ArtifactTypeManager.getType(artifactType); Collection<ArtifactType> artifactTypes = artifactTypeFull.getAllDescendantTypes(); artifactTypes.add(artifactTypeFull); return getArtifactListFromTypes(artifactTypes, branch, allowDeleted); } - public static int getArtifactCountFromTypeWithInheritence(IArtifactType artifactType, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static int getArtifactCountFromTypeWithInheritence(IArtifactType artifactType, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { ArtifactType artifactTypeFull = ArtifactTypeManager.getType(artifactType); Collection<ArtifactType> artifactTypes = artifactTypeFull.getAllDescendantTypes(); artifactTypes.add(artifactTypeFull); return getArtifactCountFromTypes(artifactTypes, branch, allowDeleted); } - public static int getArtifactCountFromTypes(Collection<? extends IArtifactType> artifactTypes, IOseeBranch branch, DeletionFlag allowDeleted) throws OseeCoreException { + public static int getArtifactCountFromTypes(Collection<? extends IArtifactType> artifactTypes, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(artifactTypes, branch, ALL, allowDeleted).countArtifacts(); } @@ -417,7 +417,7 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromTypeAnd(IArtifactType artifactType, IOseeBranch branch, int artifactCountEstimate, List<ArtifactSearchCriteria> criteria) throws OseeCoreException { + public static List<Artifact> getArtifactListFromTypeAnd(IArtifactType artifactType, BranchId branch, int artifactCountEstimate, List<ArtifactSearchCriteria> criteria) throws OseeCoreException { return new ArtifactQueryBuilder(artifactType, branch, ALL, criteria).getArtifacts(artifactCountEstimate, null); } @@ -426,7 +426,7 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromCriteria(IOseeBranch branch, int artifactCountEstimate, List<ArtifactSearchCriteria> criteria) throws OseeCoreException { + public static List<Artifact> getArtifactListFromCriteria(BranchId branch, int artifactCountEstimate, List<ArtifactSearchCriteria> criteria) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, criteria).getArtifacts(artifactCountEstimate, null); } @@ -435,7 +435,7 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromCriteria(IOseeBranch branch, int artifactCountEstimate, ArtifactSearchCriteria... criteria) throws OseeCoreException { + public static List<Artifact> getArtifactListFromCriteria(BranchId branch, int artifactCountEstimate, ArtifactSearchCriteria... criteria) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, EXCLUDE_DELETED, criteria).getArtifacts(artifactCountEstimate, null); } @@ -454,7 +454,7 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromRelation(IRelationType relationType, RelationSide relationSide, IOseeBranch branch) throws OseeCoreException { + public static List<Artifact> getArtifactListFromRelation(IRelationType relationType, RelationSide relationSide, BranchId branch) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, EXCLUDE_DELETED, new RelationCriteria(relationType, relationSide)).getArtifacts(1000, null); } @@ -464,12 +464,12 @@ public class ArtifactQuery { * * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, String attributeValue, IOseeBranch branch, QueryOption... options) throws OseeCoreException { + public static List<Artifact> getArtifactListFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, String attributeValue, BranchId branch, QueryOption... options) throws OseeCoreException { return new ArtifactQueryBuilder(artifactType, branch, ALL, new AttributeCriteria(attributeType, attributeValue, options)).getArtifacts(100, null); } - public static List<Artifact> getArtifactListFromAttribute(IAttributeType attributeType, String attributeValue, IOseeBranch branch, QueryOption... options) throws OseeCoreException { + public static List<Artifact> getArtifactListFromAttribute(IAttributeType attributeType, String attributeValue, BranchId branch, QueryOption... options) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, EXCLUDE_DELETED, new AttributeCriteria(attributeType, attributeValue, options)).getArtifacts(300, null); } @@ -477,22 +477,22 @@ public class ArtifactQuery { /** * Return all artifacts that have one or more attributes of given type regardless of the value */ - public static List<Artifact> getArtifactListFromAttributeType(IAttributeType attributeType, IOseeBranch branch) throws OseeCoreException { + public static List<Artifact> getArtifactListFromAttributeType(IAttributeType attributeType, BranchId branch) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, EXCLUDE_DELETED, new AttributeCriteria(attributeType)).getArtifacts( 300, null); } - private static ArtifactQueryBuilder queryFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, String attributeValue, IOseeBranch branch, QueryOption... options) { + private static ArtifactQueryBuilder queryFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, String attributeValue, BranchId branch, QueryOption... options) { return new ArtifactQueryBuilder(artifactType, branch, ALL, new AttributeCriteria(attributeType, attributeValue, options)); } - public static List<Artifact> getArtifactListFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, Collection<String> attributeValues, IOseeBranch branch, int artifactCountEstimate) throws OseeCoreException { + public static List<Artifact> getArtifactListFromTypeAndAttribute(IArtifactType artifactType, IAttributeType attributeType, Collection<String> attributeValues, BranchId branch, int artifactCountEstimate) throws OseeCoreException { return new ArtifactQueryBuilder(artifactType, branch, ALL, new AttributeCriteria(attributeType, attributeValues)).getArtifacts(artifactCountEstimate, null); } - public static List<Artifact> getArtifactListFromAttributeValues(IAttributeType attributeType, Collection<String> attributeValues, IOseeBranch branch, int artifactCountEstimate) throws OseeCoreException { + public static List<Artifact> getArtifactListFromAttributeValues(IAttributeType attributeType, Collection<String> attributeValues, BranchId branch, int artifactCountEstimate) throws OseeCoreException { return new ArtifactQueryBuilder(branch, ALL, EXCLUDE_DELETED, new AttributeCriteria(attributeType, attributeValues)).getArtifacts(artifactCountEstimate, null); } @@ -522,7 +522,7 @@ public class ArtifactQuery { * @param allowDeleted <b>true</b> includes deleted artifacts in results; <b>false</b> omits deleted artifacts * @return a collection of the artifacts found or an empty collection if none are found */ - public static List<Artifact> getArtifactListFromAttributeKeywords(IOseeBranch branch, String queryString, boolean isMatchWordOrder, DeletionFlag deletionFlag, boolean isCaseSensitive, IAttributeType... attributeTypes) throws OseeCoreException { + public static List<Artifact> getArtifactListFromAttributeKeywords(BranchId branch, String queryString, boolean isMatchWordOrder, DeletionFlag deletionFlag, boolean isCaseSensitive, IAttributeType... attributeTypes) throws OseeCoreException { QueryBuilderArtifact queryBuilder = createQueryBuilder(branch); queryBuilder.includeDeleted(deletionFlag.areDeletedAllowed()); QueryOption matchCase = QueryOption.getCaseType(isCaseSensitive); @@ -570,7 +570,7 @@ public class ArtifactQuery { return queryBuilder.getMatches(); } - public static Artifact reloadArtifactFromId(int artId, IOseeBranch branch) throws OseeCoreException { + public static Artifact reloadArtifactFromId(int artId, BranchId branch) throws OseeCoreException { ArtifactQueryBuilder query = new ArtifactQueryBuilder(artId, branch, INCLUDE_DELETED, ALL); Artifact artifact = query.reloadArtifact(); OseeEventManager.kickLocalArtifactReloadEvent(query, Collections.singleton(artifact)); @@ -579,7 +579,7 @@ public class ArtifactQuery { public static Collection<? extends Artifact> reloadArtifacts(Collection<? extends Artifact> artifacts) throws OseeCoreException { Collection<Artifact> reloadedArts = new ArrayList<Artifact>(artifacts.size()); - HashCollection<IOseeBranch, Artifact> branchMap = new HashCollection<IOseeBranch, Artifact>(); + HashCollection<BranchId, Artifact> branchMap = new HashCollection<BranchId, Artifact>(); if (artifacts.isEmpty()) { return artifacts; } @@ -588,7 +588,7 @@ public class ArtifactQuery { branchMap.put(artifact.getBranch(), artifact); } Set<Integer> artIds = new HashSet<>(); - for (Entry<IOseeBranch, Collection<Artifact>> entrySet : branchMap.entrySet()) { + for (Entry<BranchId, Collection<Artifact>> entrySet : branchMap.entrySet()) { for (Artifact artifact : entrySet.getValue()) { artIds.add(artifact.getArtId()); @@ -603,7 +603,7 @@ public class ArtifactQuery { return reloadedArts; } - public static Artifact getOrCreate(String guid, IArtifactType type, IOseeBranch branch) throws OseeCoreException { + public static Artifact getOrCreate(String guid, IArtifactType type, BranchId branch) throws OseeCoreException { Artifact artifact = null; try { artifact = ArtifactQuery.getArtifactFromId(guid, branch); @@ -620,7 +620,7 @@ public class ArtifactQuery { return artifact; } - public static QueryBuilderArtifact createQueryBuilder(IOseeBranch branch) throws OseeCoreException { + public static QueryBuilderArtifact createQueryBuilder(BranchId branch) throws OseeCoreException { OseeClient client = ServiceUtil.getOseeClient(); QueryBuilder builder = client.createQueryBuilder(branch); @@ -678,7 +678,7 @@ public class ArtifactQuery { SearchResult result = proxied.getSearchResult(RequestType.IDS); SearchParameters searchParameters = result.getSearchParameters(); - IOseeBranch branch = TokenFactory.createBranch(searchParameters.getBranchUuid()); + BranchId branch = TokenFactory.createBranch(searchParameters.getBranchUuid()); TransactionRecord tx = null; if (searchParameters.getFromTx() > 0) { @@ -705,7 +705,7 @@ public class ArtifactQuery { SearchResult result = proxied.getSearchResult(RequestType.MATCHES); SearchParameters searchParameters = result.getSearchParameters(); - IOseeBranch branch = TokenFactory.createBranch(searchParameters.getBranchUuid()); + BranchId branch = TokenFactory.createBranch(searchParameters.getBranchUuid()); TransactionRecord tx = null; if (searchParameters.getFromTx() > 0) { @@ -742,7 +742,7 @@ public class ArtifactQuery { } } - public static Long getUuidFromGuid(String guid, IOseeBranch branch) { + public static Long getUuidFromGuid(String guid, BranchId branch) { if (guidToUuid == null) { guidToUuid = new HashMap<>(200); } @@ -759,7 +759,7 @@ public class ArtifactQuery { return result; } - public static String getGuidFromUuid(long uuid, IOseeBranch branch) { + public static String getGuidFromUuid(long uuid, BranchId branch) { if (uuidToGuid == null) { uuidToGuid = new HashMap<>(200); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java index 4eb1b749f00..ca09e112d55 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java @@ -27,7 +27,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.enums.LoadLevel; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; @@ -55,7 +55,7 @@ public class ArtifactQueryBuilder { private List<String> guids; private String guid; private final ArtifactSearchCriteria[] criteria; - private final IOseeBranch branch; + private final BranchId branch; private int artifactId; private Collection<Integer> artifactIds; private final Collection<? extends IArtifactType> artifactTypes; @@ -67,7 +67,7 @@ public class ArtifactQueryBuilder { /** * @param allowDeleted set whether deleted artifacts should be included in the resulting artifact list */ - public ArtifactQueryBuilder(int artId, IOseeBranch branch, DeletionFlag allowDeleted, LoadLevel loadLevel) { + public ArtifactQueryBuilder(int artId, BranchId branch, DeletionFlag allowDeleted, LoadLevel loadLevel) { this(null, artId, null, null, null, branch, null, allowDeleted, loadLevel); } @@ -77,17 +77,17 @@ public class ArtifactQueryBuilder { * @param artifactIds list of artifact ids * @param allowDeleted set whether deleted artifacts should be included in the resulting artifact list */ - public ArtifactQueryBuilder(Collection<Integer> artifactIds, IOseeBranch branch, DeletionFlag allowDeleted, LoadLevel loadLevel) { + public ArtifactQueryBuilder(Collection<Integer> artifactIds, BranchId branch, DeletionFlag allowDeleted, LoadLevel loadLevel) { this(artifactIds, 0, null, null, null, branch, null, allowDeleted, loadLevel); emptyCriteria = artifactIds.isEmpty(); } - public ArtifactQueryBuilder(List<String> guids, IOseeBranch branch, LoadLevel loadLevel) { + public ArtifactQueryBuilder(List<String> guids, BranchId branch, LoadLevel loadLevel) { this(null, 0, guids, null, null, branch, null, EXCLUDE_DELETED, loadLevel); emptyCriteria = guids.isEmpty(); } - public ArtifactQueryBuilder(List<String> guids, IOseeBranch branch, DeletionFlag allowDeleted, LoadLevel loadLevel) { + public ArtifactQueryBuilder(List<String> guids, BranchId branch, DeletionFlag allowDeleted, LoadLevel loadLevel) { this(null, 0, guids, null, null, branch, null, allowDeleted, loadLevel); emptyCriteria = guids.isEmpty(); } @@ -106,45 +106,45 @@ public class ArtifactQueryBuilder { this(null, artifactId, null, null, null, transactionId.getBranch(), transactionId, allowDeleted, loadLevel); } - public ArtifactQueryBuilder(String guid, IOseeBranch branch, DeletionFlag allowDeleted, LoadLevel loadLevel) throws OseeCoreException { + public ArtifactQueryBuilder(String guid, BranchId branch, DeletionFlag allowDeleted, LoadLevel loadLevel) throws OseeCoreException { this(null, 0, null, ensureValid(guid), null, branch, null, allowDeleted, loadLevel); } - public ArtifactQueryBuilder(IArtifactType artifactType, IOseeBranch branch, LoadLevel loadLevel, DeletionFlag allowDeleted) { + public ArtifactQueryBuilder(IArtifactType artifactType, BranchId branch, LoadLevel loadLevel, DeletionFlag allowDeleted) { this(null, 0, null, null, Arrays.asList(artifactType), branch, null, allowDeleted, loadLevel); } - public ArtifactQueryBuilder(Collection<? extends IArtifactType> artifactTypes, IOseeBranch branch, LoadLevel loadLevel, DeletionFlag allowDeleted) { + public ArtifactQueryBuilder(Collection<? extends IArtifactType> artifactTypes, BranchId branch, LoadLevel loadLevel, DeletionFlag allowDeleted) { this(null, 0, null, null, artifactTypes, branch, null, allowDeleted, loadLevel); emptyCriteria = artifactTypes.isEmpty(); } - public ArtifactQueryBuilder(IOseeBranch branch, LoadLevel loadLevel, DeletionFlag allowDeleted) { + public ArtifactQueryBuilder(BranchId branch, LoadLevel loadLevel, DeletionFlag allowDeleted) { this(null, 0, null, null, null, branch, null, allowDeleted, loadLevel); } - public ArtifactQueryBuilder(IOseeBranch branch, LoadLevel loadLevel, DeletionFlag allowDeleted, ArtifactSearchCriteria... criteria) { + public ArtifactQueryBuilder(BranchId branch, LoadLevel loadLevel, DeletionFlag allowDeleted, ArtifactSearchCriteria... criteria) { this(null, 0, null, null, null, branch, null, allowDeleted, loadLevel, criteria); emptyCriteria = criteria.length == 0; } - public ArtifactQueryBuilder(IOseeBranch branch, LoadLevel loadLevel, List<ArtifactSearchCriteria> criteria) { + public ArtifactQueryBuilder(BranchId branch, LoadLevel loadLevel, List<ArtifactSearchCriteria> criteria) { this(null, 0, null, null, null, branch, null, EXCLUDE_DELETED, loadLevel, toArray(criteria)); emptyCriteria = criteria.isEmpty(); } - public ArtifactQueryBuilder(IArtifactType artifactType, IOseeBranch branch, LoadLevel loadLevel, ArtifactSearchCriteria... criteria) { + public ArtifactQueryBuilder(IArtifactType artifactType, BranchId branch, LoadLevel loadLevel, ArtifactSearchCriteria... criteria) { this(null, 0, null, null, Arrays.asList(artifactType), branch, null, EXCLUDE_DELETED, loadLevel, criteria); emptyCriteria = criteria.length == 0; } - public ArtifactQueryBuilder(IArtifactType artifactType, IOseeBranch branch, LoadLevel loadLevel, List<ArtifactSearchCriteria> criteria) { + public ArtifactQueryBuilder(IArtifactType artifactType, BranchId branch, LoadLevel loadLevel, List<ArtifactSearchCriteria> criteria) { this(null, 0, null, null, Arrays.asList(artifactType), branch, null, EXCLUDE_DELETED, loadLevel, toArray(criteria)); emptyCriteria = criteria.isEmpty(); } - private ArtifactQueryBuilder(Collection<Integer> artifactIds, int artifactId, List<String> guids, String guid, Collection<? extends IArtifactType> artifactTypes, IOseeBranch branch, TransactionRecord transactionId, DeletionFlag allowDeleted, LoadLevel loadLevel, ArtifactSearchCriteria... criteria) { + private ArtifactQueryBuilder(Collection<Integer> artifactIds, int artifactId, List<String> guids, String guid, Collection<? extends IArtifactType> artifactTypes, BranchId branch, TransactionRecord transactionId, DeletionFlag allowDeleted, LoadLevel loadLevel, ArtifactSearchCriteria... criteria) { this.artifactTypes = artifactTypes; this.branch = branch; this.criteria = criteria; @@ -360,9 +360,9 @@ public class ArtifactQueryBuilder { private final Set<Integer> localIds = new LinkedHashSet<>(); private DeletionFlag allowDeleted = EXCLUDE_DELETED; private int txId = -1; - private final IOseeBranch branch; + private final BranchId branch; - public LocalIdQueryBuilder(IOseeBranch branch) { + public LocalIdQueryBuilder(BranchId branch) { super(); this.branch = branch; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/SearchRequest.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/SearchRequest.java index 7c7f7cef092..fa81b6faeef 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/SearchRequest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/SearchRequest.java @@ -11,25 +11,25 @@ package org.eclipse.osee.framework.skynet.core.artifact.search; import org.eclipse.osee.framework.core.data.HasBranch; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; /** * @author Roberto E. Escobar */ public class SearchRequest implements HasBranch { - private final IOseeBranch branch; + private final BranchId branch; private final String rawSearch; private final SearchOptions options; - public SearchRequest(IOseeBranch branch, String rawSearch, SearchOptions options) { + public SearchRequest(BranchId branch, String rawSearch, SearchOptions options) { this.branch = branch; this.rawSearch = rawSearch; this.options = options != null ? options : new SearchOptions(); } @Override - public IOseeBranch getBranch() { + public BranchId getBranch() { return branch; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java index 2129e7e8e54..76a06c867d7 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java @@ -17,7 +17,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.exception.OseeTypeDoesNotExist; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.OseeEnumEntry; @@ -52,7 +52,7 @@ public class AttributeTypeManager { return getCacheService().getBranchCache(); } - public static Collection<IAttributeType> getValidAttributeTypes(IOseeBranch branchToken) throws OseeCoreException { + public static Collection<IAttributeType> getValidAttributeTypes(BranchId branchToken) throws OseeCoreException { Branch branch = getBranchCache().get(branchToken); Set<IAttributeType> attributeTypes = new HashSet<>(100); for (ArtifactType artifactType : ArtifactTypeManager.getAllTypes()) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/service/BranchAttributeAdapter.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/service/BranchAttributeAdapter.java index 8fb69ef4521..11a2aaea422 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/service/BranchAttributeAdapter.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/service/BranchAttributeAdapter.java @@ -12,21 +12,20 @@ package org.eclipse.osee.framework.skynet.core.attribute.service; import java.util.Collection; import java.util.Collections; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.TokenFactory; 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.UuidIdentity; import org.eclipse.osee.framework.skynet.core.artifact.Attribute; -import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.attribute.AttributeAdapter; -public class BranchAttributeAdapter implements AttributeAdapter<IOseeBranch> { +public class BranchAttributeAdapter implements AttributeAdapter<BranchId> { @Override - public IOseeBranch adapt(Attribute<?> attribute, UuidIdentity identity) throws OseeCoreException { - Long uuid = identity.getUuid(); - return uuid > 0 ? BranchManager.getBranch(uuid) : null; + public BranchId adapt(Attribute<?> attribute, UuidIdentity identity) throws OseeCoreException { + return TokenFactory.createBranch(identity.getUuid()); } @Override diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java index 6f2ffbdb785..932a20ded27 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactChange.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.framework.skynet.core.change; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.model.TransactionDelta; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -23,7 +23,7 @@ public final class ArtifactChange extends Change { private static LoadChangeType changeType = LoadChangeType.artifact; private static Class<ArtifactChangeWorker> worker = ArtifactChangeWorker.class; - public ArtifactChange(IOseeBranch branch, long sourceGamma, int artId, TransactionDelta txDelta, ModificationType modType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) { + public ArtifactChange(BranchId branch, long sourceGamma, int artId, TransactionDelta txDelta, ModificationType modType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) { super(branch, sourceGamma, artId, txDelta, modType, isHistorical, changeArtifact, artifactDelta); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactDelta.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactDelta.java index 3e2dd7a6d99..542ef6d6150 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactDelta.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ArtifactDelta.java @@ -66,7 +66,7 @@ public class ArtifactDelta { } public IOseeBranch getBranch() { - return getStartArtifact() != null ? getStartArtifact().getBranch() : getEndArtifact().getBranch(); + return getStartArtifact() != null ? getStartArtifact().getBranchToken() : getEndArtifact().getBranchToken(); } @Override diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java index 84b234469ff..ff991c6cb14 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/AttributeChange.java @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.skynet.core.change; import java.util.List; import java.util.logging.Level; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist; import org.eclipse.osee.framework.core.model.TransactionDelta; @@ -38,7 +38,7 @@ public final class AttributeChange extends Change { private final AttributeType attributeType; private final ModificationType artModType; - public AttributeChange(IOseeBranch branch, long sourceGamma, int artId, TransactionDelta txDelta, ModificationType modType, String isValue, String wasValue, int attrId, AttributeType attributeType, ModificationType artModType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) { + public AttributeChange(BranchId branch, long sourceGamma, int artId, TransactionDelta txDelta, ModificationType modType, String isValue, String wasValue, int attrId, AttributeType attributeType, ModificationType artModType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) { super(branch, sourceGamma, artId, txDelta, modType, isHistorical, changeArtifact, artifactDelta); this.isValue = isValue; this.wasValue = wasValue; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java index 9364cda1719..13658d3407b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.skynet.core.change; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.osee.framework.core.data.HasBranch; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.model.TransactionDelta; import org.eclipse.osee.framework.core.model.change.ChangeItem; @@ -31,12 +31,12 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc private final TransactionDelta txDelta; private final ArtifactDelta artifactDelta; private final ModificationType modType; - private final IOseeBranch branch; + private final BranchId branch; private final boolean isHistorical; private final Artifact changeArtifact; private ChangeItem changeItem; - public Change(IOseeBranch branch, long sourceGamma, int artId, TransactionDelta txDelta, ModificationType modType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) { + public Change(BranchId branch, long sourceGamma, int artId, TransactionDelta txDelta, ModificationType modType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta) { this.branch = branch; this.sourceGamma = sourceGamma; this.artId = artId; @@ -139,7 +139,7 @@ public abstract class Change implements IAdaptable, Comparable<Change>, HasBranc } @Override - public IOseeBranch getBranch() { + public BranchId getBranch() { return branch; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java index b0a2fc4a61c..d85ed92d81c 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/ErrorChange.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.framework.skynet.core.change; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.skynet.core.revision.LoadChangeType; /** @@ -22,7 +22,7 @@ public final class ErrorChange extends Change { private final String errorMessage; private final String name; - public ErrorChange(IOseeBranch branch, int artId, String exception) { + public ErrorChange(BranchId branch, int artId, String exception) { super(branch, 0, artId, null, null, false, null, null); this.errorMessage = String.format("%s %s", ERROR_STRING, exception); this.name = String.format("%s ArtID: %s BranchUuid: %s - %s", ERROR_STRING, getArtId(), diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java index 7b0ff9d6f2f..9cb2dd75a1e 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/RelationChange.java @@ -11,7 +11,7 @@ package org.eclipse.osee.framework.skynet.core.change; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.model.TransactionDelta; import org.eclipse.osee.framework.core.model.type.RelationType; @@ -31,7 +31,7 @@ public final class RelationChange extends Change { private final String rationale; private final RelationType relationType; - public RelationChange(IOseeBranch branch, long sourceGamma, int aArtId, TransactionDelta txDelta, ModificationType modType, int bArtId, int relLinkId, String rationale, RelationType relationType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta, Artifact endTxBArtifact) { + public RelationChange(BranchId branch, long sourceGamma, int aArtId, TransactionDelta txDelta, ModificationType modType, int bArtId, int relLinkId, String rationale, RelationType relationType, boolean isHistorical, Artifact changeArtifact, ArtifactDelta artifactDelta, Artifact endTxBArtifact) { super(branch, sourceGamma, aArtId, txDelta, modType, isHistorical, changeArtifact, artifactDelta); this.bArtId = bArtId; this.relLinkId = relLinkId; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchTrackedChanges.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchTrackedChanges.java index 7c3c6eaa65c..14603a85921 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchTrackedChanges.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CatchTrackedChanges.java @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.eclipse.core.runtime.IStatus; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.exception.OseeWrappedException; import org.eclipse.osee.framework.core.operation.IOperation; import org.eclipse.osee.framework.core.operation.Operations; @@ -41,7 +41,7 @@ public class CatchTrackedChanges implements CommitAction { */ @Override - public void runCommitAction(IOseeBranch sourceBranch, IOseeBranch destinationBranch) throws OseeCoreException { + public void runCommitAction(BranchId sourceBranch, BranchId destinationBranch) throws OseeCoreException { Set<Artifact> changedArtifacts = new HashSet<>(); Collection<Change> changes = new ArrayList<>(); IOperation operation = ChangeManager.compareTwoBranchesHead(sourceBranch, destinationBranch, changes); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CommitAction.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CommitAction.java index 0549aec5fb8..85e015d89d0 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CommitAction.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/commit/actions/CommitAction.java @@ -10,12 +10,12 @@ *******************************************************************************/ package org.eclipse.osee.framework.skynet.core.commit.actions; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; /** * @author Theron Virgin */ public interface CommitAction { - public void runCommitAction(IOseeBranch sourceBranch, IOseeBranch destinationBranch) throws OseeCoreException; + public void runCommitAction(BranchId sourceBranch, BranchId destinationBranch) throws OseeCoreException; }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictManagerExternal.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictManagerExternal.java index d01aa5b0151..cac4b2c69de 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictManagerExternal.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictManagerExternal.java @@ -14,7 +14,7 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.ConflictStatus; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; @@ -32,7 +32,7 @@ public class ConflictManagerExternal { private final Branch sourceBranch; private List<Conflict> originalConflicts; - public ConflictManagerExternal(IOseeBranch destinationBranch, IOseeBranch sourceBranch) throws OseeCoreException { + public ConflictManagerExternal(BranchId destinationBranch, BranchId sourceBranch) throws OseeCoreException { this.destinationBranch = BranchManager.getBranch(destinationBranch); this.sourceBranch = BranchManager.getBranch(sourceBranch); } 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 18f3827c07e..6925bc68019 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 @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.List; import java.util.logging.Level; import org.eclipse.core.runtime.Assert; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.logging.OseeLog; @@ -193,7 +193,7 @@ public final class OseeEventManager { return toReturn; } - public static List<IEventFilter> getEventFiltersForBranch(final IOseeBranch branch) { + public static List<IEventFilter> getEventFiltersForBranch(final BranchId branch) { try { List<IEventFilter> eventFilters = new ArrayList<>(2); eventFilters.add(new BranchUuidEventFilter(branch)); 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 1f40194dff0..fedc33d1758 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 @@ -12,7 +12,6 @@ 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; @@ -21,12 +20,12 @@ import org.eclipse.osee.framework.core.model.event.IBasicGuidRelation; */ public class BranchUuidEventFilter implements IEventFilter { - private final IOseeBranch branchToken; + private final BranchId branchToken; /** * Provide branch of events that should be passed through. All other branches will be ignored. */ - public BranchUuidEventFilter(IOseeBranch branchToken) { + public BranchUuidEventFilter(BranchId branchToken) { this.branchToken = branchToken; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/AccessControlEvent.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/AccessControlEvent.java index ec0874a593e..505d1cd099d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/AccessControlEvent.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/model/AccessControlEvent.java @@ -12,7 +12,7 @@ package org.eclipse.osee.framework.skynet.core.event.model; import java.util.ArrayList; import java.util.List; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact; public class AccessControlEvent implements FrameworkEvent, HasNetworkSender, HasEventType<AccessControlEventType> { @@ -72,7 +72,7 @@ public class AccessControlEvent implements FrameworkEvent, HasNetworkSender, Has this.eventType = eventType; } - public boolean isForBranch(IOseeBranch branch) { + public boolean isForBranch(BranchId branch) { for (DefaultBasicGuidArtifact guidArt : getArtifacts()) { if (guidArt.isOnBranch(branch)) { return true; 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 c17cc85bb1d..f2ae22b31e0 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 @@ -17,7 +17,6 @@ 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; @@ -71,7 +70,7 @@ public class ArtifactEvent implements FrameworkEvent, HasNetworkSender { return relationReorderRecords; } - public boolean isForBranch(IOseeBranch branch) { + public boolean isForBranch(BranchId branch) { return getBranch().equals(branch.getUuid()); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/BaseArtifactLoopbackCmd.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/BaseArtifactLoopbackCmd.java index 6328681dd2a..7d1523f24e2 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/BaseArtifactLoopbackCmd.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/BaseArtifactLoopbackCmd.java @@ -15,7 +15,7 @@ import static org.eclipse.osee.framework.core.enums.DeletionFlag.INCLUDE_DELETED import java.net.HttpURLConnection; import java.util.Map; import org.eclipse.osee.framework.core.client.server.HttpResponse; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.jdk.core.util.Strings; @@ -44,7 +44,7 @@ public abstract class BaseArtifactLoopbackCmd implements IClientLoopbackCmd { } else { try { final Artifact artifact; - final IOseeBranch branch; + final BranchId branch; if (Strings.isValid(transactionIdStr)) { int transactionNumber = Integer.parseInt(transactionIdStr); TransactionRecord transactionId = TransactionManager.getTransactionId(transactionNumber); 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 362f1eb5bab..b0614d1081e 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 @@ -21,7 +21,7 @@ import java.util.logging.Level; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.BranchState; import org.eclipse.osee.framework.core.enums.SystemUser; import org.eclipse.osee.framework.core.model.Branch; @@ -130,7 +130,7 @@ public final class CommitBranchHttpRequestOperation extends AbstractOperation { return toReturn; } - private void handleResponse(Integer newTxId, IProgressMonitor monitor, IOseeBranch sourceBranch, Branch destinationBranch) throws OseeCoreException { + private void handleResponse(Integer newTxId, IProgressMonitor monitor, BranchId sourceBranch, Branch destinationBranch) throws OseeCoreException { TransactionRecord newTransaction = TransactionManager.getTransactionId(newTxId); AccessPolicy accessPolicy = ServiceUtil.getAccessPolicy(); accessPolicy.removePermissions(sourceBranch); 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 42579c7223c..51071c8285f 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 @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.skynet.core.httpRequests; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchState; import org.eclipse.osee.framework.core.enums.StorageState; @@ -40,7 +40,7 @@ public final class PurgeBranchHttpRequestOperation extends AbstractOperation { private final Branch branch; private final boolean recursive; - public PurgeBranchHttpRequestOperation(IOseeBranch branch, boolean recursive) throws OseeCoreException { + public PurgeBranchHttpRequestOperation(BranchId branch, boolean recursive) throws OseeCoreException { super("Purge " + branch, Activator.PLUGIN_ID); this.branch = BranchManager.getBranch(branch); this.recursive = recursive; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/operations/FilterArtifactTypesByAttributeTypes.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/operations/FilterArtifactTypesByAttributeTypes.java index 95899d47b97..bfca9b87315 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/operations/FilterArtifactTypesByAttributeTypes.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/operations/FilterArtifactTypesByAttributeTypes.java @@ -16,7 +16,7 @@ import java.util.Set; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.type.ArtifactType; import org.eclipse.osee.framework.core.operation.AbstractOperation; @@ -35,7 +35,7 @@ import org.eclipse.osee.framework.skynet.core.internal.Activator; */ public class FilterArtifactTypesByAttributeTypes extends AbstractOperation { - private final IOseeBranch branch; + private final BranchId branch; private final Collection<IArtifactType> selectedArtifactTypes; private final RoughArtifactCollector collector; @@ -45,7 +45,7 @@ public class FilterArtifactTypesByAttributeTypes extends AbstractOperation { * @param selectedArtifactTypes ----> <b>MUTABLE</b> list of items {{@link #doWork(IProgressMonitor)} will operate * on. */ - public FilterArtifactTypesByAttributeTypes(IOseeBranch branch, RoughArtifactCollector collector, Collection<IArtifactType> selectedArtifactTypes) { + public FilterArtifactTypesByAttributeTypes(BranchId branch, RoughArtifactCollector collector, Collection<IArtifactType> selectedArtifactTypes) { super("Filter Artifact Types", Activator.PLUGIN_ID); this.branch = branch; this.selectedArtifactTypes = selectedArtifactTypes; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/AttributeBasedArtifactResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/AttributeBasedArtifactResolver.java index fa4e8f2f502..0af1fad0a5b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/AttributeBasedArtifactResolver.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/AttributeBasedArtifactResolver.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; 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; @@ -71,7 +71,7 @@ public class AttributeBasedArtifactResolver extends NewArtifactImportResolver { } @Override - public Artifact resolve(RoughArtifact roughArtifact, IOseeBranch branch, Artifact realParent, Artifact root) throws OseeCoreException { + public Artifact resolve(RoughArtifact roughArtifact, BranchId branch, Artifact realParent, Artifact root) throws OseeCoreException { Artifact realArtifact = null; RoughArtifact roughParent = roughArtifact.getRoughParent(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/DoorsBestFitArtifactResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/DoorsBestFitArtifactResolver.java index 0f058742d29..0132ada2e5b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/DoorsBestFitArtifactResolver.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/DoorsBestFitArtifactResolver.java @@ -14,7 +14,7 @@ import java.util.Arrays; import java.util.List; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +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.util.Strings; @@ -35,7 +35,7 @@ public class DoorsBestFitArtifactResolver extends NewArtifactImportResolver { } @Override - public Artifact resolve(RoughArtifact roughArtifact, IOseeBranch branch, Artifact realParent, Artifact root) throws OseeCoreException { + public Artifact resolve(RoughArtifact roughArtifact, BranchId branch, Artifact realParent, Artifact root) throws OseeCoreException { Artifact realArtifact = null; if (roughArtifact.getGuid() != null) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java index 7580aac8b8d..32785329dbb 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.skynet.core.importing.resolvers; import java.util.List; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; 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; @@ -38,7 +38,7 @@ public class GuidBasedArtifactResolver extends NewArtifactImportResolver { } @Override - public Artifact resolve(RoughArtifact roughArtifact, IOseeBranch branch, Artifact realParent, Artifact root) throws OseeCoreException { + public Artifact resolve(RoughArtifact roughArtifact, BranchId branch, Artifact realParent, Artifact root) throws OseeCoreException { List<Artifact> descendants = root.getDescendants(); Artifact realArtifact = null; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/IArtifactImportResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/IArtifactImportResolver.java index a79c6e3c9d7..3e40869d95d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/IArtifactImportResolver.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/IArtifactImportResolver.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.framework.skynet.core.importing.resolvers; -import org.eclipse.osee.framework.core.data.IOseeBranch; +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.Artifact; import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact; @@ -22,5 +22,5 @@ import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact; */ public interface IArtifactImportResolver { - public Artifact resolve(RoughArtifact roughArtifact, IOseeBranch branch, Artifact realParent, Artifact root) throws OseeCoreException; + public Artifact resolve(RoughArtifact roughArtifact, BranchId branch, Artifact realParent, Artifact root) throws OseeCoreException; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java index d2e87ec74f6..3e3fd47095f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java @@ -12,7 +12,7 @@ package org.eclipse.osee.framework.skynet.core.importing.resolvers; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLog; @@ -41,7 +41,7 @@ public class NewArtifactImportResolver implements IArtifactImportResolver { } @Override - public Artifact resolve(final RoughArtifact roughArtifact, final IOseeBranch branch, Artifact realParent, Artifact root) throws OseeCoreException { + public Artifact resolve(final RoughArtifact roughArtifact, final BranchId branch, Artifact realParent, Artifact root) throws OseeCoreException { IArtifactType artifactType = getArtifactType(roughArtifact.getRoughArtifactKind()); OseeLog.logf(NewArtifactImportResolver.class, Level.INFO, "New artifact: [%s]. Attributes: [%s]", roughArtifact, diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java index a76e2769ff8..725520f2675 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java @@ -16,7 +16,7 @@ import java.util.logging.Level; import org.eclipse.osee.framework.core.client.OseeClientProperties; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IRelationTypeSide; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.enums.RelationSide; @@ -72,7 +72,7 @@ public class AccessPolicyImpl implements AccessPolicy { } @Override - public void removePermissions(IOseeBranch branch) throws OseeCoreException { + public void removePermissions(BranchId branch) throws OseeCoreException { getAccessService().removePermissions(branch); } @@ -88,7 +88,7 @@ public class AccessPolicyImpl implements AccessPolicy { } @Override - public PermissionStatus hasBranchPermission(IOseeBranch branch, PermissionEnum permission, Level level) throws OseeCoreException { + public PermissionStatus hasBranchPermission(BranchId branch, PermissionEnum permission, Level level) throws OseeCoreException { User currentUser = getCurrentUser(); AccessDataQuery query = getAccessService().getAccessData(currentUser, java.util.Collections.singleton(branch)); PermissionStatus permissionStatus = null; @@ -159,7 +159,7 @@ public class AccessPolicyImpl implements AccessPolicy { } @Override - public PermissionStatus hasArtifactTypePermission(IOseeBranch branch, Collection<? extends IArtifactType> artifactTypes, PermissionEnum permission, Level level) throws OseeCoreException { + public PermissionStatus hasArtifactTypePermission(BranchId branch, Collection<? extends IArtifactType> artifactTypes, PermissionEnum permission, Level level) throws OseeCoreException { User currentUser = getCurrentUser(); AccessDataQuery query = getAccessService().getAccessData(currentUser, java.util.Collections.singleton(branch)); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/DslToTypeLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/DslToTypeLoader.java index a33ecd4dbda..8223f77763f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/DslToTypeLoader.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/DslToTypeLoader.java @@ -22,7 +22,7 @@ import java.util.Map; import java.util.Set; import java.util.logging.Level; import org.eclipse.emf.common.util.EList; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.TokenFactory; import org.eclipse.osee.framework.core.dsl.OseeDslResource; import org.eclipse.osee.framework.core.dsl.OseeDslResourceUtil; @@ -147,7 +147,7 @@ public class DslToTypeLoader implements TypesLoader { private void handleXArtifactTypeCrossRef(TypeBuffer buffer, BranchCache branchCache, XArtifactType xArtifactType) throws OseeCoreException { ArtifactType targetArtifactType = buffer.getArtTypes().getByGuid(HexUtil.toLong(xArtifactType.getUuid())); translateSuperTypes(buffer, targetArtifactType, xArtifactType); - Map<IOseeBranch, Collection<AttributeType>> validAttributesPerBranch = + Map<BranchId, Collection<AttributeType>> validAttributesPerBranch = getOseeAttributes(buffer, branchCache, xArtifactType); targetArtifactType.setAllAttributeTypes(validAttributesPerBranch); } @@ -165,12 +165,12 @@ public class DslToTypeLoader implements TypesLoader { } } - private Map<IOseeBranch, Collection<AttributeType>> getOseeAttributes(TypeBuffer buffer, BranchCache branchCache, XArtifactType xArtifactType) throws OseeCoreException { - Map<IOseeBranch, Collection<AttributeType>> validAttributes = - new HashMap<IOseeBranch, Collection<AttributeType>>(); + private Map<BranchId, Collection<AttributeType>> getOseeAttributes(TypeBuffer buffer, BranchCache branchCache, XArtifactType xArtifactType) throws OseeCoreException { + Map<BranchId, Collection<AttributeType>> validAttributes = + new HashMap<BranchId, Collection<AttributeType>>(); for (XAttributeTypeRef xAttributeTypeRef : xArtifactType.getValidAttributeTypes()) { XAttributeType xAttributeType = xAttributeTypeRef.getValidAttributeType(); - IOseeBranch branch = getAttributeBranch(branchCache, xAttributeTypeRef); + BranchId branch = getAttributeBranch(branchCache, xAttributeTypeRef); Long attrUuid = HexUtil.toLong(xAttributeType.getUuid()); AttributeType oseeAttributeType = buffer.getAttrTypes().getByGuid(attrUuid); if (oseeAttributeType != null) { @@ -187,7 +187,7 @@ public class DslToTypeLoader implements TypesLoader { return validAttributes; } - private IOseeBranch getAttributeBranch(BranchCache branchCache, XAttributeTypeRef xAttributeTypeRef) throws OseeCoreException { + private BranchId getAttributeBranch(BranchCache branchCache, XAttributeTypeRef xAttributeTypeRef) throws OseeCoreException { String branchIdStr = xAttributeTypeRef.getBranchUuid(); if (branchIdStr == null) { return CoreBranches.SYSTEM_ROOT; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseTransactionRecordAccessor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseTransactionRecordAccessor.java index fd81f797b4f..b09c6e010bd 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseTransactionRecordAccessor.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseTransactionRecordAccessor.java @@ -2,7 +2,7 @@ package org.eclipse.osee.framework.skynet.core.internal.accessors; import java.util.Collection; import java.util.Date; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.TransactionDetailsType; import org.eclipse.osee.framework.core.enums.TransactionVersion; import org.eclipse.osee.framework.core.model.Branch; @@ -82,7 +82,7 @@ public class DatabaseTransactionRecordAccessor implements ITransactionDataAccess } @Override - public TransactionRecord loadTransactionRecord(TransactionCache cache, IOseeBranch branch, TransactionVersion transactionType) throws OseeCoreException { + public TransactionRecord loadTransactionRecord(TransactionCache cache, BranchId branch, TransactionVersion transactionType) throws OseeCoreException { ensureDependantCachePopulated(); TransactionRecord toReturn = null; switch (transactionType) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/ArtifactRemoteEventHandler.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/ArtifactRemoteEventHandler.java index 33d588ba750..0aac8efb156 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/ArtifactRemoteEventHandler.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/event/handlers/ArtifactRemoteEventHandler.java @@ -11,7 +11,7 @@ package org.eclipse.osee.framework.skynet.core.internal.event.handlers; import java.util.Collection; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.TokenFactory; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact; @@ -184,7 +184,7 @@ public class ArtifactRemoteEventHandler implements EventHandlerRemote<RemotePers boolean bArtifactLoaded = bArtifact != null; if (aArtifactLoaded || bArtifactLoaded) { - IOseeBranch branch = TokenFactory.createBranch(guidArt.getArtA().getBranchId()); + BranchId branch = TokenFactory.createBranch(guidArt.getArtA().getBranchId()); RelationLink relation = RelationManager.getLoadedRelationById(guidArt.getRelationId(), guidArt.getArtAId(), guidArt.getArtBId(), branch); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/WordMlLinkHandler.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/WordMlLinkHandler.java index 2d917b443bc..bbecc0f18cc 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/WordMlLinkHandler.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/linking/WordMlLinkHandler.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.jdk.core.text.change.ChangeSet; @@ -179,7 +179,7 @@ public class WordMlLinkHandler { return matchMap; } - private static List<Artifact> findArtifacts(TransactionRecord transactionId, IOseeBranch branch, boolean isHistorical, List<String> guidsFromLinks) throws OseeCoreException { + private static List<Artifact> findArtifacts(TransactionRecord transactionId, BranchId branch, boolean isHistorical, List<String> guidsFromLinks) throws OseeCoreException { List<Artifact> artifactsFromSearch; if (isHistorical) { artifactsFromSearch = diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java index 13f8f352fb4..e71880b7c0f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java @@ -17,7 +17,7 @@ import java.util.List; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.enums.RelationSide; @@ -51,7 +51,7 @@ public class RelationCache { return key.setKey(artifact); } - private ArtifactKey getKey(int artId, IOseeBranch branchUuid) { + private ArtifactKey getKey(int artId, BranchId branchUuid) { ArtifactKey key = THREAD_SHARED_KEY.get(); return key.setKey(artId, branchUuid); } @@ -116,12 +116,12 @@ public class RelationCache { return linksFound; } - private void findRelations(Collection<RelationLink> linksFound, int artId, IOseeBranch branchUuid, IRelationType relationType, RelationMatcher matcher) { + private void findRelations(Collection<RelationLink> linksFound, int artId, BranchId branchUuid, IRelationType relationType, RelationMatcher matcher) { List<RelationLink> sourceLink = relationsByType.get(getKey(artId, branchUuid), relationType); RelationFilterUtil.filter(sourceLink, linksFound, matcher); } - private void findRelations(Collection<RelationLink> linksFound, int artId, IOseeBranch branchUuid, RelationMatcher matcher) { + private void findRelations(Collection<RelationLink> linksFound, int artId, BranchId branchUuid, RelationMatcher matcher) { ArtifactKey artifactKey = getKey(artId, branchUuid); findRelations(linksFound, artifactKey, matcher); } @@ -138,7 +138,7 @@ public class RelationCache { /** * Find RelationById Related On ArtA or ArtB */ - public RelationLink getByRelIdOnArtifact(int relLinkId, int aArtifactId, int bArtifactId, IOseeBranch branch) { + public RelationLink getByRelIdOnArtifact(int relLinkId, int aArtifactId, int bArtifactId, BranchId branch) { RelationMatcher relIdMatcher = RelationFilterUtil.createFindFirstRelationLinkIdMatcher(relLinkId); List<RelationLink> links = new ArrayList<>(); findRelations(links, aArtifactId, branch, relIdMatcher); @@ -152,7 +152,7 @@ public class RelationCache { Set<RelationLink> itemsFound = new HashSet<>(); final int artifactId = artifact.getArtId(); - final IOseeBranch branchUuid = artifact.getBranch(); + final BranchId branchUuid = artifact.getBranch(); RelationMatcher artIdMatcher = new RelationMatcher() { @Override @@ -184,7 +184,7 @@ public class RelationCache { return size != 0 ? relations.iterator().next() : null; } - public RelationLink getLoadedRelation(IRelationType relationType, final int aArtifactId, final int bArtifactId, IOseeBranch branch) { + public RelationLink getLoadedRelation(IRelationType relationType, final int aArtifactId, final int bArtifactId, BranchId branch) { RelationMatcher bArtIdMatcher = RelationFilterUtil.createFindFirstRelatedArtIdMatcher(bArtifactId, RelationSide.SIDE_B); List<RelationLink> links = new ArrayList<>(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java index 88f3cb0c4d2..834f64d6d53 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.skynet.core.relation; import static org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes.USER_DEFINED; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.HasBranch; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IRelationSorterId; import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; @@ -40,11 +40,11 @@ public class RelationLink implements HasBranch { public static interface ArtifactLinker { - public void updateCachedArtifact(int artId, IOseeBranch branch); + public void updateCachedArtifact(int artId, BranchId branch); - public Artifact getArtifact(int ArtId, IOseeBranch branch) throws OseeCoreException; + public Artifact getArtifact(int ArtId, BranchId branch) throws OseeCoreException; - public String getLazyArtifactName(int aArtifactId, IOseeBranch branch); + public String getLazyArtifactName(int aArtifactId, BranchId branch); public void deleteFromRelationOrder(Artifact aArtifact, Artifact bArtifact, IRelationType relationType) throws OseeCoreException; } @@ -56,7 +56,7 @@ public class RelationLink implements HasBranch { private boolean dirty; private final int aArtifactId; private final int bArtifactId; - private final IOseeBranch branch; + private final BranchId branch; private ModificationType modificationType; private static final boolean SET_DIRTY = true; @@ -65,7 +65,7 @@ public class RelationLink implements HasBranch { private final ArtifactLinker artifactLinker; private boolean useBackingData; - public RelationLink(ArtifactLinker artifactLinker, int aArtifactId, int bArtifactId, IOseeBranch branch, RelationType relationType, int relationId, int gammaId, String rationale, ModificationType modificationType) { + public RelationLink(ArtifactLinker artifactLinker, int aArtifactId, int bArtifactId, BranchId branch, RelationType relationType, int relationId, int gammaId, String rationale, ModificationType modificationType) { this.artifactLinker = artifactLinker; this.relationType = relationType; this.relationId = relationId; @@ -323,7 +323,7 @@ public class RelationLink implements HasBranch { } @Override - public IOseeBranch getBranch() { + public BranchId getBranch() { return branch; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java index d97f8c9a523..73f0f71642a 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IRelationSorterId; import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.data.IRelationTypeSide; @@ -220,7 +220,7 @@ public class RelationManager { } if (relatedArtIds.size() > 0) { - IOseeBranch branch = artifacts.iterator().next().getBranch(); + BranchId branch = artifacts.iterator().next().getBranch(); newArtifacts = ArtifactQuery.getArtifactListFromIds(relatedArtIds, branch, allowDeleted); } newArtifactsToSearch.clear(); @@ -596,7 +596,7 @@ public class RelationManager { * @param relationId 0 or relationId if already created * @throws OseeCoreException */ - public static synchronized RelationLink getOrCreate(int aArtifactId, int bArtifactId, IOseeBranch branch, RelationType relationType, int relationId, int gammaId, String rationale, ModificationType modificationType) throws OseeCoreException { + public static synchronized RelationLink getOrCreate(int aArtifactId, int bArtifactId, BranchId branch, RelationType relationType, int relationId, int gammaId, String rationale, ModificationType modificationType) throws OseeCoreException { RelationLink relation = null; if (relationId != 0) { relation = getLoadedRelationById(relationId, aArtifactId, bArtifactId, branch); @@ -613,11 +613,11 @@ public class RelationManager { return relation; } - public static RelationLink getLoadedRelation(IRelationType relationType, int aArtifactId, int bArtifactId, IOseeBranch branch) { + public static RelationLink getLoadedRelation(IRelationType relationType, int aArtifactId, int bArtifactId, BranchId branch) { return relationCache.getLoadedRelation(relationType, aArtifactId, bArtifactId, branch); } - public static RelationLink getLoadedRelationById(int relLinkId, int aArtifactId, int bArtifactId, IOseeBranch branch) { + public static RelationLink getLoadedRelationById(int relLinkId, int aArtifactId, int bArtifactId, BranchId branch) { return relationCache.getByRelIdOnArtifact(relLinkId, aArtifactId, bArtifactId, branch); } @@ -632,12 +632,12 @@ public class RelationManager { private static final class RelationArtifactLinker implements ArtifactLinker { @Override - public Artifact getArtifact(int artifactId, IOseeBranch branch) throws OseeCoreException { + public Artifact getArtifact(int artifactId, BranchId branch) throws OseeCoreException { return ArtifactQuery.getArtifactFromId(artifactId, branch, DeletionFlag.INCLUDE_DELETED); } @Override - public String getLazyArtifactName(int artifactId, IOseeBranch branch) { + public String getLazyArtifactName(int artifactId, BranchId branch) { Artifact artifact = null; try { artifact = ArtifactCache.getActive(artifactId, branch); @@ -657,7 +657,7 @@ public class RelationManager { } @Override - public void updateCachedArtifact(int artId, IOseeBranch branch) { + public void updateCachedArtifact(int artId, BranchId branch) { try { ArtifactCache.updateCachedArtifact(artId, branch.getUuid()); } catch (OseeCoreException ex) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java index e76e360aef6..6ae117c0b5d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java @@ -14,7 +14,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.enums.RelationSide; import org.eclipse.osee.framework.core.exception.OseeTypeDoesNotExist; @@ -43,7 +43,7 @@ public class RelationTypeManager { return getCacheService().getArtifactTypeCache(); } - public static List<RelationType> getValidTypes(IArtifactType artifactType, IOseeBranch branch) throws OseeCoreException { + public static List<RelationType> getValidTypes(IArtifactType artifactType, BranchId branch) throws OseeCoreException { Collection<RelationType> relationTypes = getAllTypes(); List<RelationType> validRelationTypes = new ArrayList<>(); for (RelationType relationType : relationTypes) { @@ -70,7 +70,7 @@ public class RelationTypeManager { /** * @return all the relation types that are valid for the given branch */ - public static Collection<RelationType> getValidTypes(IOseeBranch branch) throws OseeCoreException { + public static Collection<RelationType> getValidTypes(BranchId branch) throws OseeCoreException { return getAllTypes(); } 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 3cd850f922d..fc69e1e7dc3 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 @@ -17,7 +17,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map.Entry; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IRelationSorterId; import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes; @@ -126,7 +126,7 @@ public class RelationOrderData { addOrderList(type, side, requestedSorterId, relativeSequence); relationOrderModType = RelationOrderModType.Absolute; } - IOseeBranch branch = getIArtifact().getBranch(); + BranchId branch = getIArtifact().getBranch(); DefaultBasicGuidArtifact guidArtifact = new DefaultBasicGuidArtifact(branch, getIArtifact().getArtifactType().getGuid(), getIArtifact().getGuid()); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java index 31fa1a753fc..cde0f18f839 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeDataLoader.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Set; import java.util.logging.Level; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.TransactionDelta; @@ -85,7 +85,7 @@ public class ChangeDataLoader extends AbstractOperation { monitor.setTaskName("Compute artifact deltas"); double workAmount = 0.60 / changeItems.size(); - IOseeBranch startTxBranch = txDelta.getStartTx().getBranch(); + BranchId startTxBranch = txDelta.getStartTx().getBranch(); for (ChangeItem item : changeItems) { checkForCancelledStatus(monitor); Change change = computeChange(bulkLoaded, startTxBranch, item); @@ -108,7 +108,7 @@ public class ChangeDataLoader extends AbstractOperation { monitor.setTaskName("Compute artifact deltas"); double workAmount = 0.30 / changeItems.size(); - IOseeBranch startTxBranch = txDelta.getStartTx().getBranch(); + BranchId startTxBranch = txDelta.getStartTx().getBranch(); for (ChangeItem item : changeItems) { checkForCancelledStatus(monitor); Change change = computeChangeFromGamma(bulkLoaded, startTxBranch, item); @@ -117,7 +117,7 @@ public class ChangeDataLoader extends AbstractOperation { } } - private Change computeChangeFromGamma(CompositeKeyHashMap<TransactionRecord, Integer, Artifact> bulkLoaded, IOseeBranch startTxBranch, ChangeItem item) { + private Change computeChangeFromGamma(CompositeKeyHashMap<TransactionRecord, Integer, Artifact> bulkLoaded, BranchId startTxBranch, ChangeItem item) { Change change = null; try { int artId = item.getArtId(); @@ -157,7 +157,7 @@ public class ChangeDataLoader extends AbstractOperation { return change; } - private Change computeChange(CompositeKeyHashMap<TransactionRecord, Integer, Artifact> bulkLoaded, IOseeBranch startTxBranch, ChangeItem item) { + private Change computeChange(CompositeKeyHashMap<TransactionRecord, Integer, Artifact> bulkLoaded, BranchId startTxBranch, ChangeItem item) { Change change = null; try { int artId = item.getArtId(); @@ -182,7 +182,7 @@ public class ChangeDataLoader extends AbstractOperation { return change; } - private Change createChangeObject(CompositeKeyHashMap<TransactionRecord, Integer, Artifact> bulkLoaded, ChangeItem item, TransactionDelta txDelta, IOseeBranch startTxBranch, ArtifactDelta artifactDelta) throws OseeCoreException { + private Change createChangeObject(CompositeKeyHashMap<TransactionRecord, Integer, Artifact> bulkLoaded, ChangeItem item, TransactionDelta txDelta, BranchId startTxBranch, ArtifactDelta artifactDelta) throws OseeCoreException { Change change = null; int itemId = item.getItemId(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeManager.java index 44b86fb1023..b916a874929 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeManager.java @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.skynet.core.revision; import java.util.ArrayList; import java.util.Collection; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.enums.CoreBranches; @@ -79,7 +79,7 @@ public final class ChangeManager { /** * Acquires artifact, relation and attribute changes from a source branch since its creation. */ - public static IOperation comparedToParent(IOseeBranch sourceBranch, Collection<Change> changes) throws OseeCoreException { + public static IOperation comparedToParent(BranchId sourceBranch, Collection<Change> changes) throws OseeCoreException { Branch branch = BranchManager.getBranch(sourceBranch); TransactionRecord startTx = TransactionManager.getHeadTransaction(branch); @@ -89,7 +89,7 @@ public final class ChangeManager { return new ChangeDataLoader(changes, txDelta); } - public static IOperation compareTwoBranchesHead(IOseeBranch sourceBranch, IOseeBranch destinationBranch, Collection<Change> changes) throws OseeCoreException { + public static IOperation compareTwoBranchesHead(BranchId sourceBranch, BranchId destinationBranch, Collection<Change> changes) throws OseeCoreException { TransactionRecord startTx = TransactionManager.getHeadTransaction(sourceBranch); TransactionRecord endTx = TransactionManager.getHeadTransaction(destinationBranch); return new ChangeDataLoader(changes, new TransactionDelta(startTx, endTx)); @@ -148,12 +148,12 @@ public final class ChangeManager { public static HashCollection<Artifact, Branch> getModifingBranches(Collection<Artifact> artifacts) throws OseeCoreException { ArtifactJoinQuery joinQuery = JoinUtility.createArtifactJoinQuery(); - CompositeKeyHashMap<Integer, IOseeBranch, Artifact> artifactMap = - new CompositeKeyHashMap<Integer, IOseeBranch, Artifact>(); + CompositeKeyHashMap<Integer, BranchId, Artifact> artifactMap = + new CompositeKeyHashMap<Integer, BranchId, Artifact>(); for (Artifact artifact : artifacts) { artifactMap.put(artifact.getArtId(), artifact.getBranch(), artifact); // for each combination of artifact and all working branches in its hierarchy - for (IOseeBranch workingBranch : BranchManager.getBranches(BranchArchivedState.UNARCHIVED, + for (BranchId workingBranch : BranchManager.getBranches(BranchArchivedState.UNARCHIVED, BranchType.WORKING)) { if (artifact.isOnBranch(BranchManager.getParentBranch(workingBranch))) { joinQuery.add(artifact.getArtId(), workingBranch.getUuid()); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionChangeLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionChangeLoader.java index 5dd637b4d96..43ed65fe35d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionChangeLoader.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionChangeLoader.java @@ -19,7 +19,7 @@ import java.util.Map.Entry; import java.util.Set; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreBranches; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.model.Branch; @@ -157,7 +157,7 @@ public final class RevisionChangeLoader { } monitor.subTask("Loading Artifacts from the Database"); - IOseeBranch branch = isHistorical ? transactionId.getBranch() : sourceBranch; + BranchId branch = isHistorical ? transactionId.getBranch() : sourceBranch; Collection<Change> changesLoaded = getChanges(branch, isHistorical, changeBuilders); changes.addAll(changesLoaded); @@ -165,7 +165,7 @@ public final class RevisionChangeLoader { monitor.done(); } - private CompositeKeyHashMap<TransactionRecord, Integer, Artifact> getBulkLoadedArtifacts(IOseeBranch branch, boolean isHistorical, List<ChangeBuilder> changeBuilders) throws OseeCoreException { + private CompositeKeyHashMap<TransactionRecord, Integer, Artifact> getBulkLoadedArtifacts(BranchId branch, boolean isHistorical, List<ChangeBuilder> changeBuilders) throws OseeCoreException { HashCollection<TransactionRecord, Integer> loadMap = new HashCollection<TransactionRecord, Integer>(false, HashSet.class); for (ChangeBuilder builder : changeBuilders) { @@ -195,7 +195,7 @@ public final class RevisionChangeLoader { return loadedMap; } - private Collection<Change> getChanges(IOseeBranch branch, boolean isHistorical, List<ChangeBuilder> changeBuilders) throws OseeCoreException { + private Collection<Change> getChanges(BranchId branch, boolean isHistorical, List<ChangeBuilder> changeBuilders) throws OseeCoreException { CompositeKeyHashMap<TransactionRecord, Integer, Artifact> loadedMap = getBulkLoadedArtifacts(branch, isHistorical, changeBuilders); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/AttributeChangeAcquirer.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/AttributeChangeAcquirer.java index 8b52636c2a7..8948ebc7c69 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/AttributeChangeAcquirer.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/acquirer/AttributeChangeAcquirer.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Set; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.model.Branch; @@ -161,7 +161,7 @@ public class AttributeChangeAcquirer extends ChangeAcquirer { private void loadAttributeWasValues(Branch sourceBranch, TransactionRecord transactionId, Set<Integer> artIds, IProgressMonitor monitor, Map<Integer, ChangeBuilder> attributesWasValueCache, boolean hasBranch) throws OseeCoreException, OseeDataStoreException { if (!artIds.isEmpty()) { long sqlParamter; // Will either be a branch uuid or transaction id - IOseeBranch wasValueBranch; + BranchId wasValueBranch; String sql; if (hasBranch) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java index 299505d6819..8a1591d10a6 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java @@ -24,7 +24,7 @@ import java.util.List; import java.util.Set; import java.util.logging.Level; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.ITransaction; import org.eclipse.osee.framework.core.data.TokenFactory; import org.eclipse.osee.framework.core.enums.ModificationType; @@ -63,7 +63,7 @@ import org.eclipse.osee.framework.skynet.core.utility.ConnectionHandler; * @author Ryan D. Brooks * @author Jeff C. Phillips */ -public final class SkynetTransaction extends TransactionOperation<IOseeBranch> { +public final class SkynetTransaction extends TransactionOperation<BranchId> { private static final String ATTR_ID_SEQ = "SKYNET_ATTR_ID_SEQ"; private static final String REL_LINK_ID_SEQ = "SKYNET_REL_LINK_ID_SEQ"; @@ -81,7 +81,7 @@ public final class SkynetTransaction extends TransactionOperation<IOseeBranch> { private int transactionId = -1; private TransactionRecord transaction; - protected SkynetTransaction(TxMonitor<IOseeBranch> txMonitor, IOseeBranch branch, String comment) { + protected SkynetTransaction(TxMonitor<BranchId> txMonitor, BranchId branch, String comment) { super(txMonitor, branch, comment); this.comment = comment; } @@ -109,7 +109,7 @@ public final class SkynetTransaction extends TransactionOperation<IOseeBranch> { if (UserManager.duringMainUserCreation()) { return; } - IOseeBranch txBranch = getBranch(); + BranchId txBranch = getBranch(); if (!artifact.isOnBranch(txBranch)) { String msg = String.format("The artifact [%s] is on branch [%s] but this transaction is for branch [%s]", artifact.getGuid(), artifact.getBranch(), txBranch); @@ -142,7 +142,7 @@ public final class SkynetTransaction extends TransactionOperation<IOseeBranch> { } } - private boolean isBranchWritable(IOseeBranch branch) throws OseeCoreException { + private boolean isBranchWritable(BranchId branch) throws OseeCoreException { boolean toReturn = true; if (!UserManager.duringMainUserCreation()) { toReturn = getAccess().hasBranchPermission(branch, PermissionEnum.WRITE, @@ -156,7 +156,7 @@ public final class SkynetTransaction extends TransactionOperation<IOseeBranch> { return; } checkBranch(link); - IOseeBranch txBranch = getBranch(); + BranchId txBranch = getBranch(); if (!link.isOnBranch(txBranch)) { String msg = String.format("The relation link [%s] is on branch [%s] but this transaction is for branch [%s]", link.getId(), link.getBranch(), txBranch); @@ -199,7 +199,7 @@ public final class SkynetTransaction extends TransactionOperation<IOseeBranch> { alreadyProcessedArtifacts.clear(); } - public IOseeBranch getBranch() { + public BranchId getBranch() { return getKey(); } @@ -315,7 +315,7 @@ public final class SkynetTransaction extends TransactionOperation<IOseeBranch> { ModificationType modificationType; RelationEventType relationEventType; // needed until persist undeleted modtypes and modified == rational only change - IOseeBranch branch = link.getBranch(); + BranchId branch = link.getBranch(); Artifact aArtifact = ArtifactQuery.checkArtifactFromId(link.getAArtifactId(), branch, INCLUDE_DELETED); Artifact bArtifact = ArtifactQuery.checkArtifactFromId(link.getBArtifactId(), branch, INCLUDE_DELETED); 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 629199b54cc..409e200081c 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 @@ -21,7 +21,7 @@ import java.util.Set; import java.util.logging.Level; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.BranchState; import org.eclipse.osee.framework.core.enums.TxChange; import org.eclipse.osee.framework.core.model.TransactionRecord; @@ -57,14 +57,14 @@ public final class StoreSkynetTransactionOperation extends AbstractDbTxOperation private final HashCollection<String, Object[]> dataItemInserts = new HashCollection<>(); private final Map<Integer, String> dataInsertOrder = new HashMap<>(); - private final IOseeBranch branch; + private final BranchId branch; private final TransactionRecord transactionRecord; private final Collection<BaseTransactionData> txDatas; private final Collection<Artifact> artifactReferences; private boolean executedWithException; - public StoreSkynetTransactionOperation(String name, IOseeBranch branch, TransactionRecord transactionRecord, Collection<BaseTransactionData> txDatas, Collection<Artifact> artifactReferences) { + public StoreSkynetTransactionOperation(String name, BranchId branch, TransactionRecord transactionRecord, Collection<BaseTransactionData> txDatas, Collection<Artifact> artifactReferences) { super(ConnectionHandler.getJdbcClient(), name, Activator.PLUGIN_ID); this.branch = branch; this.transactionRecord = transactionRecord; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java index 534f027c510..eda5cac2e33 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java @@ -17,7 +17,7 @@ import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.List; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.TransactionDetailsType; import org.eclipse.osee.framework.core.exception.TransactionDoesNotExist; import org.eclipse.osee.framework.core.model.TransactionRecord; @@ -69,9 +69,9 @@ public final class TransactionManager { private static final HashMap<Integer, List<TransactionRecord>> commitArtifactIdMap = new HashMap<Integer, List<TransactionRecord>>(); - private static final TxMonitorImpl<IOseeBranch> txMonitor = new TxMonitorImpl<>(new TxMonitorCache<>()); + private static final TxMonitorImpl<BranchId> txMonitor = new TxMonitorImpl<>(new TxMonitorCache<>()); - public static SkynetTransaction createTransaction(IOseeBranch branch, String comment) throws OseeCoreException { + public static SkynetTransaction createTransaction(BranchId branch, String comment) throws OseeCoreException { SkynetTransaction tx = new SkynetTransaction(txMonitor, branch, comment); txMonitor.createTx(branch, tx); return tx; @@ -107,7 +107,7 @@ public final class TransactionManager { return getCacheService().getBranchCache(); } - public static List<TransactionRecord> getTransactionsForBranch(IOseeBranch branch) throws OseeCoreException { + public static List<TransactionRecord> getTransactionsForBranch(BranchId branch) throws OseeCoreException { ArrayList<TransactionRecord> transactions = new ArrayList<>(); JdbcStatement chStmt = ConnectionHandler.getStatement(); @@ -166,7 +166,7 @@ public final class TransactionManager { /** * @return the largest (most recent) transaction on the given branch */ - public static TransactionRecord getHeadTransaction(IOseeBranch branch) throws OseeCoreException { + public static TransactionRecord getHeadTransaction(BranchId branch) throws OseeCoreException { long branchUuid = branch.getUuid(); int transactionNumber = ConnectionHandler.runPreparedQueryFetchInt(-1, ServiceUtil.getSql(OseeSql.TX_GET_MAX_AS_LARGEST_TX), branchUuid); @@ -181,7 +181,7 @@ public final class TransactionManager { return (int) ConnectionHandler.getNextSequence(TRANSACTION_ID_SEQ, false); } - public static synchronized TransactionRecord internalCreateTransactionRecord(IOseeBranch branch, User userToBlame, String comment) throws OseeCoreException { + public static synchronized TransactionRecord internalCreateTransactionRecord(BranchId branch, User userToBlame, String comment) throws OseeCoreException { if (comment == null) { comment = ""; } @@ -200,7 +200,7 @@ public final class TransactionManager { transactionRecord.getBranchId(), transactionRecord.getTxType().getId()); } - public static TransactionRecord getTransactionAtDate(IOseeBranch branch, Date maxDateExclusive) throws OseeCoreException { + public static TransactionRecord getTransactionAtDate(BranchId branch, Date maxDateExclusive) throws OseeCoreException { Conditions.checkNotNull(branch, "branch"); Conditions.checkNotNull(maxDateExclusive, "max date exclusive"); long branchUuid = branch.getUuid(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java index 4b2dbf4f8a2..aa9d4d02d94 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java @@ -21,7 +21,7 @@ import java.util.Map; import java.util.Set; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.jdk.core.type.HashCollection; import org.eclipse.osee.framework.jdk.core.type.Named; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; @@ -219,8 +219,8 @@ public final class Artifacts { return sb.toString(); } - public static HashCollection<IOseeBranch, Artifact> getBranchArtifactMap(Collection<Artifact> artifacts) { - HashCollection<IOseeBranch, Artifact> branchMap = new HashCollection<>(); + public static HashCollection<BranchId, Artifact> getBranchArtifactMap(Collection<Artifact> artifacts) { + HashCollection<BranchId, Artifact> branchMap = new HashCollection<>(); for (Artifact artifact : artifacts) { branchMap.put(artifact.getBranch(), artifact); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifact.java index 66855dec8b7..0deb85d8d65 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifact.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifact.java @@ -12,7 +12,7 @@ package org.eclipse.osee.framework.skynet.core.utility; import java.util.ArrayList; import java.util.List; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; @@ -64,7 +64,7 @@ public class CsvArtifact { /** * Creates a new un-persisted CsvArtifact */ - public static CsvArtifact generateCsvArtifact(String staticId, String artifactName, String csvData, IOseeBranch branch) throws OseeCoreException { + public static CsvArtifact generateCsvArtifact(String staticId, String artifactName, String csvData, BranchId branch) throws OseeCoreException { Artifact artifact = ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, branch); artifact.setName(artifactName); artifact.setSoleAttributeValue(CoreAttributeTypes.Extension, "csv"); @@ -73,7 +73,7 @@ public class CsvArtifact { return new CsvArtifact(artifact); } - public static CsvArtifact getCsvArtifact(String staticId, IOseeBranch branch, boolean create) throws OseeCoreException { + public static CsvArtifact getCsvArtifact(String staticId, BranchId branch, boolean create) throws OseeCoreException { Artifact art = ArtifactCacheQuery.getSingletonArtifactByText(CoreArtifactTypes.GeneralDocument, CoreAttributeTypes.StaticId, staticId, branch, true); if (art != null) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ExcelXmlArtifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ExcelXmlArtifact.java index 04ce2d5bdae..7e543d680ed 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ExcelXmlArtifact.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ExcelXmlArtifact.java @@ -15,7 +15,7 @@ import java.io.Reader; import java.io.StringReader; import java.util.ArrayList; import java.util.List; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; @@ -34,13 +34,13 @@ import org.xml.sax.helpers.XMLReaderFactory; public class ExcelXmlArtifact implements RowProcessor { private final XMLReader xmlReader; private final String staticId; - private final IOseeBranch branch; + private final BranchId branch; private final ExcelSaxHandler excelHandler; private final List<Worksheet> workbook = new ArrayList<>(); private Worksheet currentWorksheet = null; private boolean initialized = false; - public ExcelXmlArtifact(boolean firstRowIsHeader, String staticId, IOseeBranch branch) throws SAXException { + public ExcelXmlArtifact(boolean firstRowIsHeader, String staticId, BranchId branch) throws SAXException { excelHandler = new ExcelSaxHandler(this, firstRowIsHeader, true); xmlReader = XMLReaderFactory.createXMLReader(); xmlReader.setContentHandler(excelHandler); |