org.powertac.common
Class TransactionFactory

java.lang.Object
  extended by org.powertac.common.TransactionFactory

@Scope(value="singleton")
@Service
public class TransactionFactory
extends Object

Constructs transaction objects in a way that guarantees that the correct data goes into the state log, without requiring unnecessary couplings on the part of transaction sources. Each method constructs a new transaction for the given broker and arguments and returns it. There is no attempt to cache them or look them up.

Author:
John Collins

Constructor Summary
TransactionFactory()
           
 
Method Summary
 org.powertac.common.BalancingTransaction makeBalancingTransaction(org.powertac.common.Broker broker, double kWh, double charge)
           
 org.powertac.common.BankTransaction makeBankTransaction(org.powertac.common.Broker broker, double amount)
           
 org.powertac.common.CashPosition makeCashPosition(org.powertac.common.Broker broker, double balance)
           
 org.powertac.common.DistributionTransaction makeDistributionTransaction(org.powertac.common.Broker broker, double kWh, double charge)
           
 org.powertac.common.MarketTransaction makeMarketTransaction(org.powertac.common.Broker broker, org.powertac.common.Timeslot timeslot, double mWh, double price)
           
 org.powertac.common.TariffTransaction makeTariffTransaction(org.powertac.common.Broker broker, org.powertac.common.TariffTransaction.Type txType, org.powertac.common.TariffSpecification spec, org.powertac.common.CustomerInfo customer, int customerCount, double kWh, double charge)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionFactory

public TransactionFactory()
Method Detail

makeBankTransaction

public org.powertac.common.BankTransaction makeBankTransaction(org.powertac.common.Broker broker,
                                                               double amount)

makeBalancingTransaction

public org.powertac.common.BalancingTransaction makeBalancingTransaction(org.powertac.common.Broker broker,
                                                                         double kWh,
                                                                         double charge)

makeCashPosition

public org.powertac.common.CashPosition makeCashPosition(org.powertac.common.Broker broker,
                                                         double balance)

makeDistributionTransaction

public org.powertac.common.DistributionTransaction makeDistributionTransaction(org.powertac.common.Broker broker,
                                                                               double kWh,
                                                                               double charge)

makeMarketTransaction

public org.powertac.common.MarketTransaction makeMarketTransaction(org.powertac.common.Broker broker,
                                                                   org.powertac.common.Timeslot timeslot,
                                                                   double mWh,
                                                                   double price)

makeTariffTransaction

public org.powertac.common.TariffTransaction makeTariffTransaction(org.powertac.common.Broker broker,
                                                                   org.powertac.common.TariffTransaction.Type txType,
                                                                   org.powertac.common.TariffSpecification spec,
                                                                   org.powertac.common.CustomerInfo customer,
                                                                   int customerCount,
                                                                   double kWh,
                                                                   double charge)


Copyright © 2013 Power TAC. All Rights Reserved.