From da731d2bb81666b9c697d9099da632e7dfcdc0f7 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 9 Sep 2014 12:13:21 +0200 Subject: 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. --- src/main/java/com/c2kernel/lookup/DomainPath.java | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/main/java/com/c2kernel/lookup/DomainPath.java') 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; - } } -- cgit v1.2.3