Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2013-10-25 15:28:30 +0000
committerjmisinco2013-11-04 17:05:54 +0000
commit1dd2453be862c689cd7506aa9ae195850c04ee6e (patch)
tree519c87c8202e17aa8d6d75cab7197437505103c1 /plugins/org.eclipse.osee.framework.access
parent63693d264eddca2a6c1ac2b08bd91fec05ab3e2d (diff)
downloadorg.eclipse.osee-1dd2453be862c689cd7506aa9ae195850c04ee6e.tar.gz
org.eclipse.osee-1dd2453be862c689cd7506aa9ae195850c04ee6e.tar.xz
org.eclipse.osee-1dd2453be862c689cd7506aa9ae195850c04ee6e.zip
feature[ats_ZQZZF]: Change identity service to return longs for local ids
Diffstat (limited to 'plugins/org.eclipse.osee.framework.access')
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessObject.java2
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java20
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/ArtifactAccessObject.java16
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java12
4 files changed, 25 insertions, 25 deletions
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessObject.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessObject.java
index 812ad13ece..e36eb9a3f2 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessObject.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/AccessObject.java
@@ -24,7 +24,7 @@ public abstract class AccessObject {
public abstract void removeFromDatabase(int subjectId) throws OseeCoreException;
- public abstract int getId();
+ public abstract long getId();
public static AccessObject getAccessObject(Object object) throws OseeCoreException {
if (object instanceof Artifact) {
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java
index cb76247805..f63f9eb8bc 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java
@@ -119,8 +119,8 @@ public class AccessControlService implements IAccessControlService {
private final HashCollection<Integer, Integer> groupToSubjectsCache = new HashCollection<Integer, Integer>(true); // <artId, branchId>
// branch_id, art_id, subject_id
- private final CompositeKeyHashMap<Integer, Integer, Integer> artifactLockCache =
- new CompositeKeyHashMap<Integer, Integer, Integer>();
+ private final CompositeKeyHashMap<Long, Integer, Integer> artifactLockCache =
+ new CompositeKeyHashMap<Long, Integer, Integer>();
private final HashCollection<Integer, PermissionEnum> subjectToPermissionCache =
new HashCollection<Integer, PermissionEnum>(true);
@@ -211,7 +211,7 @@ public class AccessControlService implements IAccessControlService {
while (chStmt.next()) {
Integer subjectId = chStmt.getInt("privilege_entity_id");
Integer branchId = chStmt.getInt("branch_id");
- int subjectArtifactTypeId = chStmt.getInt("art_type_id");
+ Long subjectArtifactTypeId = chStmt.getLong("art_type_id");
PermissionEnum permission = PermissionEnum.getPermission(chStmt.getInt("permission_id"));
BranchAccessObject branchAccessObject = BranchAccessObject.getBranchAccessObject(branchId);
@@ -236,8 +236,8 @@ public class AccessControlService implements IAccessControlService {
while (chStmt.next()) {
Integer subjectId = chStmt.getInt("privilege_entity_id");
Integer objectId = chStmt.getInt("art_id");
- Integer branchId = chStmt.getInt("branch_id");
- int subjectArtifactTypeId = chStmt.getInt("art_type_id");
+ Long branchId = chStmt.getLong("branch_id");
+ long subjectArtifactTypeId = chStmt.getLong("art_type_id");
PermissionEnum permission = PermissionEnum.getPermission(chStmt.getInt("permission_id"));
if (permission.equals(PermissionEnum.LOCK)) {
@@ -409,7 +409,7 @@ public class AccessControlService implements IAccessControlService {
Integer artId = artifact.getArtId();
Branch branch = artifact.getFullBranch();
- Integer branchId = branch.getId();
+ Long branchId = branch.getId();
// accessObject = accessObjectCache.get(artId, branchId);
accessObject = ArtifactAccessObject.getArtifactAccessObjectFromCache(artId, branch);
@@ -594,7 +594,7 @@ public class AccessControlService implements IAccessControlService {
}
private PermissionEnum getBranchPermission(IBasicArtifact<?> subject, Object object) throws OseeCoreException {
- int branchId = ((AccessObject) object).getId();
+ long branchId = ((AccessObject) object).getId();
Branch branch = BranchManager.getBranch(branchId);
return getBranchPermission(subject, branch);
@@ -652,7 +652,7 @@ public class AccessControlService implements IAccessControlService {
for (Artifact object : objects) {
Integer objectArtId = object.getArtId();
Integer subjectArtId = subject.getArtId();
- Integer objectBranchId = object.getFullBranch().getId();
+ Long objectBranchId = object.getFullBranch().getId();
if (!artifactLockCache.containsKey(objectBranchId, objectArtId)) {
AccessObject accessObject = getAccessObject(object);
@@ -676,7 +676,7 @@ public class AccessControlService implements IAccessControlService {
Set<Artifact> lockedArts = new HashSet<Artifact>();
for (Artifact object : objects) {
Integer objectArtId = object.getArtId();
- Integer branchId = object.getFullBranch().getId();
+ Long branchId = object.getFullBranch().getId();
if (artifactLockCache.containsKey(branchId, objectArtId) && canUnlockObject(object, subject)) {
AccessObject accessObject = getAccessObject(object);
@@ -735,7 +735,7 @@ public class AccessControlService implements IAccessControlService {
}
if (hasLock(object)) {
- int branchId = object.getFullBranch().getId();
+ long branchId = object.getFullBranch().getId();
hasAccess = artifactLockCache.get(branchId, object.getArtId()) == UserManager.getUser().getArtId();
}
return hasAccess;
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/ArtifactAccessObject.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/ArtifactAccessObject.java
index 8676592b83..b45b4d3e70 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/ArtifactAccessObject.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/ArtifactAccessObject.java
@@ -24,11 +24,11 @@ import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
public class ArtifactAccessObject extends AccessObject {
private final Integer artId;
- private final Integer branchId;
- private static final DoubleKeyHashMap<Integer, Integer, ArtifactAccessObject> cache =
- new DoubleKeyHashMap<Integer, Integer, ArtifactAccessObject>();
+ private final Long branchId;
+ private static final DoubleKeyHashMap<Integer, Long, ArtifactAccessObject> cache =
+ new DoubleKeyHashMap<Integer, Long, ArtifactAccessObject>();
- public ArtifactAccessObject(Integer artId, Integer branchId) {
+ public ArtifactAccessObject(Integer artId, Long branchId) {
super();
this.artId = artId;
this.branchId = branchId;
@@ -38,7 +38,7 @@ public class ArtifactAccessObject extends AccessObject {
public int hashCode() {
int result = 17;
result = 31 * result + artId;
- result = 31 * result + branchId;
+ result = 31 * result + branchId.hashCode();
return result;
}
@@ -47,7 +47,7 @@ public class ArtifactAccessObject extends AccessObject {
}
@Override
- public int getId() {
+ public long getId() {
return branchId;
}
@@ -70,7 +70,7 @@ public class ArtifactAccessObject extends AccessObject {
}
public static ArtifactAccessObject getArtifactAccessObject(Integer artId, IOseeBranch branch) throws OseeCoreException {
- int branchId = BranchManager.getBranchId(branch);
+ long branchId = BranchManager.getBranchId(branch);
ArtifactAccessObject accessObject = cache.get(artId, branchId);
if (accessObject == null) {
@@ -85,7 +85,7 @@ public class ArtifactAccessObject extends AccessObject {
}
public static AccessObject getArtifactAccessObjectFromCache(Integer artId2, IOseeBranch branch) throws OseeCoreException {
- int branchId2 = BranchManager.getBranchId(branch);
+ long branchId2 = BranchManager.getBranchId(branch);
return cache.get(artId2, branchId2);
}
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java
index 905211d5a1..0be3e9f5f9 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/data/BranchAccessObject.java
@@ -23,22 +23,22 @@ import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
* @author Jeff C. Phillips
*/
public class BranchAccessObject extends AccessObject {
- private final int branchId;
- private static final Map<Integer, BranchAccessObject> cache = new HashMap<Integer, BranchAccessObject>();
+ private final Long branchId;
+ private static final Map<Long, BranchAccessObject> cache = new HashMap<Long, BranchAccessObject>();
@Override
public int hashCode() {
int result = 17;
- result = 31 * result + branchId;
+ result = 31 * result + branchId.hashCode();
return result;
}
- public BranchAccessObject(int branchId) {
+ public BranchAccessObject(long branchId) {
this.branchId = branchId;
}
@Override
- public int getId() {
+ public long getId() {
return branchId;
}
@@ -65,7 +65,7 @@ public class BranchAccessObject extends AccessObject {
return null;
}
- public static BranchAccessObject getBranchAccessObject(int branchId) {
+ public static BranchAccessObject getBranchAccessObject(long branchId) {
BranchAccessObject branchAccessObject;
if (cache.containsKey(branchId)) {
branchAccessObject = cache.get(branchId);

Back to the top