Package org.powertac.common
Class TransactionFactory
- java.lang.Object
- 
- org.powertac.common.TransactionFactory
 
- 
 @Scope("singleton") @Service public class TransactionFactory extends ObjectConstructs 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 SummaryConstructors Constructor Description TransactionFactory()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description BalancingTransactionmakeBalancingTransaction(Broker broker, double kWh, double charge)BankTransactionmakeBankTransaction(Broker broker, double amount)CapacityTransactionmakeCapacityTransaction(Broker broker, int peakTimeslot, double threshold, double kWh, double fee)CashPositionmakeCashPosition(Broker broker, double balance)DistributionTransactionmakeDistributionTransaction(Broker broker, int nSmall, int nLarge, double transport, double distroCharge)MarketTransactionmakeMarketTransaction(Broker broker, Timeslot timeslot, double mWh, double price)TariffTransactionmakeTariffTransaction(Broker broker, TariffTransaction.Type txType, TariffSpecification spec, CustomerInfo customer, int customerCount, double kWh, double charge)Creates a tariff transaction that is not a regulation transaction.TariffTransactionmakeTariffTransaction(Broker broker, TariffTransaction.Type txType, TariffSpecification spec, CustomerInfo customer, int customerCount, double kWh, double charge, boolean isRegulation)Creates a tariff transaction that could be a regulation transaction, depending on the value of the isRegulation parameter.
 
- 
- 
- 
Method Detail- 
makeBankTransactionpublic BankTransaction makeBankTransaction(Broker broker, double amount) 
 - 
makeBalancingTransactionpublic BalancingTransaction makeBalancingTransaction(Broker broker, double kWh, double charge) 
 - 
makeCashPositionpublic CashPosition makeCashPosition(Broker broker, double balance) 
 - 
makeDistributionTransactionpublic DistributionTransaction makeDistributionTransaction(Broker broker, int nSmall, int nLarge, double transport, double distroCharge) 
 - 
makeMarketTransactionpublic MarketTransaction makeMarketTransaction(Broker broker, Timeslot timeslot, double mWh, double price) 
 - 
makeTariffTransactionpublic TariffTransaction makeTariffTransaction(Broker broker, TariffTransaction.Type txType, TariffSpecification spec, CustomerInfo customer, int customerCount, double kWh, double charge) Creates a tariff transaction that is not a regulation transaction.
 - 
makeTariffTransactionpublic TariffTransaction makeTariffTransaction(Broker broker, TariffTransaction.Type txType, TariffSpecification spec, CustomerInfo customer, int customerCount, double kWh, double charge, boolean isRegulation) Creates a tariff transaction that could be a regulation transaction, depending on the value of the isRegulation parameter.
 - 
makeCapacityTransactionpublic CapacityTransaction makeCapacityTransaction(Broker broker, int peakTimeslot, double threshold, double kWh, double fee) 
 
- 
 
-