|
From: Pelle B. <pe...@us...> - 2004-04-02 23:16:48
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4149/src/java/org/neuclear/asset/orders Modified Files: TransferGlobals.java TransferOrder.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: TransferOrder.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders/TransferOrder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TransferOrder.java 21 Jan 2004 23:41:02 -0000 1.6 --- TransferOrder.java 2 Apr 2004 23:04:36 -0000 1.7 *************** *** 4,8 **** import org.neuclear.asset.contracts.Asset; import org.neuclear.asset.contracts.AssetGlobals; ! import org.neuclear.id.*; /** --- 4,11 ---- import org.neuclear.asset.contracts.Asset; import org.neuclear.asset.contracts.AssetGlobals; ! import org.neuclear.id.InvalidNamedObjectException; ! import org.neuclear.id.NamedObjectReader; ! import org.neuclear.id.SignedNamedCore; ! import org.neuclear.id.SignedNamedObject; /** *************** *** 13,29 **** public final class TransferOrder extends AssetTransactionContract { ! private TransferOrder(final SignedNamedCore core, final Asset asset, final Identity recipient, final Value amount, final String comment) { super(core, asset); this.amount = amount; this.comment = comment; ! this.recipient=recipient; } ! public final Identity getRecipient() { return recipient; } public final Value getAmount() { ! return amount; ! } public final String getComment() { --- 16,33 ---- public final class TransferOrder extends AssetTransactionContract { ! private TransferOrder(final SignedNamedCore core, final Asset asset, final String recipient, final Value amount, final String comment) { super(core, asset); this.amount = amount; this.comment = comment; ! this.recipient = recipient; } ! public final String getRecipient() { return recipient; } + public final Value getAmount() { ! return amount; ! } public final String getComment() { *************** *** 31,35 **** } ! private final Identity recipient; private final Value amount; --- 35,39 ---- } ! private final String recipient; private final Value amount; *************** *** 45,51 **** public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { if (!elem.getNamespace().getURI().equals(TransferGlobals.XFER_NSURI)) ! throw new InvalidNamedObjectException(core.getName(),"Not in XML NameSpace: "+AssetGlobals.NS_ASSET.getURI()); if (!elem.getName().equals(TransferGlobals.XFER_TAGNAME)) ! throw new InvalidNamedObjectException(core.getName(),"Incorrect XML Tagname for reader: "+TransferGlobals.XFER_TAGNAME); return new TransferOrder(core, --- 49,55 ---- public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { if (!elem.getNamespace().getURI().equals(TransferGlobals.XFER_NSURI)) ! throw new InvalidNamedObjectException(core.getName(), "Not in XML NameSpace: " + AssetGlobals.NS_ASSET.getURI()); if (!elem.getName().equals(TransferGlobals.XFER_TAGNAME)) ! throw new InvalidNamedObjectException(core.getName(), "Incorrect XML Tagname for reader: " + TransferGlobals.XFER_TAGNAME); return new TransferOrder(core, *************** *** 53,58 **** TransferGlobals.parseRecipientTag(elem), TransferGlobals.parseValueTag(elem), ! TransferGlobals.parseCommentElement(elem) ! ); } } --- 57,61 ---- TransferGlobals.parseRecipientTag(elem), TransferGlobals.parseValueTag(elem), ! TransferGlobals.parseCommentElement(elem)); } } Index: TransferGlobals.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders/TransferGlobals.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TransferGlobals.java 1 Apr 2004 23:18:32 -0000 1.8 --- TransferGlobals.java 2 Apr 2004 23:04:36 -0000 1.9 *************** *** 6,10 **** import org.neuclear.commons.Utility; import org.neuclear.commons.time.TimeTools; - import org.neuclear.id.Identity; import org.neuclear.id.InvalidNamedObjectException; import org.neuclear.id.NameResolutionException; --- 6,9 ---- *************** *** 36,39 **** --- 35,42 ---- $Id$ $Log$ + Revision 1.9 2004/04/02 23:04:36 pelle + 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. + Revision 1.8 2004/04/01 23:18:32 pelle Split Identity into Signatory and Identity class. *************** *** 226,236 **** } ! public static final Identity parseRecipientTag(Element elem) throws InvalidNamedObjectException { final String name = getElementValue(elem, RECIPIENT_TAG); ! try { ! return Resolver.resolveIdentity(name); ! } catch (NameResolutionException e) { ! throw new InvalidNamedObjectException(name, e); ! } } --- 229,235 ---- } ! public static final String parseRecipientTag(Element elem) throws InvalidNamedObjectException { final String name = getElementValue(elem, RECIPIENT_TAG); ! return name; } |