org.neuclear.asset.controllers.currency
Class CurrencyController

java.lang.Object
  extended by org.neuclear.asset.AssetController
      extended by org.neuclear.asset.controllers.currency.CurrencyController
All Implemented Interfaces:
org.neuclear.id.receiver.Receiver

public final class CurrencyController
extends AssetController

The CurrencyController is an AssetController implementation that manages an Electronic currency based on book entries.

The book entries are managed by NeuClear Ledger which by default uses a SQL database to store the entries.


Constructor Summary
CurrencyController(org.neuclear.ledger.LedgerController ledger, Asset asset, org.neuclear.commons.crypto.signers.Signer signer, java.lang.String alias)
           
 
Method Summary
 boolean canProcess(org.neuclear.id.Service asset)
          Verify that the assetName controller handles the given assetName
 Asset getAsset()
           
 AssetStatistics getStats()
           
 Balance process(BalanceRequest request)
           
 org.neuclear.exchange.orders.CancelExchangeReceipt process(org.neuclear.exchange.orders.CancelExchangeOrder cancel)
          Cancels a HeldTransfer.
 org.neuclear.exchange.orders.ExchangeCompletedReceipt process(org.neuclear.exchange.orders.ExchangeCompletionOrder complete)
          Completes a HeldTransfer.
 org.neuclear.exchange.orders.ExchangeOrderReceipt process(org.neuclear.exchange.orders.ExchangeOrder req)
          Creates a HeldTransfer.
 History process(HistoryRequest request)
           
 IssueReceipt process(IssueOrder req)
          Issues an asset.
 TransferReceipt process(TransferOrder req)
          Performs an assetName transfer.
 org.neuclear.id.Identity register(org.neuclear.id.Identity identity, java.lang.String source)
           
 
Methods inherited from class org.neuclear.asset.AssetController
receive, register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrencyController

public CurrencyController(org.neuclear.ledger.LedgerController ledger,
                          Asset asset,
                          org.neuclear.commons.crypto.signers.Signer signer,
                          java.lang.String alias)
                   throws org.neuclear.ledger.LowlevelLedgerException,
                          org.neuclear.commons.NeuClearException
Throws:
org.neuclear.ledger.LowlevelLedgerException
org.neuclear.commons.NeuClearException
Method Detail

register

public org.neuclear.id.Identity register(org.neuclear.id.Identity identity,
                                         java.lang.String source)
                                  throws LowLevelPaymentException
Specified by:
register in class AssetController
Throws:
LowLevelPaymentException

canProcess

public boolean canProcess(org.neuclear.id.Service asset)
Description copied from class: AssetController
Verify that the assetName controller handles the given assetName

Specified by:
canProcess in class AssetController
Returns:
true if able to process

process

public final TransferReceipt process(TransferOrder req)
                              throws InvalidTransferException,
                                     LowLevelPaymentException,
                                     TransferDeniedException,
                                     org.neuclear.commons.NeuClearException
Description copied from class: AssetController
Performs an assetName transfer.

Specified by:
process in class AssetController
Parameters:
req - TransferOrder
Returns:
Unsigned Receipt
Throws:
InvalidTransferException
LowLevelPaymentException
TransferDeniedException
org.neuclear.commons.NeuClearException

process

public IssueReceipt process(IssueOrder req)
                     throws LowLevelPaymentException,
                            TransferDeniedException,
                            InvalidTransferException,
                            org.neuclear.commons.NeuClearException
Issues an asset. Thus moving assets into circulation

Specified by:
process in class AssetController
Parameters:
req - IssueOrder
Returns:
Unsigned Receipt
Throws:
LowLevelPaymentException
TransferDeniedException
InvalidTransferException
org.neuclear.commons.NeuClearException

process

public final org.neuclear.exchange.orders.ExchangeOrderReceipt process(org.neuclear.exchange.orders.ExchangeOrder req)
                                                                throws InvalidTransferException,
                                                                       LowLevelPaymentException,
                                                                       TransferDeniedException,
                                                                       org.neuclear.commons.NeuClearException
Description copied from class: AssetController
Creates a HeldTransfer. This gives the recipient right within a limited period to "complete" the Transfer. Completion means performing the actual transfer with an amount up to but not greater than the amount set in the HeldTransfer Object.

Specified by:
process in class AssetController
Parameters:
req - Valid ExchangeOrder
Returns:
Unsigned ExchangeOrderReceiptBuilder
Throws:
InvalidTransferException
LowLevelPaymentException
TransferDeniedException
org.neuclear.commons.NeuClearException

process

public final org.neuclear.exchange.orders.ExchangeCompletedReceipt process(org.neuclear.exchange.orders.ExchangeCompletionOrder complete)
                                                                    throws LowLevelPaymentException,
                                                                           InvalidTransferException,
                                                                           TransferDeniedException,
                                                                           org.neuclear.commons.NeuClearException
Description copied from class: AssetController
Completes a HeldTransfer. This must be signed by the recipient of the HeldTransfer.

Specified by:
process in class AssetController
Returns:
Unsigned TransferReceiptBuilder
Throws:
LowLevelPaymentException
InvalidTransferException
TransferDeniedException - x
org.neuclear.commons.NeuClearException

process

public final org.neuclear.exchange.orders.CancelExchangeReceipt process(org.neuclear.exchange.orders.CancelExchangeOrder cancel)
                                                                 throws InvalidTransferException,
                                                                        LowLevelPaymentException,
                                                                        TransferDeniedException,
                                                                        org.neuclear.commons.NeuClearException
Description copied from class: AssetController
Cancels a HeldTransfer. This must be signed by the recipient of the HeldTransfer.

Specified by:
process in class AssetController
Returns:
Unsigned CancelExchangeReceiptBuilder
Throws:
InvalidTransferException
LowLevelPaymentException
TransferDeniedException
org.neuclear.commons.NeuClearException

getAsset

public Asset getAsset()
Specified by:
getAsset in class AssetController

getStats

public AssetStatistics getStats()
                         throws org.neuclear.ledger.LowlevelLedgerException
Specified by:
getStats in class AssetController
Throws:
org.neuclear.ledger.LowlevelLedgerException

process

public final Balance process(BalanceRequest request)
                      throws LowLevelPaymentException,
                             org.neuclear.id.InvalidNamedObjectException
Specified by:
process in class AssetController
Throws:
LowLevelPaymentException
org.neuclear.id.InvalidNamedObjectException

process

public final History process(HistoryRequest request)
                      throws LowLevelPaymentException,
                             org.neuclear.id.InvalidNamedObjectException
Specified by:
process in class AssetController
Throws:
LowLevelPaymentException
org.neuclear.id.InvalidNamedObjectException


Copyright © 2003-2004 Antilles Software Ventures SA. All Rights Reserved.