|
From: <pe...@us...> - 2003-09-22 19:24:37
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/cache
In directory sc8-pr-cvs1:/tmp/cvs-serv4908/src/java/org/neuclear/id/cache
Modified Files:
NSCache.java
Log Message:
More fixes throughout to problems caused by renaming.
Index: NSCache.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/cache/NSCache.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** NSCache.java 19 Sep 2003 14:41:09 -0000 1.1.1.1
--- NSCache.java 22 Sep 2003 19:24:01 -0000 1.2
***************
*** 5,9 ****
import org.neuclear.id.NSTools;
import org.neuclear.id.NameSpace;
! import org.neuclear.utils.NeudistException;
/**
* The Idea of the NSCache is to have a quick cache of verified public NameSpaces. This is not stored, but is created from scratch
--- 5,10 ----
import org.neuclear.id.NSTools;
import org.neuclear.id.NameSpace;
! import org.neudist.utils.NeudistException;
!
/**
* The Idea of the NSCache is to have a quick cache of verified public NameSpaces. This is not stored, but is created from scratch
***************
*** 14,18 ****
public final class NSCache {
private NSCache() {
! spaces=new Cache();
}
--- 15,19 ----
public final class NSCache {
private NSCache() {
! spaces = new Cache();
}
***************
*** 20,31 ****
return new NSCache();
}
/**
! * Attempts to get a verified PublicKey for the given name from the cache
! * @param name Fully Normalised name
! * @return a valid NameSpace object if found otherwise null
! */
! public NameSpace fetchCached(String name) {
try { // I dont like the way it forces me to catch this. I need to rewrite it.
! return (NameSpace)spaces.fetch(name);
} catch (NoSuchElement noSuchElement) {
return null;
--- 21,33 ----
return new NSCache();
}
+
/**
! * Attempts to get a verified PublicKey for the given name from the cache
! * @param name Fully Normalised name
! * @return a valid NameSpace object if found otherwise null
! */
! public NameSpace fetchCached(String name) {
try { // I dont like the way it forces me to catch this. I need to rewrite it.
! return (NameSpace) spaces.fetch(name);
} catch (NoSuchElement noSuchElement) {
return null;
***************
*** 33,43 ****
}
! public void cache(NameSpace ns) throws NeudistException{
// Only store if it's parent is already here
! String parentName=NSTools.getParentNSURI(ns.getName());
! if ((fetchCached(parentName)!=null)||(parentName.equals("neu://"))){
! spaces.put(ns.getName(),ns);
}
}
private final Cache spaces;
}
--- 35,46 ----
}
! public void cache(NameSpace ns) throws NeudistException {
// Only store if it's parent is already here
! String parentName = NSTools.getParentNSURI(ns.getName());
! if ((fetchCached(parentName) != null) || (parentName.equals("neu://"))) {
! spaces.put(ns.getName(), ns);
}
}
+
private final Cache spaces;
}
|