summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/lookup/DomainPath.java
diff options
context:
space:
mode:
authorabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
committerabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
commit0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch)
tree5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/lookup/DomainPath.java
parent036cbdba66f804743c4c838ed598d6972c4b3e17 (diff)
More code cleanup:
Refactored Entity Proxy Subscription to handle generics better Rewrote RemoteMap to use TreeMap instead of the internal array for order. It now sorts its keys by number if they parse, else as strings. Removed a no-longer-in-progress outcome form class
Diffstat (limited to 'source/com/c2kernel/lookup/DomainPath.java')
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lookup/DomainPath.java43
1 files changed, 24 insertions, 19 deletions
diff --git a/source/com/c2kernel/lookup/DomainPath.java b/source/com/c2kernel/lookup/DomainPath.java
index ad314ee..ce849ce 100755..100644
--- a/source/com/c2kernel/lookup/DomainPath.java
+++ b/source/com/c2kernel/lookup/DomainPath.java
@@ -30,15 +30,15 @@ public class DomainPath extends Path
public DomainPath()
{
- super(Path.UNKNOWN);
+ super(Path.UNKNOWN);
}
public DomainPath(short type)
{
- super();
+ super();
mType = type;
}
-
+
public DomainPath(String[] path)
{
super(path, Path.UNKNOWN);
@@ -54,7 +54,7 @@ public class DomainPath extends Path
super(path, Path.UNKNOWN);
setEntity(entity);
}
-
+
public DomainPath(DomainPath parent, String child) {
super(parent, child);
}
@@ -62,47 +62,50 @@ public class DomainPath extends Path
/* the root of domain paths is /domain
* clearly
*/
- public String getRoot() {
+ @Override
+ public String getRoot() {
return "domain";
}
-
+
public DomainPath getParent() {
if (mPath.length == 0)
return null;
-
+
String[] parentPath = new String[mPath.length-1];
System.arraycopy(mPath, 0, parentPath, 0, parentPath.length);
return new DomainPath(parentPath);
}
-
+
public void setEntity(EntityPath newTarget) {
if (newTarget == null) { // clear
target = null;
mType = Path.CONTEXT;
return;
}
-
+
target = newTarget;
mType = Path.ENTITY;
}
-
- public EntityPath getEntity() throws ObjectNotFoundException {
+
+ @Override
+ public EntityPath getEntity() throws ObjectNotFoundException {
if (mType == UNKNOWN) { // must decide
checkType();
}
-
+
if (target == null)
throw new ObjectNotFoundException("Path is a context", "");
return target;
}
-
- public short getType() {
+
+ @Override
+ public short getType() {
if (mType == UNKNOWN) { // must decide
checkType();
}
return mType;
}
-
+
public void checkType() {
try {
setEntity(Gateway.getLDAPLookup().resolvePath(this));
@@ -114,7 +117,7 @@ public class DomainPath extends Path
}
}
-
+
/**
* Retrieves the domkey of the path
* @return the last path component;
@@ -123,18 +126,20 @@ public class DomainPath extends Path
return mPath[mPath.length-1];
}
- public int getSysKey() {
+ @Override
+ public int getSysKey() {
if (mType == UNKNOWN) { // must decide
checkType();
}
-
+
if (mType == ENTITY) {
return target.getSysKey();
}
else return INVALID;
}
- public LDAPAttributeSet createAttributeSet() {
+ @Override
+ public LDAPAttributeSet createAttributeSet() {
LDAPAttributeSet attrs = new LDAPAttributeSet();
attrs.add(new LDAPAttribute("cn",getName()));
if (getType() == ENTITY) {