2 Revize

Autor SHA1 Zpráva Datum
  ymlam bb665f8e67 Allow communication engines to deny resume by clock před 1 rokem
  ymlam 45dafcbd73 Reset jobStatus to null on rescheduling a job. před 1 rokem
1 změnil soubory, kde provedl 7 přidání a 11 odebrání
  1. +7
    -11
      src/main/java/altk/comm/engine/Broadcast.java

+ 7
- 11
src/main/java/altk/comm/engine/Broadcast.java Zobrazit soubor

@@ -1020,12 +1020,9 @@ public abstract class Broadcast
protected String resume(String reason) { protected String resume(String reason) {
if (reason == ACTION_BY_CLOCK) { if (reason == ACTION_BY_CLOCK) {
boolean inAcceptqble = false;
if (this.reason == null) return null; if (this.reason == null) return null;
for (String acceptable : getPauseModesResumableByClock()) {
if (this.reason.equalsIgnoreCase(acceptable)) inAcceptqble = true;
}
if (!inAcceptqble) return null;
boolean reason_is_ok = this.reason == ACTION_BY_CLOCK || !child_denies_resume_by_clock();
if (!reason_is_ok) return null;
} }
if (!withinOperatingHours()) return "Cannot resume outside operating hours"; if (!withinOperatingHours()) return "Cannot resume outside operating hours";
@@ -1039,17 +1036,15 @@ public abstract class Broadcast
case SUCCESS: case SUCCESS:
resumeFlag.notifyAll(); resumeFlag.notifyAll();
return "Broadcast resumed"; return "Broadcast resumed";
case NO_CHANGE:
default: default:
return null; return null;
} }
} }
} }
/** derived class may override by adding more modes */
protected List<String> getPauseModesResumableByClock() {
Vector<String> modes = new Vector<String>();
modes.add(ACTION_BY_CLOCK);
return modes;
protected boolean child_denies_resume_by_clock() {
return false;
} }
/** /**
@@ -1303,6 +1298,7 @@ public abstract class Broadcast
return null; return null;
} }
job.jobStatus = null;
job.errorText = ""; job.errorText = "";
if (rescheduleTimeMS == 0) if (rescheduleTimeMS == 0)
{ {
@@ -1490,7 +1486,7 @@ public abstract class Broadcast
public boolean setJobStatus(Job job, JobStatus status) { public boolean setJobStatus(Job job, JobStatus status) {
if (job.statusIsFinal()) { if (job.statusIsFinal()) {
myLogger.warn("Forbidden ttempt to overwrite a final job status '" + job.jobStatus + "' with '" + status + "'", new Exception("info"));
myLogger.warn("Forbidden to overwrite a final job status '" + job.jobStatus + "' with '" + status + "'", new Exception("info"));
return false; return false;
} }
job.setStatus(status); job.setStatus(status);


Načítá se…
Zrušit
Uložit