long millisec = -1L;
try {
if (dayStr == null || dayStr.equals("") || hourStr == null
|| hourStr.equals("")) {
throw new SignOnException(mh.getMessage("null_term"));
}
days = Integer.parseInt(dayStr);
hours = Integer.parseInt(hourStr);
certTerm = CertTermUtil.calcHours(days, hours);
if (certTerm > maxHours) {
throw new SignOnException(mh.getMessage("shorter_term"));
} else if ((0 <= certTerm) && (certTerm <= minHours)) {
throw new SignOnException(mh.getMessage("longer_term"));
} else if (certTerm < 0) {
throw new SignOnException(mh.getMessage("invalid_term"));
}
millisec = CertTermUtil.calcMillisec(days, hours);
} catch (SignOnException e) {
throw new SignOnException(
mh.getMessage("invalidterm_message",
new Object[] {
e.getMessage(), new Integer(maxHours / 24),
new Integer(maxHours % 24), new Integer(minHours) }));
}