Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts
In directory sc8-pr-cvs1:/tmp/cvs-serv10127/src/java/org/neuclear/asset/contracts
Modified Files:
AssetGlobals.java AssetTransactionContract.java
TransferContract.java TransferGlobals.java
TransferReceipt.java TransferRequest.java
Added Files:
CancelExchangeReceipt.java CancelExchangeRequest.java
CompleteExchangeRequest.java Exchange.java
ExchangeReceipt.java ExchangeRequest.java
Removed Files:
CancelHeldTransferReceipt.java CancelHeldTransferRequest.java
CompleteHeldTransferRequest.java Held.java
HeldTransferReceipt.java HeldTransferRequest.java
Log Message:
Renamed HeldTransfer to Exchange
Dropped valuetime from the request objects.
Doesnt yet compile. New commit to follow soon.
--- NEW FILE: CancelExchangeReceipt.java ---
package org.neuclear.asset.contracts;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.Identity;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.SignedNamedCore;
import java.sql.Timestamp;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 21, 2003
* Time: 5:35:26 PM
*/
public final class CancelExchangeReceipt extends AssetTransactionContract{
CancelExchangeReceipt(final SignedNamedCore core, final Asset asset, final String holdid) {
super(core, asset);
this.holdid = holdid;
}
public final String getHoldId() {
return holdid;
}
private final String holdid;
}
--- NEW FILE: CancelExchangeRequest.java ---
package org.neuclear.asset.contracts;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.Identity;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.SignedNamedCore;
import java.sql.Timestamp;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 21, 2003
* Time: 5:35:26 PM
*/
public final class CancelExchangeRequest extends AssetTransactionContract{
CancelExchangeRequest(final SignedNamedCore core, final Asset asset, final String holdid) {
super(core, asset);
this.holdid = holdid;
}
public final String getHoldId() {
return holdid;
}
private final String holdid;
}
--- NEW FILE: CompleteExchangeRequest.java ---
package org.neuclear.asset.contracts;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.Identity;
import org.neuclear.id.SignedNamedCore;
import java.sql.Timestamp;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 21, 2003
* Time: 5:35:26 PM
*/
public final class CompleteExchangeRequest extends TransferContract {
CompleteExchangeRequest(final SignedNamedCore core, final Asset asset, final Identity from, final Identity to, final double amount, final Date valuetime, final String comment, final String holdid) {
super(core, asset, amount, comment);
this.from = from;
this.holdid = holdid;
this.to = to;
this.valuetime=valuetime.getTime();
}
public final Identity getFrom() {
return from;
}
public final String getHoldId() {
return holdid;
}
public final Identity getTo() {
return to;
}
public final Date getValueTime() {
return new Timestamp(valuetime);
}
private final long valuetime;
private final Identity from;
private final String holdid;
private final Identity to;
}
--- NEW FILE: Exchange.java ---
package org.neuclear.asset.contracts;
import org.neuclear.id.Identity;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 30, 2003
* Time: 11:57:39 AM
*/
public interface Exchange {
public Date getValidTo();
public Identity getAgent();
}
--- NEW FILE: ExchangeReceipt.java ---
package org.neuclear.asset.contracts;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.Identity;
import org.neuclear.id.SignedNamedCore;
import java.sql.Timestamp;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 30, 2003
* Time: 11:59:36 AM
*/
public final class ExchangeReceipt extends TransferContract implements Exchange {
ExchangeReceipt(final SignedNamedCore core, final Asset asset, final Identity from, final Identity agent, final String reqid, final double amount, final Date valuetime, final String comment, final Date helduntil) {
super(core, asset, amount, comment);
this.from = from;
this.reqid = reqid;
this.helduntil = helduntil.getTime();
this.agent=agent;
this.valuetime=valuetime.getTime();
}
public final Date getValidTo() {
return new Timestamp(helduntil);
}
public Identity getAgent() {
return agent; //To change body of implemented methods use Options | File Templates.
}
public Identity getFrom() {
return from; //To change body of implemented methods use Options | File Templates.
}
public final Date getValueTime() {
return new Timestamp(valuetime);
}
private final long valuetime;
private final long helduntil;
private final Identity from;
private final String reqid;
private final Identity agent;
}
--- NEW FILE: ExchangeRequest.java ---
package org.neuclear.asset.contracts;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.Identity;
import org.neuclear.id.SignedNamedCore;
import java.sql.Timestamp;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 30, 2003
* Time: 12:01:03 PM
*/
public final class ExchangeRequest extends TransferContract implements Exchange {
ExchangeRequest(final SignedNamedCore core,
final Asset asset, final Identity agent, final double amount, final String comment, final Date helduntil) {
super(core, asset, amount, comment);
this.validto = helduntil.getTime();
this.agent=agent;
}
public final Date getValidTo() {
return new Timestamp(validto);
}
public Identity getAgent() {
return agent; //To change body of implemented methods use Options | File Templates.
}
public final Identity getFrom() {
return getSignatory();
}
private final long validto;
private final Identity agent;
}
Index: AssetGlobals.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/AssetGlobals.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** AssetGlobals.java 19 Dec 2003 18:02:35 -0000 1.7
--- AssetGlobals.java 3 Jan 2004 20:36:25 -0000 1.8
***************
*** 24,27 ****
--- 24,32 ----
$Id$
$Log$
+ Revision 1.8 2004/01/03 20:36:25 pelle
+ Renamed HeldTransfer to Exchange
+ Dropped valuetime from the request objects.
+ Doesnt yet compile. New commit to follow soon.
+
Revision 1.7 2003/12/19 18:02:35 pelle
Revamped a lot of exception handling throughout the framework, it has been simplified in most places:
***************
*** 63,67 ****
Issuer is now Asset which is a subclass of Identity
AssetController supports more than one Asset. Which is important for most non ecurrency implementations.
! TransferRequest/Receipt and its Held companions are now SignedNamedObjects. Thus to create them you must use
their matching TransferRequest/ReceiptBuilder classes.
PaymentProcessor has been renamed CurrencyController. I will extract a superclass later to be named AbstractLedgerController
--- 68,72 ----
Issuer is now Asset which is a subclass of Identity
AssetController supports more than one Asset. Which is important for most non ecurrency implementations.
! TransferRequest/Receipt and its Exchange companions are now SignedNamedObjects. Thus to create them you must use
their matching TransferRequest/ReceiptBuilder classes.
PaymentProcessor has been renamed CurrencyController. I will extract a superclass later to be named AbstractLedgerController
Index: AssetTransactionContract.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/AssetTransactionContract.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** AssetTransactionContract.java 19 Dec 2003 18:02:35 -0000 1.10
--- AssetTransactionContract.java 3 Jan 2004 20:36:25 -0000 1.11
***************
*** 19,22 ****
--- 19,27 ----
* $Id$
* $Log$
+ * Revision 1.11 2004/01/03 20:36:25 pelle
+ * Renamed HeldTransfer to Exchange
+ * Dropped valuetime from the request objects.
+ * Doesnt yet compile. New commit to follow soon.
+ *
* Revision 1.10 2003/12/19 18:02:35 pelle
* Revamped a lot of exception handling throughout the framework, it has been simplified in most places:
***************
*** 106,112 ****
final String holdid = elem.attributeValue("holdid");
if (elem.getName().equals(TransferGlobals.CANCEL_TAGNAME))
! return new CancelHeldTransferRequest(core, asset, holdid);
if (elem.getName().equals(TransferGlobals.CANCEL_RCPT_TAGNAME))
! return new CancelHeldTransferReceipt(core, asset, holdid);
final double amount = Double.parseDouble(elem.attributeValue("amount"));
--- 111,117 ----
final String holdid = elem.attributeValue("holdid");
if (elem.getName().equals(TransferGlobals.CANCEL_TAGNAME))
! return new CancelExchangeRequest(core, asset, holdid);
if (elem.getName().equals(TransferGlobals.CANCEL_RCPT_TAGNAME))
! return new CancelExchangeReceipt(core, asset, holdid);
final double amount = Double.parseDouble(elem.attributeValue("amount"));
***************
*** 117,121 ****
final String comment = (commentElement != null) ? commentElement.getText() : "";
if (elem.getName().equals(TransferGlobals.XFER_TAGNAME))
! return new TransferRequest(core, asset, to, amount, valuetime, comment);
Date helduntil = null;
--- 122,126 ----
final String comment = (commentElement != null) ? commentElement.getText() : "";
if (elem.getName().equals(TransferGlobals.XFER_TAGNAME))
! return new TransferRequest(core, asset, to, amount, comment);
Date helduntil = null;
***************
*** 123,127 ****
helduntil = TimeTools.parseTimeStamp(elem.attributeValue("valuetime"));
if (elem.getName().equals(TransferGlobals.HELD_XFER_TAGNAME))
! return new HeldTransferRequest(core, asset, to, amount, valuetime, comment, helduntil);
final Identity from = NSResolver.resolveIdentity(elem.attributeValue("sender"));
--- 128,132 ----
helduntil = TimeTools.parseTimeStamp(elem.attributeValue("valuetime"));
if (elem.getName().equals(TransferGlobals.HELD_XFER_TAGNAME))
! return new ExchangeRequest(core, asset, to, amount, comment, helduntil);
final Identity from = NSResolver.resolveIdentity(elem.attributeValue("sender"));
***************
*** 131,138 ****
if (elem.getName().equals(TransferGlobals.HELD_XFER_RCPT_TAGNAME))
! return new HeldTransferReceipt(core, asset, from, to, reqid, amount, valuetime, comment, helduntil);
if (elem.getName().equals(TransferGlobals.COMPLETE_TAGNAME))
! return new CompleteHeldTransferRequest(core, asset, from, to, amount, valuetime, comment, holdid);
} catch (ParseException e) {
throw new InvalidNamedObjectException(core.getName(),e);
--- 136,143 ----
if (elem.getName().equals(TransferGlobals.HELD_XFER_RCPT_TAGNAME))
! return new ExchangeReceipt(core, asset, from, to, reqid, amount, valuetime, comment, helduntil);
if (elem.getName().equals(TransferGlobals.COMPLETE_TAGNAME))
! return new CompleteExchangeRequest(core, asset, from, to, amount, valuetime, comment, holdid);
} catch (ParseException e) {
throw new InvalidNamedObjectException(core.getName(),e);
Index: TransferContract.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/TransferContract.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TransferContract.java 19 Dec 2003 18:02:35 -0000 1.7
--- TransferContract.java 3 Jan 2004 20:36:25 -0000 1.8
***************
*** 45,54 ****
*/
public abstract class TransferContract extends AssetTransactionContract {
! TransferContract(final SignedNamedCore core, final Asset asset, final Identity to, final double amount, final Date valuetime, final String comment) {
super(core, asset);
this.amount = amount;
this.comment = (comment != null) ? comment : "";
- this.to = to;
- this.valuetime = valuetime.getTime();
}
--- 45,52 ----
*/
public abstract class TransferContract extends AssetTransactionContract {
! TransferContract(final SignedNamedCore core, final Asset asset, final double amount, final String comment) {
super(core, asset);
this.amount = amount;
this.comment = (comment != null) ? comment : "";
}
***************
*** 57,67 ****
}
- public final Date getValueTime() {
- return new Timestamp(valuetime);
- }
-
- public final Identity getTo() {
- return to;
- }
public abstract Identity getFrom();
--- 55,58 ----
***************
*** 73,78 ****
private final double amount;
- private final Identity to;
- private final long valuetime;
private final String comment;
--- 64,67 ----
Index: TransferGlobals.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/TransferGlobals.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TransferGlobals.java 28 Nov 2003 00:11:50 -0000 1.5
--- TransferGlobals.java 3 Jan 2004 20:36:25 -0000 1.6
***************
*** 24,27 ****
--- 24,32 ----
$Id$
$Log$
+ Revision 1.6 2004/01/03 20:36:25 pelle
+ Renamed HeldTransfer to Exchange
+ Dropped valuetime from the request objects.
+ Doesnt yet compile. New commit to follow soon.
+
Revision 1.5 2003/11/28 00:11:50 pelle
Getting the NeuClear web transactions working.
***************
*** 120,125 ****
public static final String XFER_TAGNAME = "TransferRequest";
public static final String XFER_RCPT_TAGNAME = "TransferReceipt";
! public static final String HELD_XFER_TAGNAME = "HeldTransferRequest";
! public static final String HELD_XFER_RCPT_TAGNAME = "HeldTransferReceipt";
public static final String COMPLETE_TAGNAME = "CompleteHoldRequest";
public static final String CANCEL_TAGNAME = "CancelHoldRequest";
--- 125,130 ----
public static final String XFER_TAGNAME = "TransferRequest";
public static final String XFER_RCPT_TAGNAME = "TransferReceipt";
! public static final String HELD_XFER_TAGNAME = "ExchangeRequest";
! public static final String HELD_XFER_RCPT_TAGNAME = "ExchangeReceipt";
public static final String COMPLETE_TAGNAME = "CompleteHoldRequest";
public static final String CANCEL_TAGNAME = "CancelHoldRequest";
Index: TransferReceipt.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/TransferReceipt.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TransferReceipt.java 19 Dec 2003 18:02:35 -0000 1.5
--- TransferReceipt.java 3 Jan 2004 20:36:25 -0000 1.6
***************
*** 14,24 ****
*/
public class TransferReceipt extends TransferContract {
- private final Identity from;
- private final String reqid;
TransferReceipt(final SignedNamedCore core, final Asset asset, final Identity from, final Identity to, final String reqid, final double amount, final Date valuetime, final String comment) {
! super(core, asset, to, amount, valuetime, comment);
this.from = from;
this.reqid = reqid;
}
--- 14,24 ----
*/
public class TransferReceipt extends TransferContract {
TransferReceipt(final SignedNamedCore core, final Asset asset, final Identity from, final Identity to, final String reqid, final double amount, final Date valuetime, final String comment) {
! super(core, asset, amount, comment);
this.from = from;
this.reqid = reqid;
+ this.to=to;
+ this.valuetime=valuetime.getTime();
}
***************
*** 30,33 ****
--- 30,44 ----
return reqid;
}
+
+ public final Identity getTo() {
+ return to;
+ }
+ public final Date getValueTime() {
+ return new Timestamp(valuetime);
+ }
+ private final long valuetime;
+ private final Identity from;
+ private final String reqid;
+ private final Identity to;
}
Index: TransferRequest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/TransferRequest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TransferRequest.java 19 Dec 2003 18:02:35 -0000 1.5
--- TransferRequest.java 3 Jan 2004 20:36:25 -0000 1.6
***************
*** 14,24 ****
*/
public class TransferRequest extends TransferContract {
! TransferRequest(final SignedNamedCore core, final Asset asset, final Identity to, final double amount, final Date valuetime, final String comment) {
! super(core, asset, to, amount, valuetime, comment);
}
public final Identity getFrom() {
return getSignatory();
}
--- 14,30 ----
*/
public class TransferRequest extends TransferContract {
+ private final Identity to;
! TransferRequest(final SignedNamedCore core, final Asset asset, final Identity to, final double amount, final String comment) {
! super(core, asset, amount, comment);
! this.to=to;
}
public final Identity getFrom() {
return getSignatory();
+ }
+
+ public final Identity getTo() {
+ return to;
}
--- CancelHeldTransferReceipt.java DELETED ---
--- CancelHeldTransferRequest.java DELETED ---
--- CompleteHeldTransferRequest.java DELETED ---
--- Held.java DELETED ---
--- HeldTransferReceipt.java DELETED ---
--- HeldTransferRequest.java DELETED ---
|