- All Implemented Interfaces:
public class ExpandRecurringBillingEventsPipeline extends java.lang.Object implements java.io.SerializableDefinition of a Dataflow Flex pipeline template, which expands
BillingEvent.OneTimewhen an autorenew occurs within the given time frame.
This pipeline works in three stages:
- Gather the
BillingEvent.Recurrings that are in scope for expansion. The exact condition of
BillingEvent.Recurrings to include can be found in
- Expand the
DomainHistory) that fall within the [
endTime) window, excluding those that are already present (to make this pipeline idempotent when running with the same parameters multiple times, either in parallel or in sequence). The
BillingEvent.Recurringis also updated with the information on when it was last expanded, so it would not be in scope for expansion until at least a year later.
- If the cursor for billing events should be advanced, advance it to
endTimeafter all of the expansions in the previous step is done, only when it is currently at
Note that the creation of new
DomainHistoryis done speculatively as soon as its event time is in scope for expansion (i.e. within the window of operation). If a domain is subsequently cancelled during the autorenew grace period, a
BillingEvent.Cancellationwould have been created to cancel the
BillingEvent.OneTimeout. Similarly, a
DomainHistoryfor the delete will be created which negates the effect of the speculatively created
DomainHistory, specifically for the transaction records. Both the
DomainHistorywill only be used (and cancelled out) when the billing time becomes effective, which is after the grace period, when the cancellations would have been written, if need be. This is no different from what we do with manual renewals or normal creates, where entities are always created for the action regardless of whether their effects will be negated later due to subsequent actions within respective grace periods.
To stage this template locally, run
./nom_build :core:sBP --environment=alpha \ --pipeline=expandBilling.
Then, you can run the staged template via the API client library, gCloud or a raw REST call.
- See Also:
BillingEvent.Cancellation.forGracePeriod(google.registry.model.domain.GracePeriod, org.joda.time.DateTime, google.registry.model.reporting.HistoryEntry.HistoryEntryId, java.lang.String),
DomainFlowUtils.createCancelingRecords(google.registry.model.domain.Domain, org.joda.time.DateTime, org.joda.time.Duration, com.google.common.collect.ImmutableSet<google.registry.model.reporting.DomainTransactionRecord.TransactionReportField>), Using Flex Templates, Serialized Form
All Methods Static Methods Concrete Methods Modifier and Type Method Description