summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lookup/DomainPath.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/lookup/DomainPath.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/lookup/DomainPath.java')
-rw-r--r--src/main/java/com/c2kernel/lookup/DomainPath.java20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/main/java/com/c2kernel/lookup/DomainPath.java b/src/main/java/com/c2kernel/lookup/DomainPath.java
index 706719e..c8ae751 100644
--- a/src/main/java/com/c2kernel/lookup/DomainPath.java
+++ b/src/main/java/com/c2kernel/lookup/DomainPath.java
@@ -12,7 +12,6 @@ package com.c2kernel.lookup;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.process.Gateway;
-import com.c2kernel.utils.Logger;
/**
@@ -47,7 +46,7 @@ public class DomainPath extends Path
super(path, Path.UNKNOWN);
}
- public DomainPath(String path, ItemPath entity) throws InvalidItemPathException
+ public DomainPath(String path, ItemPath entity)
{
super(path, Path.UNKNOWN);
setEntity(entity);
@@ -86,13 +85,13 @@ public class DomainPath extends Path
}
@Override
- public ItemPath getEntity() throws ObjectNotFoundException {
+ public ItemPath getItemPath() throws ObjectNotFoundException {
if (mType == UNKNOWN) { // must decide
checkType();
}
if (target == null)
- throw new ObjectNotFoundException("Path is a context", "");
+ throw new ObjectNotFoundException("Path "+toString()+" does not resolve to an Item", "");
return target;
}
@@ -108,7 +107,6 @@ public class DomainPath extends Path
try {
setEntity(Gateway.getLookup().resolvePath(this));
} catch (InvalidItemPathException ex) {
- Logger.error(ex);
mType = CONTEXT;
} catch (ObjectNotFoundException ex) {
mType = CONTEXT;
@@ -123,17 +121,5 @@ public class DomainPath extends Path
public String getName() {
return mPath[mPath.length-1];
}
-
- @Override
- public int getSysKey() {
- if (mType == UNKNOWN) { // must decide
- checkType();
- }
-
- if (mType == ENTITY) {
- return target.getSysKey();
- }
- else return INVALID;
- }
}