Class MessageHandler
- java.lang.Object
-
- org.powertac.visualizer.service_ptac.MessageHandler
-
@Service public class MessageHandler extends Object
This is an implementation of the Initializable interface. It will be initialized upon startup and registered for handling Power TAC messages in case there are proper method signatures, e.g., "handleMessage(VizCompetition competition)". intended for the Visualizer.- Author:
- Jurica Babic, Govert Buijs, Erik Kemperman
-
-
Constructor Summary
Constructors Constructor Description MessageHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleMessage(CashPosition cp)CashPosition is the last message sent by Accounting.voidhandleMessage(Competition c)voidhandleMessage(MarketTransaction mtx)Handles a wholesale MarketTransactionvoidhandleMessage(CustomerBootstrapData cbd)voidhandleMessage(SimEnd se)Receives the SimEnd message, which ends the broker session.voidhandleMessage(SimPause sp)Receives the SimPause message, used to pause the clock.voidhandleMessage(SimResume sr)Receives the SimResume message, used to update the clock.voidhandleMessage(SimStart ss)Receives the SimStart message, used to start the clock.voidhandleMessage(TariffRevoke tr)Handles a TariffRevoke message from the server, indicating that some tariff has been revoked.voidhandleMessage(TimeslotUpdate tu)Updates the sim clock on receipt of the TimeslotUpdate message, which should be the first to arrive in each timeslot.voidhandleMessage(TariffSpecification spec)Handles a TariffSpecification.voidhandleMessage(TariffTransaction ttx)Handles a TariffTransaction.voidinitialize()
-
-
-
Field Detail
-
pusher
@Autowired public Pusher pusher
-
-
Method Detail
-
initialize
public void initialize()
-
handleMessage
public void handleMessage(Competition c)
-
handleMessage
public void handleMessage(SimPause sp)
Receives the SimPause message, used to pause the clock. While the clock is paused, the broker needs to ignore the local clock.
-
handleMessage
public void handleMessage(SimResume sr)
Receives the SimResume message, used to update the clock.
-
handleMessage
public void handleMessage(SimStart ss)
Receives the SimStart message, used to start the clock. The server's clock offset is subtracted from the start time indicated by the server.
-
handleMessage
public void handleMessage(SimEnd se)
Receives the SimEnd message, which ends the broker session.
-
handleMessage
public void handleMessage(TimeslotUpdate tu)
Updates the sim clock on receipt of the TimeslotUpdate message, which should be the first to arrive in each timeslot.
-
handleMessage
public void handleMessage(CustomerBootstrapData cbd)
-
handleMessage
public void handleMessage(CashPosition cp)
CashPosition is the last message sent by Accounting. This is normally when any broker would submit its bids, so that's when this VizBroker will do it.
-
handleMessage
public void handleMessage(TariffSpecification spec)
Handles a TariffSpecification. These are sent by the server when new tariffs are published. If it's not ours, then it's a competitor's tariff. We keep track of competing tariffs locally, and we also store them in the tariffRepo.
-
handleMessage
public void handleMessage(TariffTransaction ttx)
Handles a TariffTransaction. We only care about certain types: PRODUCE, CONSUME, SIGNUP, and WITHDRAW.
-
handleMessage
public void handleMessage(TariffRevoke tr)
Handles a TariffRevoke message from the server, indicating that some tariff has been revoked.
-
handleMessage
public void handleMessage(MarketTransaction mtx)
Handles a wholesale MarketTransaction
-
-