Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv10127/src/java/org/neuclear/asset/contracts/builders
Modified Files:
TransferBuilder.java TransferReceiptBuilder.java
TransferRequestBuilder.java
Added Files:
CancelExchangeBuilder.java CancelExchangeReceiptBuilder.java
CancelExchangeRequestBuilder.java
CompleteExchangeRequestBuilder.java
ExchangeReceiptBuilder.java ExchangeRequestBuilder.java
Removed Files:
CancelHeldTransferBuilder.java
CancelHeldTransferReceiptBuilder.java
CancelHeldTransferRequestBuilder.java
CompleteHeldTransferRequestBuilder.java
HeldTransferReceiptBuilder.java
HeldTransferRequestBuilder.java
Log Message:
Renamed HeldTransfer to Exchange
Dropped valuetime from the request objects.
Doesnt yet compile. New commit to follow soon.
--- NEW FILE: CancelExchangeBuilder.java ---
package org.neuclear.asset.contracts.builders;
import org.dom4j.Element;
import org.neuclear.asset.InvalidTransferException;
import org.neuclear.asset.NegativeTransferException;
import org.neuclear.asset.contracts.Asset;
import org.neuclear.asset.contracts.TransferGlobals;
import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.commons.NeuClearException;
/*
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: CancelExchangeBuilder.java,v 1.1 2004/01/03 20:36:25 pelle Exp $
$Log: CancelExchangeBuilder.java,v $
Revision 1.1 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.4 2003/11/21 04:43:03 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.3 2003/11/12 23:47:04 pelle
Much work done in creating good test environment.
PaymentReceiverTest works, but needs a abit more work in its environment to succeed testing.
Revision 1.2 2003/11/11 21:17:19 pelle
Further vital reshuffling.
org.neudist.crypto.* and org.neudist.utils.* have been moved to respective areas under org.neuclear.commons
org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well.
Did a bit of work on the Canonicalizer and changed a few other minor bits.
Revision 1.1 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.2 2003/11/09 03:26:47 pelle
More house keeping and shuffling about mainly pay
Revision 1.1 2003/11/09 03:10:13 pelle
Major changes that apparently didnt get properly checked in earlier.
Revision 1.2 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.1 2003/10/03 23:48:29 pelle
Did various security related updates in the pay package with regards to immutability of fields etc.
AssetControllerReceiver 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 AssetControllerReceiver.
*/
/**
* User: pelleb
* Date: Oct 3, 2003
* Time: 3:13:27 PM
*/
public abstract class CancelExchangeBuilder extends NamedObjectBuilder {
protected CancelExchangeBuilder(final String tagname, final String name, final Asset asset, final String holdid) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(name, TransferGlobals.createQName(tagname));
if (asset == null)
throw new InvalidTransferException("assetName");
if (holdid == null)
throw new InvalidTransferException("holdid");
this.asset = asset;
final Element element = getElement();
element.add(TransferGlobals.createAttribute(element, "assetName", asset.getName()));
element.add(TransferGlobals.createAttribute(element, "holdid", holdid));
}
public final Asset getAsset() {
return asset;
}
private final Asset asset;
}
--- NEW FILE: CancelExchangeReceiptBuilder.java ---
package org.neuclear.asset.contracts.builders;
import org.neuclear.asset.InvalidTransferException;
import org.neuclear.asset.NegativeTransferException;
import org.neuclear.asset.contracts.CancelExchangeRequest;
import org.neuclear.asset.contracts.TransferGlobals;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.NSTools;
/**
* (C) 2003 Antilles Software Ventures SA
* User: pelleb
* Date: Nov 10, 2003
* Time: 10:46:12 AM
* $Id: CancelExchangeReceiptBuilder.java,v 1.1 2004/01/03 20:36:25 pelle Exp $
* $Log: CancelExchangeReceiptBuilder.java,v $
* Revision 1.1 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.3 2003/12/06 00:16:10 pelle
* Updated various areas in NSTools.
* Updated URI Validation in particular to support new expanded format
* Updated createUniqueID and friends to be a lot more unique and more efficient.
* In CryptoTools updated getRandom() to finally use a SecureRandom.
* Changed CryptoTools.getFormatURLSafe to getBase36 because that is what it really is.
*
* Revision 1.2 2003/11/21 04:43:03 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).
* <p/>
* Revision 1.1 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
*/
public final class CancelExchangeReceiptBuilder extends CancelExchangeBuilder {
public CancelExchangeReceiptBuilder(final CancelExchangeRequest req) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(NSTools.createUniqueTransactionID(req.getAsset().getName(), req.getSignatory().getName()), TransferGlobals.CANCEL_RCPT_TAGNAME, req.getAsset(), req.getHoldId());
}
}
--- NEW FILE: CancelExchangeRequestBuilder.java ---
package org.neuclear.asset.contracts.builders;
import org.neuclear.asset.InvalidTransferException;
import org.neuclear.asset.NegativeTransferException;
import org.neuclear.asset.contracts.ExchangeReceipt;
import org.neuclear.asset.contracts.TransferGlobals;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.NSTools;
/**
* (C) 2003 Antilles Software Ventures SA
* User: pelleb
* Date: Nov 10, 2003
* Time: 10:46:12 AM
* $Id: CancelExchangeRequestBuilder.java,v 1.1 2004/01/03 20:36:25 pelle Exp $
* $Log: CancelExchangeRequestBuilder.java,v $
* Revision 1.1 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.3 2003/12/06 00:16:10 pelle
* Updated various areas in NSTools.
* Updated URI Validation in particular to support new expanded format
* Updated createUniqueID and friends to be a lot more unique and more efficient.
* In CryptoTools updated getRandom() to finally use a SecureRandom.
* Changed CryptoTools.getFormatURLSafe to getBase36 because that is what it really is.
*
* Revision 1.2 2003/11/21 04:43:03 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).
* <p/>
* Revision 1.1 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
*/
public final class CancelExchangeRequestBuilder extends CancelExchangeBuilder {
public CancelExchangeRequestBuilder(final ExchangeReceipt held) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(NSTools.createUniqueTransactionID(held.getAgent().getName(), held.getAsset().getName()), TransferGlobals.CANCEL_TAGNAME, held.getAsset(), held.getName());
}
}
--- NEW FILE: CompleteExchangeRequestBuilder.java ---
package org.neuclear.asset.contracts.builders;
import org.dom4j.Element;
import org.neuclear.asset.contracts.TransferReceipt;
import org.neuclear.asset.contracts.TransferGlobals;
import org.neuclear.asset.contracts.TransferRequest;
import org.neuclear.asset.contracts.ExchangeReceipt;
import org.neuclear.asset.InvalidTransferException;
import org.neuclear.asset.NegativeTransferException;
import org.neuclear.id.Identity;
import org.neuclear.commons.NeuClearException;
import java.util.Date;
/*
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: CompleteExchangeRequestBuilder.java,v 1.1 2004/01/03 20:36:25 pelle Exp $
$Log: CompleteExchangeRequestBuilder.java,v $
Revision 1.1 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.2 2003/11/21 04:43:03 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.1 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.2 2003/11/09 03:26:47 pelle
More house keeping and shuffling about mainly pay
Revision 1.1 2003/11/09 03:10:13 pelle
Major changes that apparently didnt get properly checked in earlier.
Revision 1.2 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.1 2003/10/03 23:48:29 pelle
Did various security related updates in the pay package with regards to immutability of fields etc.
AssetControllerReceiver 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 AssetControllerReceiver.
*/
/**
* User: pelleb
* Date: Oct 3, 2003
* Time: 6:28:26 PM
*/
public final class CompleteExchangeRequestBuilder extends TransferBuilder {
public CompleteExchangeRequestBuilder(final ExchangeReceipt req,final Identity signatory,final String id,final double amount, final String comment) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(TransferGlobals.COMPLETE_TAGNAME,
req.getAsset(),
signatory,
req.getAgent(),
amount,
comment);
final Element element = getElement();
element.add(TransferGlobals.createAttribute(element, "sender", req.getFrom().getName()));
element.add(TransferGlobals.createAttribute(element, "holdid", req.getName()));
}
}
--- NEW FILE: ExchangeReceiptBuilder.java ---
package org.neuclear.asset.contracts.builders;
import org.dom4j.Element;
import org.neuclear.asset.InvalidTransferException;
import org.neuclear.asset.NegativeTransferException;
import org.neuclear.asset.contracts.ExchangeRequest;
import org.neuclear.asset.contracts.TransferGlobals;
import org.neuclear.commons.time.TimeTools;
import org.neuclear.commons.NeuClearException;
import java.sql.Timestamp;
/*
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: ExchangeReceiptBuilder.java,v 1.1 2004/01/03 20:36:25 pelle Exp $
$Log: ExchangeReceiptBuilder.java,v $
Revision 1.1 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.3 2003/11/21 04:43:03 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/11 21:17:19 pelle
Further vital reshuffling.
org.neudist.crypto.* and org.neudist.utils.* have been moved to respective areas under org.neuclear.commons
org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well.
Did a bit of work on the Canonicalizer and changed a few other minor bits.
Revision 1.1 2003/11/08 01:39:57 pelle
WARNING this rev is majorly unstable and will almost certainly not compile.
More major refactoring in neuclear-pay.
Got rid of neuclear-ledger like features of pay such as Account and Issuer.
Accounts have been replaced by Identity from neuclear-id
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
which will handle all neuclear-ledger based AssetControllers.
*/
/**
* User: pelleb
* Date: Nov 7, 2003
* Time: 8:05:15 PM
*/
public final class ExchangeReceiptBuilder extends TransferBuilder {
public ExchangeReceiptBuilder(final ExchangeRequest req, final String id,Timestamp valuetime) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(TransferGlobals.HELD_XFER_RCPT_TAGNAME, req.getAsset(),req.getAsset(),req.getAmount());
final Element element = getElement();
element.add(TransferGlobals.createAttribute(element, "helduntil", TimeTools.formatTimeStamp(req.getValidTo())));
}
}
--- NEW FILE: ExchangeRequestBuilder.java ---
package org.neuclear.asset.contracts.builders;
import org.dom4j.Element;
import org.neuclear.asset.InvalidTransferException;
import org.neuclear.asset.NegativeTransferException;
import org.neuclear.asset.contracts.Asset;
import org.neuclear.asset.contracts.TransferGlobals;
import org.neuclear.id.Identity;
import org.neuclear.commons.time.TimeTools;
import org.neuclear.commons.NeuClearException;
import java.util.Date;
/*
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: ExchangeRequestBuilder.java,v 1.1 2004/01/03 20:36:25 pelle Exp $
$Log: ExchangeRequestBuilder.java,v $
Revision 1.1 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.3 2003/11/21 04:43:03 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/11 21:17:19 pelle
Further vital reshuffling.
org.neudist.crypto.* and org.neudist.utils.* have been moved to respective areas under org.neuclear.commons
org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well.
Did a bit of work on the Canonicalizer and changed a few other minor bits.
Revision 1.1 2003/11/08 01:39:57 pelle
WARNING this rev is majorly unstable and will almost certainly not compile.
More major refactoring in neuclear-pay.
Got rid of neuclear-ledger like features of pay such as Account and Issuer.
Accounts have been replaced by Identity from neuclear-id
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
which will handle all neuclear-ledger based AssetControllers.
*/
/**
* User: pelleb
* Date: Nov 7, 2003
* Time: 7:59:13 PM
*/
public final class ExchangeRequestBuilder extends TransferBuilder {
public ExchangeRequestBuilder(final Asset asset, final Identity signer, final Identity agent, final double amount, final String comment, final Date helduntil) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(TransferGlobals.HELD_XFER_TAGNAME, asset, signer, agent, amount, comment);
final Element element = getElement();
element.add(TransferGlobals.createAttribute(element, "helduntil", TimeTools.formatTimeStamp(helduntil)));
element.add(TransferGlobals.createAttribute(element, "agent", agent.getName()));
}
}
Index: TransferBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/builders/TransferBuilder.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TransferBuilder.java 6 Dec 2003 00:16:10 -0000 1.8
--- TransferBuilder.java 3 Jan 2004 20:36:25 -0000 1.9
***************
*** 35,38 ****
--- 35,43 ----
$Id$
$Log$
+ Revision 1.9 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.8 2003/12/06 00:16:10 pelle
Updated various areas in NSTools.
***************
*** 96,100 ****
*/
public abstract class TransferBuilder extends NamedObjectBuilder {
! protected TransferBuilder(final String tagname, final Asset asset, final Identity signer, final Identity to, final double amount, final Date valuetime, final String comment) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(NSTools.createUniqueTransactionID(signer.getName(), to.getName()), TransferGlobals.createQName(tagname));
if (amount < 0)
--- 101,105 ----
*/
public abstract class TransferBuilder extends NamedObjectBuilder {
! protected TransferBuilder(final String tagname, final Asset asset, final Identity signer, final Identity to, final double amount, final String comment) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(NSTools.createUniqueTransactionID(signer.getName(), to.getName()), TransferGlobals.createQName(tagname));
if (amount < 0)
***************
*** 104,109 ****
if (to == null)
throw new InvalidTransferException("to");
- if (valuetime == null)
- throw new InvalidTransferException("valuetime");
this.asset = asset;
--- 109,112 ----
***************
*** 112,116 ****
element.add(TransferGlobals.createAttribute(element, "assetName", asset.getName()));
element.add(TransferGlobals.createAttribute(element, "amount", Double.toString(amount)));
- element.add(TransferGlobals.createAttribute(element, "valuetime", TimeTools.formatTimeStamp(valuetime)));
if (!Utility.isEmpty(comment))
element.add(TransferGlobals.createElement("comment", comment));
--- 115,118 ----
Index: TransferReceiptBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/builders/TransferReceiptBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TransferReceiptBuilder.java 21 Nov 2003 04:43:03 -0000 1.4
--- TransferReceiptBuilder.java 3 Jan 2004 20:36:25 -0000 1.5
***************
*** 6,11 ****
--- 6,13 ----
import org.neuclear.asset.NegativeTransferException;
import org.neuclear.commons.NeuClearException;
+ import org.neuclear.commons.time.TimeTools;
import java.util.Date;
+ import java.sql.Timestamp;
/*
***************
*** 29,32 ****
--- 31,39 ----
$Id$
$Log$
+ Revision 1.5 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.4 2003/11/21 04:43:03 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 70,77 ****
*/
public class TransferReceiptBuilder extends TransferBuilder {
! public TransferReceiptBuilder(final TransferRequest req,final String id) throws InvalidTransferException, NegativeTransferException, NeuClearException {
! this(TransferGlobals.XFER_RCPT_TAGNAME,req,id);
! }
! public TransferReceiptBuilder(final CompleteHeldTransferRequest req,final String id) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(TransferGlobals.XFER_RCPT_TAGNAME,
req.getAsset(),
--- 77,81 ----
*/
public class TransferReceiptBuilder extends TransferBuilder {
! public TransferReceiptBuilder(final CompleteExchangeRequest req,final String id,Timestamp valuetime) throws InvalidTransferException, NegativeTransferException, NeuClearException {
super(TransferGlobals.XFER_RCPT_TAGNAME,
req.getAsset(),
***************
*** 79,98 ****
req.getTo(),
req.getAmount(),
- req.getValueTime(),
req.getComment());
final Element element = getElement();
element.add(TransferGlobals.createAttribute(element, "sender", req.getFrom().getName()));
element.add(TransferGlobals.createAttribute(element, "holdid", req.getHoldId()));
}
! TransferReceiptBuilder(final String tagname,final TransferRequest req,final String id) throws InvalidTransferException, NegativeTransferException, NeuClearException {
! super(tagname,
req.getAsset(),
req.getAsset(),
req.getTo(),
req.getAmount(),
- req.getValueTime(),
req.getComment());
final Element element = getElement();
element.add(TransferGlobals.createAttribute(element, "sender", req.getFrom().getName()));
element.add(TransferGlobals.createAttribute(element, "reqid", req.getName()));
--- 83,107 ----
req.getTo(),
req.getAmount(),
req.getComment());
final Element element = getElement();
+ if (valuetime == null)
+ throw new InvalidTransferException("valuetime");
+ element.add(TransferGlobals.createAttribute(element, "valuetime", TimeTools.formatTimeStamp(valuetime)));
+
element.add(TransferGlobals.createAttribute(element, "sender", req.getFrom().getName()));
element.add(TransferGlobals.createAttribute(element, "holdid", req.getHoldId()));
}
! public TransferReceiptBuilder(final TransferRequest req,final String id,Timestamp valuetime) throws InvalidTransferException, NegativeTransferException, NeuClearException {
! super(TransferGlobals.XFER_RCPT_TAGNAME,
req.getAsset(),
req.getAsset(),
req.getTo(),
req.getAmount(),
req.getComment());
final Element element = getElement();
+ if (valuetime == null)
+ throw new InvalidTransferException("valuetime");
+ element.add(TransferGlobals.createAttribute(element, "valuetime", TimeTools.formatTimeStamp(valuetime)));
element.add(TransferGlobals.createAttribute(element, "sender", req.getFrom().getName()));
element.add(TransferGlobals.createAttribute(element, "reqid", req.getName()));
Index: TransferRequestBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/builders/TransferRequestBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TransferRequestBuilder.java 21 Nov 2003 04:43:03 -0000 1.4
--- TransferRequestBuilder.java 3 Jan 2004 20:36:25 -0000 1.5
***************
*** 31,34 ****
--- 31,39 ----
$Id$
$Log$
+ Revision 1.5 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.4 2003/11/21 04:43:03 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 72,80 ****
*/
public class TransferRequestBuilder extends TransferBuilder {
! public TransferRequestBuilder(final Asset asset, final Identity signer, final Identity to, final double amount, final Date valuetime, final String comment) throws InvalidTransferException, NegativeTransferException, NeuClearException {
! this(TransferGlobals.XFER_TAGNAME, asset, signer, to, amount, valuetime, comment);
}
! TransferRequestBuilder(final String tagname,final Asset asset, final Identity signer, final Identity to, final double amount, final Date valuetime, final String comment) throws InvalidTransferException, NegativeTransferException, NeuClearException {
! super(tagname, asset, signer, to, amount, valuetime, comment);
}
}
--- 77,85 ----
*/
public class TransferRequestBuilder extends TransferBuilder {
! public TransferRequestBuilder(final Asset asset, final Identity signer, final Identity to, final double amount, final String comment) throws InvalidTransferException, NegativeTransferException, NeuClearException {
! this(TransferGlobals.XFER_TAGNAME, asset, signer, to, amount, comment);
}
! TransferRequestBuilder(final String tagname,final Asset asset, final Identity signer, final Identity to, final double amount, final String comment) throws InvalidTransferException, NegativeTransferException, NeuClearException {
! super(tagname, asset, signer, to, amount, comment);
}
}
--- CancelHeldTransferBuilder.java DELETED ---
--- CancelHeldTransferReceiptBuilder.java DELETED ---
--- CancelHeldTransferRequestBuilder.java DELETED ---
--- CompleteHeldTransferRequestBuilder.java DELETED ---
--- HeldTransferReceiptBuilder.java DELETED ---
--- HeldTransferRequestBuilder.java DELETED ---
|