-
Notifications
You must be signed in to change notification settings - Fork 36
Tariff publication story
jecollins edited this page Mar 4, 2011
·
7 revisions
A broker may add a new Tariff or modify an existing one at any time. This story deals with the TariffMarket and associated server components that deal with the incoming message traffic about tariffs.
- TariffSpecification and its associated Rates and HourlyCharges represent new tariffs. Each one is validated, wrapped with a Tariff, and stored in the database.
- TariffExpire represents a change in the expiration of an existing tariff. If the message is valid, and refers to a valid Tariff, then the expiration date of that Tariff is updated. If the Instant given in the TariffExpire message is null, then the expiration instant is set to the current simulation time.
- TariffRevoke represents the immediate revocation of a tariff. If the message is valid and refers to a valid Tariff, then that Tariff is revoked immediately. This is done by marking the Tariff as KILLED. Periodically, the Customer must call the getRevokedSubscriptions() method on the TariffMarket, and then call handleRevokedTariff on each returned subscription. This work is delegated to the Customer in order to allow the Customer to know which Tariffs were revoked and respond accordingly.
- VariableRateUpdate represents setting a price on a future timeslot for a variable Rate on some Tariff. The message is validated, and the rate set.
- getActiveTariffList(powerType) returns the unexpired tariffs available for the given PowerType.
- getRevokedSubscriptionList(customerInfo) returns the customer's TariffSubscriptions that are connected to revoked Tariffs and which have non-zero customer counts.
- getDefaultTariff(powerType) returns the default tariff for the given PowerType. This is used by the handleRevokedTariff method on TariffSubscriptions, and may also be used by Customers to compare the terms of the default Tariff with other tariffs.
- setDefaultTariff(tariff) is used by the default Broker to post the default tariffs.