|
|
@ -188,7 +188,14 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> { |
|
|
|
throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); |
|
|
|
throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
schemaTimes.add(text); |
|
|
|
if (checkCornTimeInterval(text)) { |
|
|
|
|
|
|
|
schemaTimes.add(text); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short")); |
|
|
|
|
|
|
|
this.schemaTimeCheckTips.setVisible(true); |
|
|
|
|
|
|
|
throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Collections.addAll(schemaTimes, text.split(",")); |
|
|
|
Collections.addAll(schemaTimes, text.split(",")); |
|
|
|
} |
|
|
|
} |
|
|
@ -233,6 +240,17 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean checkCornTimeInterval (String cronText) { |
|
|
|
|
|
|
|
// 判断后两次更新时间间隔,如果小于1分钟就返回false
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
CronExpression cron = new CronExpression(cronText); |
|
|
|
|
|
|
|
Date next1 = cron.getNextValidTimeAfter(new Date()); |
|
|
|
|
|
|
|
Date next2 = cron.getNextValidTimeAfter(next1); |
|
|
|
|
|
|
|
return next2.getTime() - next1.getTime() >= CacheConstants.MILLIS_OF_MINUTE; |
|
|
|
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected String title4PopupWindow() { |
|
|
|
protected String title4PopupWindow() { |
|
|
|
return InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Strategy_Config_Title"); |
|
|
|
return InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Strategy_Config_Title"); |
|
|
|