| @@ -73,7 +73,6 @@ public abstract class Broadcast | |||
| // protected XPath xpathEngine; | |||
| protected String postbackURL; | |||
| private Postback postback; | |||
| public long expireTime; | |||
| protected String daily_start = ""; | |||
| protected String daily_stop = ""; | |||
| @@ -127,7 +126,6 @@ public abstract class Broadcast | |||
| CANCELED(true), // Final state | |||
| PURGED(true), // Final state | |||
| ABORTED(true), // final state | |||
| EXPIRED(true), // final state | |||
| /** All servicing and reporting done */ | |||
| ALLDONE(true) // Final state | |||
| ; | |||
| @@ -213,7 +211,6 @@ public abstract class Broadcast | |||
| BroadcastState.PURGED, // User action | |||
| BroadcastState.ABORTING, | |||
| BroadcastState.ABORTED, | |||
| BroadcastState.EXPIRED, | |||
| BroadcastState.ALLDONE // When recipient list is empty | |||
| )); | |||
| @@ -226,8 +223,7 @@ public abstract class Broadcast | |||
| BroadcastState.PAUSED, // User action | |||
| BroadcastState.PURGED, // User action | |||
| BroadcastState.ABORTING, | |||
| BroadcastState.ABORTED, | |||
| BroadcastState.EXPIRED | |||
| BroadcastState.ABORTED | |||
| )); | |||
| // Transitions from CANCELING | |||
| @@ -920,20 +916,6 @@ public abstract class Broadcast | |||
| return ""; | |||
| } | |||
| protected void onExpire() | |||
| { | |||
| } | |||
| protected void setExpireTime(long expireTime) | |||
| { | |||
| this.expireTime = expireTime; | |||
| } | |||
| public long getExpireTime() | |||
| { | |||
| return expireTime; | |||
| } | |||
| /** | |||
| * | |||
| * @return instantaneous number of jobs being serviced by service provider | |||
| @@ -945,7 +927,7 @@ public abstract class Broadcast | |||
| /** | |||
| * Parses broadcastId and return if notInService is true. | |||
| * Otherwise, continue parsing postBackUrl, expireTime, recipientList, | |||
| * Otherwise, continue parsing postBackUrl, recipientList, | |||
| * and implementation-specific data from request. | |||
| * Avoid throwing an exception before parsing and setting broadcastId. | |||
| * @param notInService | |||
| @@ -1183,12 +1165,6 @@ public abstract class Broadcast | |||
| */ | |||
| private boolean serviceThreadsShouldStop() | |||
| { | |||
| if (System.currentTimeMillis() >= expireTime) | |||
| { | |||
| setState(BroadcastState.EXPIRED); | |||
| wakeUpServiceThreads(); | |||
| return true; | |||
| } | |||
| if (state == BroadcastState.CANCELING || | |||
| state == BroadcastState.ABORTING || | |||
| state.isFinal) | |||
| @@ -1349,10 +1325,9 @@ public abstract class Broadcast | |||
| { | |||
| if (rescheduleTimeMS < 0) return null; | |||
| // No more rescheduling on cancel, abort, expired, or alldone | |||
| // No more rescheduling on cancel, abort, or alldone | |||
| if (state == BroadcastState.CANCELING | |||
| || state == BroadcastState.CANCELED | |||
| || state == BroadcastState.EXPIRED | |||
| || state == BroadcastState.ABORTED | |||
| || state == BroadcastState.ABORTING | |||
| || state == BroadcastState.ALLDONE | |||
| @@ -23,7 +23,6 @@ public class Job | |||
| SUCCESS, | |||
| ADDRESS_ERROR, | |||
| CANCELED, | |||
| EXPIRED, | |||
| SERVICE_PROVIDER_PROTOCOL_ERROR, | |||
| SERVICE_PROVIDER_CONNECT_ERROR, | |||
| SERVICE_PROVIDER_HTTP_ERROR, | |||
| @@ -37,7 +37,7 @@ import altk.common.engine.util.UTF8BenevolentDecoder; | |||
| /** | |||
| * Abstract class extending Broadcast by providing an implementation of the decode | |||
| * method to parse HTTP POST input into XML DOM, and extracting the required class | |||
| * attributes broadcast_id, launch_record_id, expire_time, postback and recipientList. | |||
| * attributes broadcast_id, launch_record_id, postback and recipientList. | |||
| * @author Yuk-Ming | |||
| * | |||
| */ | |||
| @@ -60,7 +60,7 @@ public abstract class XMLDOMBroadcast extends Broadcast | |||
| } | |||
| /** | |||
| * Sets up XMLDoc and parses broadcast_id, expire_time, postBackUrl and recipientList. | |||
| * Sets up XMLDoc and parses broadcast_id, postBackUrl and recipientList. | |||
| * Derived class cannot override this method, which is final. | |||
| * @throws EngineException | |||
| */ | |||
| @@ -138,25 +138,7 @@ public abstract class XMLDOMBroadcast extends Broadcast | |||
| throw new BroadcastMsgException("Missing broadcast_id"); | |||
| } | |||
| setBroadcastId(broadcastId); | |||
| // expireTime | |||
| long now = System.currentTimeMillis(); | |||
| try | |||
| { | |||
| long expireTime = getLongValue("expire_time", broadcastNode); | |||
| // defaults to 20 minutes | |||
| myLogger.debug("expire_time decoded to be " + expireTime); | |||
| if (expireTime == 0) expireTime = now + 20 * 60 * 1000; | |||
| myLogger.debug("expire time adjusted to be " + expireTime); | |||
| setExpireTime(expireTime); | |||
| setLaunchRecordId(broadcastNode.getAttribute("launch_record_id")); | |||
| } | |||
| catch (Exception e) | |||
| { | |||
| throw new BroadcastMsgException("Missing or bad expire_time"); | |||
| } | |||
| // Postback | |||
| postbackURL = getStringValue("async_status_post_back", broadcastNode); | |||
| if (postbackURL != null && (postbackURL=postbackURL.trim()).length() == 0) postbackURL = null; | |||
| @@ -102,17 +102,6 @@ public abstract class XMLSAXBroadcast extends Broadcast | |||
| { | |||
| postbackURL = getTrimmedText(); | |||
| } | |||
| else if (qName.equals("expire_time")) | |||
| { | |||
| expireTime = Long.parseLong(getTrimmedText()); | |||
| // defaults to 20 minutes | |||
| myLogger.debug("expire_time decoded to be " + expireTime); | |||
| if (expireTime == 0) | |||
| { | |||
| expireTime = System.currentTimeMillis() + 20 * 60 * 1000; | |||
| myLogger.debug("expire time adjusted to be " + expireTime); | |||
| } | |||
| } | |||
| else if (qName.equals(DAILY_STOP_KEY)) | |||
| { | |||
| daily_stop = getTrimmedText(); | |||
| @@ -2,7 +2,6 @@ package altk.comm.engine.exception; | |||
| public enum BroadcastError | |||
| { | |||
| EXPIRED, | |||
| READ_REQUEST_ERROR, | |||
| BAD_REQUEST_DATA, | |||
| INTERNAL_ERROR, | |||
| @@ -1,12 +0,0 @@ | |||
| package altk.comm.engine.exception; | |||
| @SuppressWarnings("serial") | |||
| public class BroadcastExpiredException extends BroadcastException | |||
| { | |||
| public BroadcastExpiredException(String errorText) | |||
| { | |||
| super(BroadcastError.EXPIRED, errorText); | |||
| } | |||
| } | |||