summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lookup/AgentPath.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/AgentPath.java')
-rw-r--r--src/main/java/com/c2kernel/lookup/AgentPath.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/com/c2kernel/lookup/AgentPath.java b/src/main/java/com/c2kernel/lookup/AgentPath.java
index f6d6ca4..9dab6a6 100644
--- a/src/main/java/com/c2kernel/lookup/AgentPath.java
+++ b/src/main/java/com/c2kernel/lookup/AgentPath.java
@@ -64,9 +64,13 @@ public class AgentPath extends ItemPath
mAgentName = agentName;
}
- public AgentPath(String agentName) {
- super();
- mAgentName = agentName;
+ public AgentPath(String path) throws InvalidItemPathException {
+ super(path);
+ try {
+ findAgentName();
+ } catch (ObjectNotFoundException e) {
+ throw new InvalidAgentPathException();
+ }
}
public void setAgentName(String agentID)
@@ -135,7 +139,7 @@ public class AgentPath extends ItemPath
public static AgentPath fromUUIDString(String uuid) throws InvalidAgentPathException {
try {
- return new AgentPath(ItemPath.fromUUIDString(uuid));
+ return new AgentPath(new ItemPath(uuid));
} catch (InvalidItemPathException ex) {
throw new InvalidAgentPathException(ex.getMessage());
}