summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/entity/imports
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-09-22 16:01:18 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-09-22 16:02:11 +0200
commita7cefce58cdb0f7f2d0868a1d5ee2f24f3890646 (patch)
tree89c30cdb92d7edae5d735c2d6ef45f890cc7be82 /src/main/java/com/c2kernel/entity/imports
parentcfa70de9ec7745356ed00c1502d5bd55eee14181 (diff)
ItemPath.fromUUIDString unnecessary as ItemPath(String) supports both
plain UUIDs and an /entity prefix. Tightened that up and removed the fromUUIDString method for a simpler API. Also switched AgentPath(String) to a path argument for consistency. New AgentPaths should be created with AgentPath(new ItemPath(), String) instead.
Diffstat (limited to 'src/main/java/com/c2kernel/entity/imports')
-rw-r--r--src/main/java/com/c2kernel/entity/imports/ImportAgent.java2
-rw-r--r--src/main/java/com/c2kernel/entity/imports/ImportAggregation.java6
-rw-r--r--src/main/java/com/c2kernel/entity/imports/ImportDependency.java4
3 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportAgent.java b/src/main/java/com/c2kernel/entity/imports/ImportAgent.java
index 2bbd307..52546a6 100644
--- a/src/main/java/com/c2kernel/entity/imports/ImportAgent.java
+++ b/src/main/java/com/c2kernel/entity/imports/ImportAgent.java
@@ -64,7 +64,7 @@ public class ImportAgent extends ModuleImport implements java.io.Serializable {
AgentPath existAgent = Gateway.getLookup().getAgentPath(name);
itemPath = existAgent;
} catch (ObjectNotFoundException ex) {
- itemPath = new AgentPath(name);
+ itemPath = new AgentPath(new ItemPath(), name);
}
}
return itemPath;
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java b/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java
index 2d8f0a2..46cb0b6 100644
--- a/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java
+++ b/src/main/java/com/c2kernel/entity/imports/ImportAggregation.java
@@ -36,7 +36,7 @@ public class ImportAggregation implements java.io.Serializable {
if (thisMem.itemDescriptionPath != null && thisMem.itemDescriptionPath.length()>0) {
ItemPath itemPath;
try {
- itemPath = ItemPath.fromUUIDString(thisMem.itemDescriptionPath);
+ itemPath = new ItemPath(thisMem.itemDescriptionPath);
} catch (InvalidItemPathException ex) {
itemPath = new DomainPath(thisMem.itemDescriptionPath).getItemPath();
}
@@ -50,12 +50,10 @@ public class ImportAggregation implements java.io.Serializable {
if (thisMem.itemPath != null && thisMem.itemPath.length()>0) {
ItemPath itemPath;
try {
- itemPath = ItemPath.fromUUIDString(thisMem.itemPath);
+ itemPath = new ItemPath(thisMem.itemPath);
} catch (InvalidItemPathException ex) {
itemPath = new DomainPath(thisMem.itemPath).getItemPath();
}
- if (itemPath == null)
- throw new MembershipException("Cannot find "+thisMem.itemPath+" specified for collection.");
newAgg.addMember(itemPath, thisMem.props, classProps.toString(), new GraphPoint(thisMem.geometry.x, thisMem.geometry.y), thisMem.geometry.width, thisMem.geometry.height);
}
}
diff --git a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java
index 87e6b11..3fafd6f 100644
--- a/src/main/java/com/c2kernel/entity/imports/ImportDependency.java
+++ b/src/main/java/com/c2kernel/entity/imports/ImportDependency.java
@@ -58,13 +58,11 @@ public class ImportDependency implements java.io.Serializable {
for (ImportDependencyMember thisMem : dependencyMemberList) {
ItemPath itemPath;
try {
- itemPath = ItemPath.fromUUIDString(thisMem.itemPath);
+ itemPath = new ItemPath(thisMem.itemPath);
} catch (InvalidItemPathException ex) {
itemPath = new DomainPath(thisMem.itemPath).getItemPath();
}
- if (itemPath == null)
- throw new MembershipException("Cannot find "+thisMem.itemPath+" specified for collection.");
com.c2kernel.collection.DependencyMember newDepMem = newDep.addMember(itemPath);
newDepMem.getProperties().putAll(thisMem.props);
}