Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/exchange/orders
In directory sc8-pr-cvs1:/tmp/cvs-serv15193/src/java/org/neuclear/exchange/orders
Added Files:
CancelExchangeOrder.java CancelExchangeReceipt.java
ExchangeCompletionOrder.java ExchangeOrder.java
ExchangeOrderReceipt.java
Log Message:
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.
--- NEW FILE: CancelExchangeOrder.java ---
package org.neuclear.exchange.orders;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.Identity;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.SignedNamedCore;
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.contracts.Asset;
import java.sql.Timestamp;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 21, 2003
* 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;
}
public ExchangeOrderReceipt getExchangeReceipt(){
//TODO Implement
return null;
}
public String getExchangeid() {
return exchangeid;
}
private final String exchangeid;
}
--- NEW FILE: CancelExchangeReceipt.java ---
package org.neuclear.exchange.orders;
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.Identity;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.SignedNamedCore;
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.contracts.Asset;
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.exchange.orders.CancelExchangeOrder;
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{
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;
this.cancelid=cancelid;
}
public CancelExchangeOrder getCancellationOrder(){
//TODO implement
return null;
}
public CancelExchangeOrder getExchangeReceipt(){
//TODO implement
return null;
}
public Timestamp getCanceltime() {
return new Timestamp(canceltime);
}
public String getExchangeid() {
return exchangeid;
}
public String getCancelid() {
return cancelid;
}
private final long canceltime;
private final String exchangeid;
private final String cancelid;
}
--- NEW FILE: ExchangeCompletionOrder.java ---
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.TransferContract;
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.contracts.Asset;
import java.sql.Timestamp;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 21, 2003
* 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;
this.holdid = holdid;
this.counterpartyid = counterpartyid;
}
public Timestamp getValuetime() {
return new Timestamp(valuetime);
}
public double getAmount() {
return amount;
}
public String getHoldid() {
return holdid;
}
public String getCounterpartyid() {
return counterpartyid;
}
private final long valuetime;
private final double amount;
private final String holdid;
private final String counterpartyid;
}
--- NEW FILE: ExchangeOrder.java ---
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.TransferContract;
import org.neuclear.asset.orders.AssetTransactionContract;
import org.neuclear.asset.contracts.Asset;
import org.neuclear.exchange.contracts.ExchangeAgent;
import org.neuclear.exchange.contracts.ExchangeAgent;
import java.sql.Timestamp;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 30, 2003
* 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;
this.bidAmount = bid;
this.comment = (comment != null) ? comment : "";
this.expires = expires.getTime();
this.agent = agent;
}
public final Date getExpiry() {
return new Timestamp(expires);
}
public final Identity getBidder() {
return getSignatory();
}
public Asset getNeededAsset() {
return neededAsset;
}
public double getNeededAmount() {
return neededAmount;
}
public double getBidAmount() {
return bidAmount;
}
public String getComment() {
return comment;
}
public ExchangeAgent getAgent() {
return agent;
}
private final Asset neededAsset;
private final double neededAmount;
private final double bidAmount;
private final String comment;
private final long expires;
private final ExchangeAgent agent;
}
--- NEW FILE: ExchangeOrderReceipt.java ---
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;
import java.util.Date;
/**
* User: pelleb
* Date: Jul 30, 2003
* 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();
this.neededAsset = neededAsset;
this.neededAmount = neededAmount;
this.bidAmount = bidAmount;
this.comment = comment;
this.expires = expires.getTime();
}
public ExchangeOrder getExchangeOrder(){
//TODO Implement
return null;
}
public Identity getAgent() {
return agent;
}
public String getOrderid() {
return orderid;
}
public Timestamp getValuetime() {
return new Timestamp(valuetime);
}
public Asset getNeededAsset() {
return neededAsset;
}
public double getNeededAmount() {
return neededAmount;
}
public double getBidAmount() {
return bidAmount;
}
public String getComment() {
return comment;
}
public Timestamp getExpires() {
return new Timestamp(expires);
}
private final Identity agent;
private final String orderid;
private final long valuetime;
private final Asset neededAsset;
private final double neededAmount;
private final double bidAmount;
private final String comment;
private final long expires;
}
|