}
if (triggerExpression != null && trigger == null) {
if (triggerExpression.startsWith("fixed-delay:")) {
long delay = Long.parseLong(triggerExpression.split(":")[1]);
PeriodicTrigger periodicTrigger = new PeriodicTrigger(delay);
periodicTrigger.setFixedRate(false);
trigger = periodicTrigger;
}
}
if (triggerExpression != null && trigger == null) {
if (triggerExpression.startsWith("fixed-rate:")) {
long delay = Long.parseLong(triggerExpression.split(":")[1]);
PeriodicTrigger periodicTrigger = new PeriodicTrigger(delay);
periodicTrigger.setFixedRate(true);
trigger = periodicTrigger;
}
}
if (triggerExpression != null && trigger == null) {
if ("never".equals(triggerExpression)) {
trigger = new NeverTrigger();
}
}
if (triggerExpression != null && trigger == null) {
if ("once".equals(triggerExpression)) {
trigger = new OnceTrigger();
}
}
if (triggerExpression != null && trigger == null) {
if (triggerExpression.startsWith("once-after:")) {
long delay = Long.parseLong(triggerExpression.split(":")[1]);
OnceTrigger onceTrigger = new OnceTrigger();
onceTrigger.setAfter(delay);
trigger = onceTrigger;
}
}
if (triggerExpression != null && trigger == null) {
try {
if (triggerExpression.startsWith("every:")) {
String[] tokens = triggerExpression.split(":");
long delay = Long.parseLong(tokens[1].substring(0, tokens[1].length() - 3));
String unit = tokens[1].substring(tokens[1].length() - 3);
Integer mult = null;
switch (unit) {
case "sec":
mult = 1000;
break;
case "min":
mult = 60 * 1000;
break;
default:
// not supported time
}
if (mult != null) {
PeriodicTrigger pt = new PeriodicTrigger(delay * mult);
pt.setFixedRate(true);
trigger = pt;
}
}
} catch (Exception e) {