diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-05-07 17:33:13 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-05-08 16:37:39 +0200 |
| commit | a1f0ecbb6a2bea6aa214322c412af2f3c5ce124b (patch) | |
| tree | 4d74229b6dd9cfd7ce054e06bf740b9a63a578d6 /src/main/java/com/c2kernel/collection/AggregationMember.java | |
| parent | 6dfa1bbe05a712174e937af89d5223e98d9d7d06 (diff) | |
Agent now extends Item, so they can have workflows. All traces of the
old 'Entity' superclasses should be removed, including proxies and
paths. Very large change, breaks API compatibility with CRISTAL 2.x.
Fixes #135
Diffstat (limited to 'src/main/java/com/c2kernel/collection/AggregationMember.java')
| -rw-r--r-- | src/main/java/com/c2kernel/collection/AggregationMember.java | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/main/java/com/c2kernel/collection/AggregationMember.java b/src/main/java/com/c2kernel/collection/AggregationMember.java index 49b9ab7..67e92ad 100644 --- a/src/main/java/com/c2kernel/collection/AggregationMember.java +++ b/src/main/java/com/c2kernel/collection/AggregationMember.java @@ -3,10 +3,10 @@ package com.c2kernel.collection; import java.util.StringTokenizer;
import com.c2kernel.common.ObjectNotFoundException;
-import com.c2kernel.entity.proxy.EntityProxy;
+import com.c2kernel.entity.proxy.ItemProxy;
import com.c2kernel.graph.model.GraphableVertex;
-import com.c2kernel.lookup.EntityPath;
-import com.c2kernel.lookup.InvalidEntityPathException;
+import com.c2kernel.lookup.ItemPath;
+import com.c2kernel.lookup.InvalidItemPathException;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.process.Gateway;
import com.c2kernel.property.Property;
@@ -24,11 +24,11 @@ import com.c2kernel.utils.Logger; public class AggregationMember extends GraphableVertex implements CollectionMember
{
- private int mEntityKey = -1;
- private EntityProxy mEntity = null;
+ private int mSystemKey = -1;
+ private ItemProxy mItem = null;
private Aggregation mCollection = null;
private String mClassProps = null;
- String entityName;
+ String ItemName;
/**************************************************************************
@@ -37,14 +37,14 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb public AggregationMember()
{
super();
- mEntityKey = -1;
+ mSystemKey = -1;
mCollection = null;
}
@Override
- public void setEntityKey(int entityKey) {
- mEntityKey = entityKey;
- entityName = null;
+ public void setSystemKey(int sysKey) {
+ mSystemKey = sysKey;
+ ItemName = null;
}
public void setCollection(Aggregation aggregation)
@@ -59,9 +59,9 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb }
@Override
- public int getEntityKey()
+ public int getSystemKey()
{
- return mEntityKey;
+ return mSystemKey;
}
public Aggregation getCollection()
@@ -76,9 +76,9 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb }
@Override
- public void assignEntity(int entityKey) throws MembershipException
+ public void assignItem(int sysKey) throws MembershipException
{
- if (entityKey > -1) {
+ if (sysKey > -1) {
if (mClassProps == null || getProperties() == null)
throw new MembershipException("ClassProps not yet set. Cannot check membership validity.");
@@ -89,11 +89,11 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb String aClassProp = sub.nextToken();
try {
String memberValue = (String)getProperties().get(aClassProp);
- Property entityProperty = (Property)Gateway.getStorage().get(entityKey, ClusterStorage.PROPERTY+"/"+aClassProp, null);
- if (entityProperty == null)
- throw new MembershipException("Property "+aClassProp+ " does not exist for entityKey=" + entityKey );
- if (entityProperty.getValue() == null || !entityProperty.getValue().equalsIgnoreCase(memberValue))
- throw new MembershipException("Value of mandatory prop "+aClassProp+" does not match: " + entityProperty.getValue()+"!="+memberValue);
+ Property ItemProperty = (Property)Gateway.getStorage().get(sysKey, ClusterStorage.PROPERTY+"/"+aClassProp, null);
+ if (ItemProperty == null)
+ throw new MembershipException("Property "+aClassProp+ " does not exist for sysKey=" + sysKey );
+ if (ItemProperty.getValue() == null || !ItemProperty.getValue().equalsIgnoreCase(memberValue))
+ throw new MembershipException("Value of mandatory prop "+aClassProp+" does not match: " + ItemProperty.getValue()+"!="+memberValue);
}
catch (MembershipException ex) {
throw ex;
@@ -106,46 +106,46 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb }
}
- mEntityKey = entityKey;
- mEntity = null;
- entityName = null;
+ mSystemKey = sysKey;
+ mItem = null;
+ ItemName = null;
}
@Override
- public void clearEntity() {
- mEntityKey = -1;
- mEntity = null;
+ public void clearItem() {
+ mSystemKey = -1;
+ mItem = null;
}
@Override
- public EntityProxy resolveEntity() throws ObjectNotFoundException {
- if (mEntity == null) {
+ public ItemProxy resolveItem() throws ObjectNotFoundException {
+ if (mItem == null) {
try {
- EntityPath path = new EntityPath(mEntityKey);
- mEntity = Gateway.getProxyManager().getProxy(path);
- } catch (InvalidEntityPathException ex) {
+ ItemPath path = new ItemPath(mSystemKey);
+ mItem = Gateway.getProxyManager().getProxy(path);
+ } catch (InvalidItemPathException ex) {
throw new ObjectNotFoundException("No member defined", "");
}
}
- return mEntity;
+ return mItem;
}
- public String getEntityName() {
- if (entityName == null) {
- if (mEntityKey > -1) {
+ public String getItemName() {
+ if (ItemName == null) {
+ if (mSystemKey > -1) {
try {
- entityName = resolveEntity().getName();
+ ItemName = resolveItem().getName();
} catch (ObjectNotFoundException ex) {
Logger.error(ex);
- entityName = "Error ("+mEntityKey+")";
+ ItemName = "Error ("+mSystemKey+")";
}
}
else
- entityName = "Empty";
+ ItemName = "Empty";
}
- return entityName;
+ return ItemName;
}
}
|
