- return
- }
-
- val now = TimeHelpers.nowMillis()
- // TODO: Review this and its usage in user state.
- // TODO: The assumption is that the resource set increases all the time,
- // TODO: so the current map contains everything ever known (assuming we do not run backwards in time).
- val currentResourcesMap = aquarium.currentResourceTypesMap
-
- val nowBillingMonthInfo = BillingMonthInfo.fromMillis(now)
- val nowYear = nowBillingMonthInfo.year
- val nowMonth = nowBillingMonthInfo.month
-
- val eventOccurredMillis = rcEvent.getOccurredMillis
- val eventBillingMonthInfo = BillingMonthInfo.fromMillis(eventOccurredMillis)
- val eventYear = eventBillingMonthInfo.year
- val eventMonth = eventBillingMonthInfo.month
-
- def computeBatch(): Unit = {
- DEBUG("Going for out of sync charging for %s", rcEvent.getOriginalID)
- this._userState = chargingService.replayMonthChargingUpTo(
- nowBillingMonthInfo,
- // Take into account that the event may be out-of-sync.
- // TODO: Should we use this._latestResourceEventOccurredMillis instead of now?
- now max eventOccurredMillis,
- this._userStateBootstrap,
- currentResourcesMap,
- stdUserStateStoreFunc
- )
-
- updateLatestResourceEventIDFrom(rcEvent)
- }
+ chargingService.processResourceEvent(
+ rcEvent.getReceivedMillis,
+ rcEvent,
+ this._userStateModel,
+ aquarium.currentResourceMapping,
+ true
+ )