@Override public OverdueState findState(final String stateName) throws OverdueApiException { if (stateName.equals(DefaultBlockingState.CLEAR_STATE_NAME)) { return clearState; } for (final DefaultOverdueState state : getStates()) { if (state.getName().equals(stateName)) { return state; } } throw new OverdueApiException(ErrorCode.CAT_NO_SUCH_OVEDUE_STATE, stateName); }
private void set_AUTO_INVOICE_OFF_on_blockedBilling(final UUID accountId, final InternalCallContext context) throws OverdueApiException { try { tagApi.addTag(accountId, ObjectType.ACCOUNT, ControlTagType.AUTO_INVOICING_OFF.getId(), context); } catch (TagApiException e) { throw new OverdueApiException(e); } }
@Override public Period getReevaluationInterval() throws OverdueApiException { if (autoReevaluationInterval == null || autoReevaluationInterval.getUnit() == TimeUnit.UNLIMITED || autoReevaluationInterval.getNumber() == 0) { throw new OverdueApiException(ErrorCode.OVERDUE_NO_REEVALUATION_INTERVAL, name); } return autoReevaluationInterval.toJodaPeriod(); }
private void remove_AUTO_INVOICE_OFF_on_clear(final UUID accountId, final InternalCallContext context) throws OverdueApiException { try { tagApi.removeTag(accountId, ObjectType.ACCOUNT, ControlTagType.AUTO_INVOICING_OFF.getId(), context); } catch (TagApiException e) { if (e.getCode() != ErrorCode.TAG_DOES_NOT_EXIST.getCode()) { throw new OverdueApiException(e); } } }