summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/collection/Parent2ChildCollection.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-09-09 12:13:21 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-09-09 12:13:21 +0200
commitda731d2bb81666b9c697d9099da632e7dfcdc0f7 (patch)
tree567693c3c48f3d15ecbb2dac4f9db03bb6e58c72 /src/main/java/com/c2kernel/collection/Parent2ChildCollection.java
parentae1e79e33fd30e3d8bcedbef8891a14a048276d7 (diff)
Replaced int sysKey Item identifier with UUID, which is now portable.
ItemPath objects are now used to identify Items throughout the kernel, replacing ints and Integers.
Diffstat (limited to 'src/main/java/com/c2kernel/collection/Parent2ChildCollection.java')
-rw-r--r--src/main/java/com/c2kernel/collection/Parent2ChildCollection.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/com/c2kernel/collection/Parent2ChildCollection.java b/src/main/java/com/c2kernel/collection/Parent2ChildCollection.java
index 814cca8..26aa451 100644
--- a/src/main/java/com/c2kernel/collection/Parent2ChildCollection.java
+++ b/src/main/java/com/c2kernel/collection/Parent2ChildCollection.java
@@ -3,6 +3,7 @@ package com.c2kernel.collection;
import java.util.Iterator;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.lookup.ItemPath;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.utils.CastorHashMap;
@@ -88,10 +89,10 @@ abstract public class Parent2ChildCollection<E extends CollectionMember> impleme
mMembers = newMembers;
}
- public boolean contains(int sysKey) {
+ public boolean contains(ItemPath itemPath) {
for (Object name : mMembers.list) {
CollectionMember element = (CollectionMember)name;
- if (element.getSystemKey() == sysKey)
+ if (element.getItemPath().equals(itemPath))
return true;
}
return false;
@@ -102,7 +103,7 @@ abstract public class Parent2ChildCollection<E extends CollectionMember> impleme
for (int i=0; i<size(); i++)
{
CollectionMember element = mMembers.list.get(i);
- if (element.getSystemKey() == -1)
+ if (element.getItemPath() == null)
return false;
}
return true;
@@ -124,7 +125,7 @@ abstract public class Parent2ChildCollection<E extends CollectionMember> impleme
}
@Override
- public abstract E addMember(int entityKey, CastorHashMap props, String classProps) throws MembershipException;
+ public abstract E addMember(ItemPath itemPath, CastorHashMap props, String classProps) throws MembershipException;
public boolean equals(Parent2ChildCollection<?> other) {
boolean same = mName.equals(other.getName()) && mURLInfo.equals(other.getURLInfo()) && size() == other.size();