public DefaultImmutableAccountData(final AccountModelDao account) { this(account.getId(), account.getExternalKey(), account.getCurrency(), account.getTimeZone(), AccountDateTimeUtils.getFixedOffsetTimeZone(account), account.getReferenceTime()); }
if (referenceTime != null && currentAccount.getReferenceTime().withMillisOfDay(0).compareTo(referenceTime.withMillisOfDay(0)) != 0) { throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account referenceTime: new=%s, current=%s", referenceTime, currentAccount.getReferenceTime()));
@Override public void create(final AccountModelDao entity, final InternalCallContext context) throws AccountApiException { // We don't enforce the created_date for the Account because it is extracted from context // so, if there is no referenceTime specified we have to set it from the InternalCallContext#created_date // if (entity.getReferenceTime() == null) { entity.setReferenceTime(context.getCreatedDate()); } final AccountModelDao refreshedEntity = transactionalSqlDao.execute(false, getCreateEntitySqlDaoTransactionWrapper(entity, context)); // Populate the caches only after the transaction has been committed, in case of rollbacks transactionalSqlDao.populateCaches(refreshedEntity); // Eagerly populate the account-immutable cache as well accountImmutableCacheController.putIfAbsent(refreshedEntity.getRecordId(), new DefaultImmutableAccountData(refreshedEntity)); }
public DefaultAccountData(final AccountModelDao d) { this(d.getExternalKey(), d.getName(), d.getFirstNameLength(), d.getEmail(), d.getBillingCycleDayLocal(), d.getCurrency() != null ? d.getCurrency().name() : null, d.getParentAccountId(), d.getIsPaymentDelegatedToParent(), d.getPaymentMethodId(), d.getReferenceTime() != null ? d.getReferenceTime().toString() : null, d.getTimeZone() != null ? d.getTimeZone().getID() : null, d.getLocale(), d.getAddress1(), d.getAddress2(), d.getCompanyName(), d.getCity(), d.getStateOrProvince(), d.getPostalCode(), d.getCountry(), d.getPhone(), d.getNotes(), d.getMigrated()); }
public DefaultAccount(final AccountModelDao accountModelDao) { this(accountModelDao.getId(), accountModelDao.getCreatedDate(), accountModelDao.getUpdatedDate(), accountModelDao.getExternalKey(), accountModelDao.getEmail(), accountModelDao.getName(), accountModelDao.getFirstNameLength(), accountModelDao.getCurrency(), accountModelDao.getParentAccountId(), accountModelDao.getIsPaymentDelegatedToParent(), accountModelDao.getBillingCycleDayLocal(), accountModelDao.getPaymentMethodId(), accountModelDao.getReferenceTime(), accountModelDao.getTimeZone(), accountModelDao.getLocale(), accountModelDao.getAddress1(), accountModelDao.getAddress2(), accountModelDao.getCompanyName(), accountModelDao.getCity(), accountModelDao.getStateOrProvince(), accountModelDao.getCountry(), accountModelDao.getPostalCode(), accountModelDao.getPhone(), accountModelDao.getNotes(), accountModelDao.getMigrated()); }
if (referenceTime != null && currentAccount.getReferenceTime().withMillisOfDay(0).compareTo(referenceTime.withMillisOfDay(0)) != 0) { throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account referenceTime: new=%s, current=%s", referenceTime, currentAccount.getReferenceTime()));
public DefaultImmutableAccountData(final AccountModelDao account) { this(account.getId(), account.getExternalKey(), account.getCurrency(), account.getTimeZone(), AccountDateTimeUtils.getFixedOffsetTimeZone(account), account.getReferenceTime()); }
@Override public void create(final AccountModelDao entity, final InternalCallContext context) throws AccountApiException { // We don't enforce the created_date for the Account because it is extracted from context // so, if there is no referenceTime specified we have to set it from the InternalCallContext#created_date // if (entity.getReferenceTime() == null) { entity.setReferenceTime(context.getCreatedDate()); } final AccountModelDao refreshedEntity = transactionalSqlDao.execute(false, getCreateEntitySqlDaoTransactionWrapper(entity, context)); // Populate the caches only after the transaction has been committed, in case of rollbacks transactionalSqlDao.populateCaches(refreshedEntity); // Eagerly populate the account-immutable cache as well accountImmutableCacheController.putIfAbsent(refreshedEntity.getRecordId(), new DefaultImmutableAccountData(refreshedEntity)); }
public DefaultAccountData(final AccountModelDao d) { this(d.getExternalKey(), d.getName(), d.getFirstNameLength(), d.getEmail(), d.getBillingCycleDayLocal(), d.getCurrency() != null ? d.getCurrency().name() : null, d.getParentAccountId(), d.getIsPaymentDelegatedToParent(), d.getPaymentMethodId(), d.getReferenceTime() != null ? d.getReferenceTime().toString() : null, d.getTimeZone() != null ? d.getTimeZone().getID() : null, d.getLocale(), d.getAddress1(), d.getAddress2(), d.getCompanyName(), d.getCity(), d.getStateOrProvince(), d.getPostalCode(), d.getCountry(), d.getPhone(), d.getNotes(), d.getMigrated()); }
public DefaultAccount(final AccountModelDao accountModelDao) { this(accountModelDao.getId(), accountModelDao.getCreatedDate(), accountModelDao.getUpdatedDate(), accountModelDao.getExternalKey(), accountModelDao.getEmail(), accountModelDao.getName(), accountModelDao.getFirstNameLength(), accountModelDao.getCurrency(), accountModelDao.getParentAccountId(), accountModelDao.getIsPaymentDelegatedToParent(), accountModelDao.getBillingCycleDayLocal(), accountModelDao.getPaymentMethodId(), accountModelDao.getReferenceTime(), accountModelDao.getTimeZone(), accountModelDao.getLocale(), accountModelDao.getAddress1(), accountModelDao.getAddress2(), accountModelDao.getCompanyName(), accountModelDao.getCity(), accountModelDao.getStateOrProvince(), accountModelDao.getCountry(), accountModelDao.getPostalCode(), accountModelDao.getPhone(), accountModelDao.getNotes(), accountModelDao.getMigrated()); }