Search in sources :

Example 1 with ApplicationSettingForEstatio

use of org.estatio.module.settings.dom.ApplicationSettingForEstatio in project estatio by estatio.

the class LeaseInvoicingSettingsService method updateEpochDate.

/**
 * @see LeaseInvoicingSettingKey#epochDate
 */
@Programmatic
public void updateEpochDate(final LocalDate newEpochDate) {
    // getApplicationSettings().installDefaultsIfRequired();
    final ApplicationSettingForEstatio setting = (ApplicationSettingForEstatio) applicationSettingsService.find(LeaseInvoicingSettingKey.epochDate);
    if (setting != null) {
        if (newEpochDate != null) {
            setting.updateAsLocalDate(newEpochDate);
        } else {
            setting.delete();
        }
    } else {
        if (newEpochDate != null) {
            applicationSettingsService.newLocalDate(ApplicationSettingCreator.Helper.getKey(LeaseInvoicingSettingKey.epochDate), "Cutover date to Estatio", newEpochDate);
        }
    // else no-op
    }
    cachedEpochDate = null;
}
Also used : ApplicationSettingForEstatio(org.estatio.module.settings.dom.ApplicationSettingForEstatio) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 2 with ApplicationSettingForEstatio

use of org.estatio.module.settings.dom.ApplicationSettingForEstatio in project estatio by estatio.

the class ReplayCommandExecutionControllerUsingSettings method getApplicationSetting.

private ApplicationSettingForEstatio getApplicationSetting() {
    ApplicationSetting setting = applicationSettingsService.find(KEY);
    if (setting == null) {
        final State initialState = State.PAUSED;
        setting = applicationSettingsService.newString(KEY, "Controls whether ReplayCommandExecution quartz job runs or pauses", initialState.name());
    }
    return (ApplicationSettingForEstatio) setting;
}
Also used : ApplicationSetting(org.estatio.module.settings.dom.ApplicationSetting) ApplicationSettingForEstatio(org.estatio.module.settings.dom.ApplicationSettingForEstatio)

Aggregations

ApplicationSettingForEstatio (org.estatio.module.settings.dom.ApplicationSettingForEstatio)2 Programmatic (org.apache.isis.applib.annotation.Programmatic)1 ApplicationSetting (org.estatio.module.settings.dom.ApplicationSetting)1