*/
public ShiftChangeReporter(String initialUser) throws MCTException, IOException {
final MCTProperties mctProperties = MCTProperties.DEFAULT_MCT_PROPERTIES;
if (StringUtil.isEmpty(initialUser))
throw new MCTException("empty or null initial user");
currentUser = initialUser;
String portProp = mctProperties.getProperty("mcc.monitor.port");
if (StringUtil.isEmpty(portProp)) {
throw new MCTException("property mcc.monitor.port is not set or empty.");
}
try {
this.monitorPort = new Integer(portProp);
} catch (NumberFormatException e) {
throw new MCTException(
"Could not convert mcc.monitor.port to a valid port. Check that mcc.monitor.port is set.", e);
}
reporterExpirationSeconds = DEFAULT_EXPIRATION;
String expire = mctProperties.getProperty("mcc.reporter.expiration", "0");
try {
reporterExpirationSeconds = new Integer(expire);
} catch (NumberFormatException e) {
logger.warn("Could not convert mcc.reporter.expiration; using default");
}
interval = DEFAULT_INTERVAL;
String intervalProp = mctProperties.getProperty("mcc.monitor.interval");
if (!StringUtil.isEmpty(intervalProp)) {
try {
this.interval = new Integer(intervalProp);
} catch (NumberFormatException e) {
logger.warn("Could not convert mcc.monitor.interval; using default");
}
}
execCommand = mctProperties.getProperty("mcc.monitor.command");
if (StringUtil.isEmpty(execCommand)) {
throw new MCTException("property mcc.monitor.command is not set or invalid.");
}
}