|
From: <pe...@us...> - 2004-02-18 00:22:43
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29255/src/java/org/neuclear/asset/contracts Modified Files: Asset.java Log Message: Many, many clean ups. I've readded Targets in a new method. Gotten rid of NamedObjectBuilder and revamped Identity and Resolvers Index: Asset.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/Asset.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Asset.java 21 Jan 2004 23:41:02 -0000 1.13 --- Asset.java 18 Feb 2004 00:13:30 -0000 1.14 *************** *** 2,9 **** import org.dom4j.Element; - import org.neuclear.commons.NeuClearException; import org.neuclear.commons.Utility; import org.neuclear.id.*; ! import org.neuclear.senders.Sender; import org.neuclear.xml.xmlsec.KeyInfo; import org.neuclear.xml.xmlsec.XMLSecTools; --- 2,8 ---- import org.dom4j.Element; import org.neuclear.commons.Utility; import org.neuclear.id.*; ! import org.neuclear.id.targets.Targets; import org.neuclear.xml.xmlsec.KeyInfo; import org.neuclear.xml.xmlsec.XMLSecTools; *************** *** 32,35 **** --- 31,38 ---- $Id$ $Log$ + Revision 1.14 2004/02/18 00:13:30 pelle + Many, many clean ups. I've readded Targets in a new method. + Gotten rid of NamedObjectBuilder and revamped Identity and Resolvers + Revision 1.13 2004/01/21 23:41:02 pelle Started the unit tests for the new payment message format. *************** *** 120,126 **** */ public final class Asset extends Identity { ! protected Asset(final SignedNamedCore core, final String serviceurl,final PublicKey pub, final int decimal, final double minimumTransaction) { ! super(core, pub); ! this.serviceurl=serviceurl; this.decimal = decimal; this.multiplier = (int) Math.round(Math.pow(10, -decimal)); --- 123,128 ---- */ public final class Asset extends Identity { ! protected Asset(final SignedNamedCore core, final Targets targets,final PublicKey pub, final int decimal, final double minimumTransaction) { ! super(core, pub,null,targets); //Web services dont have signing urls this.decimal = decimal; this.multiplier = (int) Math.round(Math.pow(10, -decimal)); *************** *** 128,131 **** --- 130,134 ---- } + /* //TODO drop. This is for testing purposes only public Asset(final String serviceurl,final PublicKey pub, final int decimal, final double minimumTransaction) { *************** *** 136,139 **** --- 139,143 ---- this.minimumTransaction = minimumTransaction; } + */ /** *************** *** 161,171 **** } - public final String getServiceurl() { - return serviceurl; - } - - public final SignedNamedObject send(SignedNamedObject object) throws NeuClearException { - return Sender.quickSend(serviceurl,object); - } public static final class Reader implements NamedObjectReader { --- 165,168 ---- *************** *** 179,183 **** if (!elem.getNamespace().equals(AssetGlobals.NS_ASSET)) throw new InvalidNamedObjectException(core.getName(),"Not in XML NameSpace: "+AssetGlobals.NS_ASSET.getURI()); - final String serviceurl = elem.attributeValue(createNEUIDQName("serviceurl")); final Element allowElement = InvalidNamedObjectException.assertContainsElementQName(core,elem,createNEUIDQName("allow")); --- 176,179 ---- *************** *** 189,193 **** final String min = elem.attributeValue("minimumxact"); final double minimum = (!Utility.isEmpty(min)) ? Double.parseDouble(min) : 0; ! return new Asset(core, serviceurl, pub, decimal, minimum); } catch (XMLSecurityException e) { throw new InvalidNamedObjectException(core.getName(),e); --- 185,190 ---- final String min = elem.attributeValue("minimumxact"); final double minimum = (!Utility.isEmpty(min)) ? Double.parseDouble(min) : 0; ! final Targets targets=Targets.parseList(elem); ! return new Asset(core, targets, pub, decimal, minimum); } catch (XMLSecurityException e) { throw new InvalidNamedObjectException(core.getName(),e); *************** *** 198,202 **** } - private final String serviceurl; private final int decimal; private final int multiplier; --- 195,198 ---- |