|
From: Pelle B. <pe...@us...> - 2004-04-02 23:17:15
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4299/src/java/org/neuclear/id/resolver Modified Files: Resolver.java Log Message: Got TransferOrder and Builder working with their test cases. Working on TransferReceipt which is the first embedded receipt. This is causing some problems at the moment. Index: Resolver.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver/Resolver.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Resolver.java 2 Apr 2004 17:33:31 -0000 1.2 --- Resolver.java 2 Apr 2004 23:05:02 -0000 1.3 *************** *** 51,79 **** */ public final static SignedNamedObject resolve(final String name) throws NameResolutionException, InvalidNamedObjectException { - SignedNamedObject obj = NSCACHE.fetchCached(name); - if (obj != null) - return obj; ! /* ! if (name.startsWith("neu:")) { ! ! final String parentname = NSTools.getSignatoryURI(name); ! ! String store = NSTools.isHttpScheme(name); ! if (store == null) { ! final Identity parent = resolveIdentity(parentname); ! store = parent.getRepository(); ! } ! try { ! obj = Source.getInstance().fetch(store, name); ! } catch (SourceException e) { ! throw new NameResolutionException(name,e.getLocalizedMessage()); ! } ! if (obj == null) ! throw new NameResolutionException(name); ! NSCACHE.cache(obj); ! return obj; //This may not be null } ! */ try { --- 51,63 ---- */ public final static SignedNamedObject resolve(final String name) throws NameResolutionException, InvalidNamedObjectException { ! // If name is a hash check the cache ! if (name.length() == 32 || name.length() == 37 || name.length() == 38 || name.length() == 69) { ! System.out.println("Fetching Cached"); ! SignedNamedObject obj = NSCACHE.fetchCached(cleanName(name)); ! if (obj != null) ! return obj; } ! try { *************** *** 96,100 **** private static String cleanName(String name) { ! if (name.startsWith("sha:")) return name.substring(4); --- 80,88 ---- private static String cleanName(String name) { ! if (name.charAt(36) == '!') ! return name.substring(37); ! if (name.startsWith("sha1:")) ! return name.substring(5); ! if (name.startsWith("neu:")) return name.substring(4); |