Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268/src/java/org/neuclear/asset/orders Modified Files: AssetTransactionContract.java TransferGlobals.java TransferOrder.java Added Files: IssueOrder.java IssueReceipt.java Log Message: Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. Added Issuance support to the Asset and Audit Controllers. Implemented access control for complete and cancel exchange orders. Index: TransferOrder.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders/TransferOrder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TransferOrder.java 5 Apr 2004 16:31:41 -0000 1.8 --- TransferOrder.java 6 Apr 2004 16:24:34 -0000 1.9 *************** *** 2,7 **** import org.dom4j.Element; import org.neuclear.asset.contracts.AssetGlobals; ! import org.neuclear.id.*; /** --- 2,11 ---- import org.dom4j.Element; + 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; /** *************** *** 12,16 **** public final class TransferOrder extends AssetTransactionContract { ! private TransferOrder(final SignedNamedCore core, final Service asset, final String recipient, final Value amount, final String comment) { super(core, asset); this.amount = amount; --- 16,20 ---- 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; --- NEW FILE: IssueReceipt.java --- package org.neuclear.asset.orders; import org.dom4j.Element; import org.neuclear.id.InvalidNamedObjectException; import org.neuclear.id.NamedObjectReader; import org.neuclear.id.SignedNamedCore; import org.neuclear.id.SignedNamedObject; import java.sql.Timestamp; import java.util.Date; /** * User: pelleb * Date: Jul 21, 2003 * Time: 5:37:10 PM */ public class IssueReceipt extends AssetTransactionContract { private IssueReceipt(final SignedNamedCore core, final IssueOrder order, final Date valuetime) { super(core, order.getAsset()); this.valuetime = valuetime.getTime(); this.order = order; } public final IssueOrder getOrder() { return order; } public final Date getValueTime() { return new Timestamp(valuetime); } private final long valuetime; private final IssueOrder order; public static final class Reader implements NamedObjectReader { /** * Read object from Element and fill in its details * * @param elem * @return */ 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: " + TransferGlobals.XFER_NSURI); if (!elem.getName().equals(TransferGlobals.ISSUE_RCPT_TAGNAME)) throw new InvalidNamedObjectException(core.getName(), "Incorrect XML Tagname for reader: " + TransferGlobals.ISSUE_RCPT_TAGNAME); return new IssueReceipt(core, (IssueOrder) TransferGlobals.parseEmbedded(elem, TransferGlobals.createQName(TransferGlobals.ISSUE_TAGNAME)), TransferGlobals.parseValueTimeElement(elem)); } } } Index: TransferGlobals.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders/TransferGlobals.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TransferGlobals.java 5 Apr 2004 16:31:41 -0000 1.10 --- TransferGlobals.java 6 Apr 2004 16:24:34 -0000 1.11 *************** *** 35,38 **** --- 35,43 ---- $Id$ $Log$ + Revision 1.11 2004/04/06 16:24:34 pelle + Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. + Added Issuance support to the Asset and Audit Controllers. + Implemented access control for complete and cancel exchange orders. + Revision 1.10 2004/04/05 16:31:41 pelle Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. *************** *** 194,197 **** --- 199,204 ---- VerifyingReader.getInstance().registerReader(TransferGlobals.XFER_TAGNAME, new TransferOrder.Reader()); VerifyingReader.getInstance().registerReader(TransferGlobals.XFER_RCPT_TAGNAME, new TransferReceipt.Reader()); + VerifyingReader.getInstance().registerReader(TransferGlobals.ISSUE_TAGNAME, new IssueOrder.Reader()); + VerifyingReader.getInstance().registerReader(TransferGlobals.ISSUE_RCPT_TAGNAME, new IssueReceipt.Reader()); } *************** *** 290,293 **** --- 297,302 ---- public static final String XFER_TAGNAME = "TransferOrder"; public static final String XFER_RCPT_TAGNAME = "TransferReceipt"; + public static final String ISSUE_TAGNAME = "IssueOrder"; + public static final String ISSUE_RCPT_TAGNAME = "IssueReceipt"; public static final String XFER_NSPREFIX = "xfer"; public static final String XFER_NSURI = "http://neuclear.org/neu/xfer.xsd"; --- NEW FILE: IssueOrder.java --- package org.neuclear.asset.orders; import org.dom4j.Element; 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; /** * User: pelleb * Date: Jul 21, 2003 * Time: 5:35:26 PM */ public final class IssueOrder extends AssetTransactionContract { private IssueOrder(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() { return comment; } private final String recipient; private final Value amount; private final String comment; public static final class Reader implements NamedObjectReader { /** * Read object from Element and fill in its details * * @param elem * @return */ 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.ISSUE_TAGNAME)) throw new InvalidNamedObjectException(core.getName(), "Incorrect XML Tagname for reader: " + TransferGlobals.XFER_TAGNAME); final Asset asset = TransferGlobals.parseAssetTag(elem); if (asset.getIssuerKey() != null && core.getSignatory().getPublicKey().equals(asset.getIssuerKey())) return new IssueOrder(core, asset, TransferGlobals.parseRecipientTag(elem), TransferGlobals.parseValueTag(elem), TransferGlobals.parseCommentElement(elem)); throw new InvalidNamedObjectException(core.getSignatory().getName() + " is not the issuer for asset: " + asset.getName()); } } } Index: AssetTransactionContract.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/orders/AssetTransactionContract.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AssetTransactionContract.java 5 Apr 2004 16:31:41 -0000 1.3 --- AssetTransactionContract.java 6 Apr 2004 16:24:34 -0000 1.4 *************** *** 1,5 **** package org.neuclear.asset.orders; ! import org.neuclear.id.Service; import org.neuclear.id.SignedNamedCore; import org.neuclear.id.SignedNamedObject; --- 1,5 ---- package org.neuclear.asset.orders; ! import org.neuclear.asset.contracts.Asset; import org.neuclear.id.SignedNamedCore; import org.neuclear.id.SignedNamedObject; *************** *** 12,18 **** * $Id$ * $Log$ * Revision 1.3 2004/04/05 16:31:41 pelle * Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. ! * * Revision 1.2 2004/01/10 00:00:45 pelle * Implemented new Schema for Transfer* --- 12,23 ---- * $Id$ * $Log$ + * Revision 1.4 2004/04/06 16:24:34 pelle + * Added two new Data Objects IssuerOrder and IssueReceipt for managing the issuance process. + * Added Issuance support to the Asset and Audit Controllers. + * Implemented access control for complete and cancel exchange orders. + * * Revision 1.3 2004/04/05 16:31:41 pelle * Created new ServiceBuilder class for creating services. A service is an identity that has a seperate service URL and Service Public Key. ! * <p/> * Revision 1.2 2004/01/10 00:00:45 pelle * Implemented new Schema for Transfer* *************** *** 90,96 **** */ public abstract class AssetTransactionContract extends SignedNamedObject { ! private final Service asset; ! protected AssetTransactionContract(final SignedNamedCore core, final Service asset) { super(core); this.asset = asset; --- 95,101 ---- */ public abstract class AssetTransactionContract extends SignedNamedObject { ! private final Asset asset; ! protected AssetTransactionContract(final SignedNamedCore core, final Asset asset) { super(core); this.asset = asset; *************** *** 98,102 **** ! public final Service getAsset() { return asset; } --- 103,107 ---- ! public final Asset getAsset() { return asset; } |