summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/collection/AggregationMember.java
diff options
context:
space:
mode:
Diffstat (limited to 'source/com/c2kernel/collection/AggregationMember.java')
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/collection/AggregationMember.java59
1 files changed, 33 insertions, 26 deletions
diff --git a/source/com/c2kernel/collection/AggregationMember.java b/source/com/c2kernel/collection/AggregationMember.java
index 753f503..d383f02 100755..100644
--- a/source/com/c2kernel/collection/AggregationMember.java
+++ b/source/com/c2kernel/collection/AggregationMember.java
@@ -27,8 +27,8 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb
{
private int mEntityKey = -1;
- private EntityProxy mEntity = null;
- private Collection mCollection = null;
+ private EntityProxy mEntity = null;
+ private Aggregation mCollection = null;
private String mClassProps = null;
String entityName;
Image image;
@@ -44,50 +44,55 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb
mCollection = null;
}
- public void setEntityKey(int entityKey) {
- mEntityKey = entityKey;
+ @Override
+ public void setEntityKey(int entityKey) {
+ mEntityKey = entityKey;
entityName = null;
}
-
- public void setCollection(Collection aggregation)
+
+ public void setCollection(Aggregation aggregation)
{
mCollection = aggregation;
}
- public void setClassProps(String props)
+ @Override
+ public void setClassProps(String props)
{
mClassProps = props;
}
- public int getEntityKey()
+ @Override
+ public int getEntityKey()
{
return mEntityKey;
}
- public Collection getCollection()
+ public Aggregation getCollection()
{
return mCollection;
}
- public String getClassProps()
+ @Override
+ public String getClassProps()
{
return mClassProps;
}
- public void assignEntity(int entityKey) throws MembershipException
+ @Override
+ public void assignEntity(int entityKey) throws MembershipException
{
if (entityKey > -1) {
if (mClassProps == null || getProperties() == null)
throw new MembershipException("ClassProps not yet set. Cannot check membership validity.");
-
+
//for each mandatory prop check if its in the member property and has the matching value
StringTokenizer sub = new StringTokenizer(mClassProps, ",");
while (sub.hasMoreTokens())
{
- String aClassProp = sub.nextToken();
- try {
- String memberValue = (String)getProperties().get(aClassProp);
- Property entityProperty = (Property)Gateway.getStorage().get(entityKey, ClusterStorage.PROPERTY+"/"+aClassProp, null);
+ 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))
@@ -96,25 +101,27 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb
catch (MembershipException ex) {
throw ex;
}
- catch (Exception ex)
+ catch (Exception ex)
{
Logger.error(ex);
throw new MembershipException("Error checking properties");
}
- }
+ }
}
-
+
mEntityKey = entityKey;
mEntity = null;
entityName = null;
}
-
- public void clearEntity() {
+
+ @Override
+ public void clearEntity() {
mEntityKey = -1;
mEntity = null;
}
-
- public EntityProxy resolveEntity() throws ObjectNotFoundException {
+
+ @Override
+ public EntityProxy resolveEntity() throws ObjectNotFoundException {
if (mEntity == null) {
try {
EntityPath path = new EntityPath(mEntityKey);
@@ -124,9 +131,9 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb
}
}
return mEntity;
-
+
}
-
+
public Image getImage() {
if (image == null) {
image = Resource.getImageResource("typeicons/"+getProperties().get("Type")+"_16.png").getImage();
@@ -147,7 +154,7 @@ public class AggregationMember extends GraphableVertex implements CollectionMemb
else
entityName = "Empty";
}
-
+
return entityName;
}