|
From: <pe...@us...> - 2003-11-20 23:40:53
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv30972/src/java/org/neuclear/asset/contracts/builders
Modified Files:
AssetBuilder.java
Log Message:
Getting all the tests to work in id
Removing usage of BC in CryptoTools as it was causing issues.
First version of EntityLedger that will use OFB's EntityEngine. This will allow us to support a vast amount databases without
writing SQL. (Yipee)
Index: AssetBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/builders/AssetBuilder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AssetBuilder.java 11 Nov 2003 21:17:19 -0000 1.2
--- AssetBuilder.java 20 Nov 2003 23:40:50 -0000 1.3
***************
*** 2,18 ****
import org.dom4j.Element;
- import org.neuclear.id.builders.NamedObjectBuilder;
- import org.neuclear.id.builders.IdentityBuilder;
- import org.neuclear.id.Identity;
- import org.neuclear.id.NSTools;
- import org.neuclear.asset.contracts.TransferGlobals;
import org.neuclear.asset.contracts.Asset;
import org.neuclear.asset.contracts.AssetGlobals;
! import org.neuclear.asset.NegativeTransferException;
! import org.neuclear.asset.InvalidTransferException;
! import org.neuclear.commons.time.TimeTools;
! import org.neuclear.commons.Utility;
! import java.util.Date;
import java.security.PublicKey;
--- 2,16 ----
import org.dom4j.Element;
import org.neuclear.asset.contracts.Asset;
import org.neuclear.asset.contracts.AssetGlobals;
! import org.neuclear.commons.NeuClearException;
! import org.neuclear.commons.crypto.signers.JCESigner;
! import org.neuclear.commons.crypto.signers.TestCaseSigner;
! import org.neuclear.id.builders.IdentityBuilder;
! import org.neuclear.store.FileStore;
! import org.neuclear.store.Store;
! import org.neuclear.xml.XMLException;
! import java.security.GeneralSecurityException;
import java.security.PublicKey;
***************
*** 37,40 ****
--- 35,44 ----
$Id$
$Log$
+ Revision 1.3 2003/11/20 23:40:50 pelle
+ Getting all the tests to work in id
+ Removing usage of BC in CryptoTools as it was causing issues.
+ First version of EntityLedger that will use OFB's EntityEngine. This will allow us to support a vast amount databases without
+ writing SQL. (Yipee)
+
Revision 1.2 2003/11/11 21:17:19 pelle
Further vital reshuffling.
***************
*** 80,87 ****
* Time: 3:13:27 PM
*/
! public abstract class AssetBuilder extends IdentityBuilder {
/**
* Used to create new Assets
! *
* @param name The Name of Identity
* @param allow PublicKey allowed to sign in here
--- 84,91 ----
* Time: 3:13:27 PM
*/
! public class AssetBuilder extends IdentityBuilder {
/**
* Used to create new Assets
! *
* @param name The Name of Identity
* @param allow PublicKey allowed to sign in here
***************
*** 90,103 ****
* @param receiver URL of default receiver for namespace
* @param controller URL of AssetController This should be a http web url
! * @param decimal The amount of decimal points.
! * @param minimum Minimum transaction size
*/
! public AssetBuilder(String name, PublicKey allow, String repository, String signer, String logger, String receiver,String controller, int decimal, double minimum) {
super(AssetGlobals.createQName(AssetGlobals.ASSET_TAGNAME), name, allow, repository, signer, logger, receiver);
! Element elem=getElement();
! AssetGlobals.createAttribute(elem,"controller",controller);
! AssetGlobals.createAttribute(elem,"decimalpoints",Integer.toString(decimal));
! AssetGlobals.createAttribute(elem,"minimumxact",Double.toString(minimum));
}
}
--- 94,136 ----
* @param receiver URL of default receiver for namespace
* @param controller URL of AssetController This should be a http web url
! * @param decimal The amount of decimal points.
! * @param minimum Minimum transaction size
*/
! public AssetBuilder(String name, PublicKey allow, String repository, String signer, String logger, String receiver, String controller, int decimal, double minimum) {
super(AssetGlobals.createQName(AssetGlobals.ASSET_TAGNAME), name, allow, repository, signer, logger, receiver);
! Element elem = getElement();
! AssetGlobals.createAttribute(elem, "controller", controller);
! AssetGlobals.createAttribute(elem, "decimalpoints", Integer.toString(decimal));
! AssetGlobals.createAttribute(elem, "minimumxact", Double.toString(minimum));
!
! }
!
! public static void main(String args[]) {
! try {
! JCESigner signer = new TestCaseSigner();
! String assetname = "neu://test/bux";
! if (args.length > 0)
! assetname = args[0];
+ AssetBuilder assetraw = new AssetBuilder(assetname,
+ signer.getPublicKey(assetname),
+ "http://repository.neuclear.org/",
+ "http://bux.neuclear.org:8080",
+ "http://logger.neuclear.org",
+ "http://bux.neuclear.org:8080",
+ "http://bux.neuclear.org:8080",
+ 2,
+ 0.01
+ );
+ Asset asset = (Asset) assetraw.sign(signer);
+ Store store = new FileStore("target/testdata/assets");
+ store.receive(asset);
+ } catch (GeneralSecurityException e) {
+ e.printStackTrace();
+ } catch (NeuClearException e) {
+ e.printStackTrace();
+ } catch (XMLException e) {
+ e.printStackTrace();
+ }
}
}
|