|
|
|
@@ -19,6 +19,7 @@ import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
import org.apache.log4j.Logger; |
|
|
|
|
|
|
|
import altk.comm.engine.Job.JobStatus; |
|
|
|
import altk.comm.engine.exception.BroadcastError; |
|
|
|
import altk.comm.engine.exception.BroadcastException; |
|
|
|
import altk.comm.engine.exception.EngineException; |
|
|
|
@@ -79,6 +80,9 @@ public abstract class Broadcast |
|
|
|
private Integer transactions; |
|
|
|
|
|
|
|
private Integer serviceActivityCount; |
|
|
|
|
|
|
|
/** Running count of successful jobs */ |
|
|
|
private int successCount; |
|
|
|
|
|
|
|
|
|
|
|
public static enum BroadcastState |
|
|
|
@@ -812,7 +816,7 @@ public abstract class Broadcast |
|
|
|
|
|
|
|
/** |
|
|
|
* Defaults to current state |
|
|
|
* @return |
|
|
|
* @return XML string |
|
|
|
*/ |
|
|
|
protected String mkStatusReport() |
|
|
|
{ |
|
|
|
@@ -851,14 +855,26 @@ public abstract class Broadcast |
|
|
|
} |
|
|
|
} |
|
|
|
statusBf.append("<transactions>" + transactions + "</transactions>"); |
|
|
|
statusBf.append("<success>" + successCount + "</success>"); |
|
|
|
statusBf.append("<job_summary completed='" + getCompletedJobCount() + |
|
|
|
"' ready='" + getPendingJobCount() + "'"); |
|
|
|
statusBf.append(" active='" + getActiveJobCount() + "'"); |
|
|
|
statusBf.append("></job_summary></" + topLevelTag + ">\r\n"); |
|
|
|
statusBf.append(additionalStatusXML()); |
|
|
|
String statusReport = statusBf.toString(); |
|
|
|
return statusReport; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Derived class may add additional status in a broadcast status XML posted back to portal, |
|
|
|
* by returning an XML tag which will be included immediately in the top-level tag |
|
|
|
* of the broadcast status. |
|
|
|
*/ |
|
|
|
protected String additionalStatusXML() |
|
|
|
{ |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
protected void onExpire() |
|
|
|
{ |
|
|
|
} |
|
|
|
@@ -1148,7 +1164,8 @@ public abstract class Broadcast |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Sets jobStatus in job, and post job report. |
|
|
|
* Constructs job report for given job, and posts report in postback queue. |
|
|
|
* If job status is SUCCESS, then the class attribute successCount in incremented by 1.. |
|
|
|
* Optionally reschedules job. |
|
|
|
* If no rescheduling, then decrement number of remainingJobs, |
|
|
|
* @param job |
|
|
|
@@ -1162,6 +1179,7 @@ public abstract class Broadcast |
|
|
|
JobReport report = mkJobReport(); |
|
|
|
report.initBase(job, broadcastId, launchRecordId, activityRecordIdParamName, jobReportRootNodeName); |
|
|
|
report.init(job); |
|
|
|
if (job.jobStatus == JobStatus.SUCCESS) successCount++; |
|
|
|
postback.queueReport(report.toString()); |
|
|
|
} |
|
|
|
|
|
|
|
|