Search in sources :

Example 1 with DefaultAccountChangeEvent

use of org.killbill.billing.account.api.user.DefaultAccountChangeEvent in project killbill by killbill.

the class MockAccountDao method update.

@Override
public void update(final AccountModelDao account, final InternalCallContext context) {
    super.update(account, context);
    final AccountModelDao currentAccount = getById(account.getId(), context);
    final Long accountRecordId = getRecordId(account.getId(), context);
    final long tenantRecordId = context == null ? InternalCallContextFactory.INTERNAL_TENANT_RECORD_ID : context.getTenantRecordId();
    final AccountChangeInternalEvent changeEvent = new DefaultAccountChangeEvent(account.getId(), currentAccount, account, accountRecordId, tenantRecordId, UUID.randomUUID(), clock.getUTCNow());
    if (changeEvent.hasChanges()) {
        try {
            eventBus.post(changeEvent);
        } catch (final EventBusException ex) {
            Assert.fail(ex.toString());
        }
    }
}
Also used : AccountChangeInternalEvent(org.killbill.billing.events.AccountChangeInternalEvent) EventBusException(org.killbill.bus.api.PersistentBus.EventBusException) DefaultAccountChangeEvent(org.killbill.billing.account.api.user.DefaultAccountChangeEvent)

Aggregations

DefaultAccountChangeEvent (org.killbill.billing.account.api.user.DefaultAccountChangeEvent)1 AccountChangeInternalEvent (org.killbill.billing.events.AccountChangeInternalEvent)1 EventBusException (org.killbill.bus.api.PersistentBus.EventBusException)1