|
From: <pe...@us...> - 2004-01-06 23:26:52
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders
In directory sc8-pr-cvs1:/tmp/cvs-serv4675/src/java/org/neuclear/exchange/orders
Modified Files:
CancelExchangeOrder.java CancelExchangeReceipt.java
ExchangeCompletionOrder.java ExchangeOrder.java
ExchangeOrderReceipt.java
Added Files:
ExchangeCompletedReceipt.java ExchangeGlobals.java
ExchangeTransactionContract.java
Log Message:
Started restructuring the original xml schemas.
Updated the Exchange and transfer orders.
--- NEW FILE: ExchangeCompletedReceipt.java ---
package org.neuclear.exchange.orders;
import org.neuclear.id.SignedNamedCore;
import org.neuclear.asset.contracts.Asset;
import org.neuclear.exchange.contracts.ExchangeAgent;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: ExchangeCompletedReceipt.java,v 1.1 2004/01/06 23:26:48 pelle Exp $
$Log: ExchangeCompletedReceipt.java,v $
Revision 1.1 2004/01/06 23:26:48 pelle
Started restructuring the original xml schemas.
Updated the Exchange and transfer orders.
*/
/**
* User: pelleb
* Date: Jan 6, 2004
* Time: 7:38:36 PM
*/
public final class ExchangeCompletedReceipt extends ExchangeTransactionContract{
public ExchangeCompletedReceipt(SignedNamedCore core, Asset asset, ExchangeAgent agent, double settledAmount, long valuetime) {
super(core, asset, agent);
this.settledAmount = settledAmount;
this.valuetime = valuetime;
}
private final double settledAmount;
private final long valuetime;
}
--- NEW FILE: ExchangeGlobals.java ---
package org.neuclear.exchange.orders;
import org.dom4j.*;
import org.neuclear.id.verifier.VerifyingReader;
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.orders.TransferGlobals;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: ExchangeGlobals.java,v 1.1 2004/01/06 23:26:48 pelle Exp $
$Log: ExchangeGlobals.java,v $
Revision 1.1 2004/01/06 23:26:48 pelle
Started restructuring the original xml schemas.
Updated the Exchange and transfer orders.
Revision 1.1 2004/01/05 23:47:09 pelle
Create new Document classification "order", which is really just inherint in the new
package layout.
Got rid of much of the inheritance that was lying around and thought a bit further about the format of the exchange orders.
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.
Revision 1.4 2003/11/22 00:22:28 pelle
All unit tests in commons, id and xmlsec now work.
AssetController now successfully processes payments in the unit test.
Payment Web App has working form that creates a TransferOrder presents it to the signer
and forwards it to AssetControlServlet. (Which throws an XML Parser Exception) I think the XMLReaderServlet is bust.
Revision 1.3 2003/11/21 04:43:04 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Revision 1.2 2003/11/10 17:42:07 pelle
The AssetController interface has been more or less finalized.
CurrencyController fully implemented
AssetControlClient implementes a remote client for communicating with AssetControllers
Revision 1.1 2003/11/09 03:32:56 pelle
More missing files from earlier commits. IDEA is acting strangly.
Revision 1.3 2003/11/06 23:47:43 pelle
Major Refactoring of CurrencyController.
Factored out AssetController to be new abstract parent class together with most of its support classes.
Created (Half way) AssetControlClient, which can perform transactions on external AssetControllers via NeuClear.
Created the first attempt at the ExchangeAgent. This will need use of the AssetControlClient.
SOAPTools was changed to return a stream. This is required by the VerifyingReader in NeuClear.
Revision 1.2 2003/10/25 00:38:43 pelle
Fixed SmtpSender it now sends the messages.
Refactored CommandLineSigner. Now it simply signs files read from command line. However new class IdentityCreator
is subclassed and creates new Identities. You can subclass CommandLineSigner to create your own variants.
Several problems with configuration. Trying to solve at the moment. Updated PicoContainer to beta-2
Revision 1.1 2003/10/03 23:48:29 pelle
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Transfer processors. It is used in the PaymentReceiver.
*/
/**
* User: pelleb
* Date: Oct 3, 2003
* Time: 3:55:06 PM
*/
public final class ExchangeGlobals {
private ExchangeGlobals() {
// Instantiation is not allowed
}
public static Namespace createNameSpace() {
return DocumentHelper.createNamespace(EX_NSPREFIX, EX_NSURI);
}
public static QName createQName(final String name) {
return DocumentHelper.createQName(name, createNameSpace());
}
public static Attribute createAttribute(final Element elem, final String name, final String value) {
return DocumentHelper.createAttribute(elem, createQName(name), value);
}
public static Element createElement(final String name, final String value) {
Element elem = createElement(name);
elem.setText(value);
return elem;
}
public static Element createElement(final String name) {
return DocumentHelper.createElement(createQName(name));
}
public static void registerReaders() {
VerifyingReader.getInstance().registerReader(ExchangeGlobals.CANCEL_TAGNAME, new AssetTransactionContract.Reader());
VerifyingReader.getInstance().registerReader(ExchangeGlobals.CANCEL_RCPT_TAGNAME, new AssetTransactionContract.Reader());
VerifyingReader.getInstance().registerReader(ExchangeGlobals.EXCHANGE_TAGNAME, new AssetTransactionContract.Reader());
VerifyingReader.getInstance().registerReader(ExchangeGlobals.EXCHANGE_RCPT_TAGNAME, new AssetTransactionContract.Reader());
VerifyingReader.getInstance().registerReader(ExchangeGlobals.COMPLETE_TAGNAME, new AssetTransactionContract.Reader());
VerifyingReader.getInstance().registerReader(ExchangeGlobals.COMPLETE_RCPT_TAGNAME, new AssetTransactionContract.Reader());
}
static {
registerReaders();
}
public static final String EXCHANGE_TAGNAME = "ExchangeOrder";
public static final String EXCHANGE_RCPT_TAGNAME = "ExchangeOrderReceipt";
public static final String COMPLETE_TAGNAME = "ExchangeCompletionOrder";
public static final String COMPLETE_RCPT_TAGNAME = "ExchangeCompletedReceipt";
public static final String CANCEL_TAGNAME = "CancelExchangeOrder";
public static final String CANCEL_RCPT_TAGNAME = "CancelExchangeReceipt";
public static final String EX_NSPREFIX = "ex";
public static final String EX_NSURI = "http://neuclear.org/neu/exch";
}
--- NEW FILE: ExchangeTransactionContract.java ---
package org.neuclear.exchange.orders;
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.contracts.Asset;
import org.neuclear.id.SignedNamedCore;
import org.neuclear.exchange.contracts.ExchangeAgent;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: ExchangeTransactionContract.java,v 1.1 2004/01/06 23:26:48 pelle Exp $
$Log: ExchangeTransactionContract.java,v $
Revision 1.1 2004/01/06 23:26:48 pelle
Started restructuring the original xml schemas.
Updated the Exchange and transfer orders.
*/
/**
* User: pelleb
* Date: Jan 6, 2004
* Time: 7:31:15 PM
*/
public abstract class ExchangeTransactionContract extends AssetTransactionContract{
ExchangeTransactionContract(SignedNamedCore core, Asset asset,ExchangeAgent agent) {
super(core, asset);
this.agent=agent;
}
public final ExchangeAgent getAgent(){
return agent;
}
private final ExchangeAgent agent;
}
Index: CancelExchangeOrder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders/CancelExchangeOrder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CancelExchangeOrder.java 5 Jan 2004 23:47:10 -0000 1.1
--- CancelExchangeOrder.java 6 Jan 2004 23:26:48 -0000 1.2
***************
*** 7,10 ****
--- 7,11 ----
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.contracts.Asset;
+ import org.neuclear.exchange.contracts.ExchangeAgent;
import java.sql.Timestamp;
***************
*** 16,23 ****
* Time: 5:35:26 PM
*/
! public final class CancelExchangeOrder extends AssetTransactionContract{
! private CancelExchangeOrder(final SignedNamedCore core, final Asset asset, final String exchangeid) {
! super(core, asset);
this.exchangeid = exchangeid;
}
--- 17,24 ----
* Time: 5:35:26 PM
*/
! public final class CancelExchangeOrder extends ExchangeTransactionContract{
! private CancelExchangeOrder(final SignedNamedCore core, final Asset asset,final ExchangeAgent agent, final String exchangeid) {
! super(core, asset,agent);
this.exchangeid = exchangeid;
}
Index: CancelExchangeReceipt.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders/CancelExchangeReceipt.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CancelExchangeReceipt.java 5 Jan 2004 23:47:10 -0000 1.1
--- CancelExchangeReceipt.java 6 Jan 2004 23:26:48 -0000 1.2
***************
*** 10,13 ****
--- 10,14 ----
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.exchange.orders.CancelExchangeOrder;
+ import org.neuclear.exchange.contracts.ExchangeAgent;
import java.sql.Timestamp;
***************
*** 19,26 ****
* Time: 5:35:26 PM
*/
! public final class CancelExchangeReceipt extends AssetTransactionContract{
! private CancelExchangeReceipt(final SignedNamedCore core, final Asset asset, final Date canceltime,final String exchangeid, final String cancelid) {
! super(core, asset);
this.canceltime=canceltime.getTime();
this.exchangeid=exchangeid;
--- 20,27 ----
* Time: 5:35:26 PM
*/
! public final class CancelExchangeReceipt extends ExchangeTransactionContract{
! private CancelExchangeReceipt(final SignedNamedCore core, final Asset asset, ExchangeAgent agent,final Date canceltime,final String exchangeid, final String cancelid) {
! super(core, asset,agent);
this.canceltime=canceltime.getTime();
this.exchangeid=exchangeid;
Index: ExchangeCompletionOrder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders/ExchangeCompletionOrder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ExchangeCompletionOrder.java 5 Jan 2004 23:47:10 -0000 1.1
--- ExchangeCompletionOrder.java 6 Jan 2004 23:26:48 -0000 1.2
***************
*** 7,10 ****
--- 7,11 ----
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.contracts.Asset;
+ import org.neuclear.exchange.contracts.ExchangeAgent;
import java.sql.Timestamp;
***************
*** 16,22 ****
* Time: 5:35:26 PM
*/
! public final class ExchangeCompletionOrder extends AssetTransactionContract {
! public ExchangeCompletionOrder(final SignedNamedCore core, final Asset asset, final Date valuetime, final double amount, final String holdid, final String counterpartyid) {
! super(core, asset);
this.valuetime = valuetime.getTime();
this.amount = amount;
--- 17,23 ----
* Time: 5:35:26 PM
*/
! public final class ExchangeCompletionOrder extends ExchangeTransactionContract {
! private ExchangeCompletionOrder(final SignedNamedCore core, final Asset asset, final ExchangeAgent agent, final Date valuetime, final double amount, final String holdid, final String counterpartyid) {
! super(core, asset,agent);
this.valuetime = valuetime.getTime();
this.amount = amount;
Index: ExchangeOrder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders/ExchangeOrder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ExchangeOrder.java 5 Jan 2004 23:47:10 -0000 1.1
--- ExchangeOrder.java 6 Jan 2004 23:26:48 -0000 1.2
***************
*** 20,28 ****
* Time: 12:01:03 PM
*/
! public final class ExchangeOrder extends AssetTransactionContract {
private ExchangeOrder(final SignedNamedCore core,
final Asset bidAsset, final ExchangeAgent agent, final double bid,
final Asset neededAsset, final double neededAmount, final String comment, final Date expires) {
! super(core, bidAsset);
this.neededAsset = neededAsset;
this.neededAmount = neededAmount;
--- 20,28 ----
* Time: 12:01:03 PM
*/
! public final class ExchangeOrder extends ExchangeTransactionContract {
private ExchangeOrder(final SignedNamedCore core,
final Asset bidAsset, final ExchangeAgent agent, final double bid,
final Asset neededAsset, final double neededAmount, final String comment, final Date expires) {
! super(core, bidAsset,agent);
this.neededAsset = neededAsset;
this.neededAmount = neededAmount;
***************
*** 30,34 ****
this.comment = (comment != null) ? comment : "";
this.expires = expires.getTime();
- this.agent = agent;
}
--- 30,33 ----
***************
*** 57,64 ****
}
- public ExchangeAgent getAgent() {
- return agent;
- }
-
private final Asset neededAsset;
private final double neededAmount;
--- 56,59 ----
***************
*** 66,70 ****
private final String comment;
private final long expires;
- private final ExchangeAgent agent;
}
--- 61,64 ----
Index: ExchangeOrderReceipt.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders/ExchangeOrderReceipt.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ExchangeOrderReceipt.java 5 Jan 2004 23:47:10 -0000 1.1
--- ExchangeOrderReceipt.java 6 Jan 2004 23:26:48 -0000 1.2
***************
*** 1,11 ****
package org.neuclear.exchange.orders;
- import org.neuclear.commons.NeuClearException;
- import org.neuclear.id.Identity;
import org.neuclear.id.SignedNamedCore;
- import org.neuclear.asset.orders.exchanges.Exchange;
- import org.neuclear.asset.orders.TransferContract;
- import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.contracts.Asset;
import java.sql.Timestamp;
--- 1,7 ----
package org.neuclear.exchange.orders;
import org.neuclear.id.SignedNamedCore;
import org.neuclear.asset.contracts.Asset;
+ import org.neuclear.exchange.contracts.ExchangeAgent;
import java.sql.Timestamp;
***************
*** 17,25 ****
* Time: 11:59:36 AM
*/
! public final class ExchangeOrderReceipt extends AssetTransactionContract {
! private ExchangeOrderReceipt(final SignedNamedCore core, final Asset asset, Identity agent, String orderid, Date valuetime, Asset neededAsset, double neededAmount, double bidAmount, String comment, Date expires) {
! super(core, asset);
! this.agent = agent;
this.orderid = orderid;
this.valuetime = valuetime.getTime();
--- 13,20 ----
* Time: 11:59:36 AM
*/
! public final class ExchangeOrderReceipt extends ExchangeTransactionContract {
! private ExchangeOrderReceipt(final SignedNamedCore core, final Asset asset, final ExchangeAgent agent, final String orderid, final Date valuetime, Asset neededAsset, double neededAmount, double bidAmount, final String comment, final Date expires) {
! super(core, asset,agent);
this.orderid = orderid;
this.valuetime = valuetime.getTime();
***************
*** 35,41 ****
}
- public Identity getAgent() {
- return agent;
- }
public String getOrderid() {
--- 30,33 ----
***************
*** 67,71 ****
}
- private final Identity agent;
private final String orderid;
private final long valuetime;
--- 59,62 ----
|