@Override public Date getValidityPeriod() { return sms.getValidityPeriod(); }
@Override public Date getValidityPeriod() { return sms.getValidityPeriod(); }
public static Date checkScheduleDeliveryTime(Sms sms, Date scheduleDeliveryTime) { Date maxSchDelTime = MProcUtility.addHours(sms.getValidityPeriod(), -3); if (scheduleDeliveryTime.after(maxSchDelTime)) { scheduleDeliveryTime = maxSchDelTime; } return scheduleDeliveryTime; }
public static void applyScheduleDeliveryTime(Sms sms, Date scheduleDeliveryTime) throws SmscProcessingException { if (scheduleDeliveryTime == null) return; Date maxSchDelTime = addHours(sms.getValidityPeriod(), -3); if (scheduleDeliveryTime.after(maxSchDelTime)) { throw new SmscProcessingException("Schedule delivery time is before 3 hours before than validity period expiration", SmppConstants.STATUS_INVSCHED, MAPErrorCode.systemFailure, SmscProcessingException.HTTP_ERROR_CODE_NOT_SET, null, SmscProcessingException.INTERNAL_ERROR_MISC_VALIDITY_PERIOD_INVALID); } sms.setScheduleDeliveryTime(scheduleDeliveryTime); }
} else boundStatement.setToNull(Schema.COLUMN_SCHEDULE_DELIVERY_TIME); if (sms.getValidityPeriod() != null) { setBoundStatementDate(boundStatement, Schema.COLUMN_VALIDITY_PERIOD, sms.getValidityPeriod()); } else boundStatement.setToNull(Schema.COLUMN_VALIDITY_PERIOD);
} else { sms.setSubmitDate(sms0.getSubmitDate()); sms.setValidityPeriod(sms0.getValidityPeriod()); sms.setScheduleDeliveryTime(sms0.getScheduleDeliveryTime());