if (current_state) {
int val = 0;
try {
val = Integer.parseInt(str);
} catch (NumberFormatException nfe) {}
StatusType st = StatusType.STATUS_UNKNOWN; ;
switch (val) {
case 0:
st = StatusType.Host_Up;
break;
case 1:
st = StatusType.Host_Down;
break;
case 2:
st = StatusType.Host_Unreachable;
break;
}
htmp.setCurrentState(st);
}
if (last_hard_state){
int val = 0;
try {
val = Integer.parseInt(str);
} catch (NumberFormatException nfe) {}
StatusType st = StatusType.STATUS_UNKNOWN; ;
switch (val) {
case 0:
st = StatusType.Host_Up;
break;
case 1:
st = StatusType.Host_Down;
break;
case 2:
st = StatusType.Host_Unreachable;
break;
}
htmp.setLastHardState(st);
}
if (state_type) { htmp.setStateType(str); }
if (has_been_checked) { htmp.setHasBeenChecked(Integer.parseInt(str)); }
if (plugin_output) { htmp.setPluginOutput(str); }
if (performance_data){ htmp.setPerformanceData(str); }
if (last_state_change) {htmp.setLastStateChange(Long.parseLong(str)*1000); }
if (last_hard_state_change) {htmp.setLastHardStateChange(Long.parseLong(str)*1000); }
if (last_time_up) {htmp.setLastTimeUp(Long.parseLong(str)*1000); }
if (last_time_down) {htmp.setLastTimeDown(Long.parseLong(str)*1000); }
if (last_time_unreachable) {htmp.setLastTimeUnreachable(Long.parseLong(str)*1000); }
if (last_update) { htmp.setLastUpdate(Long.parseLong(str)*1000); }
if (problem_has_been_acknowledged) { htmp.setProblemHasBeenAcknowledged(str.equals("1")?true:false); }
if (scheduled_downtime_depth) { try {
htmp.setScheduledDowntimeDepth(Integer.parseInt(str));
} catch (NumberFormatException nfe) { System.out.println("NumberFormatExcetion in DHStatus:scheduledowntimedepth, " + nfe.toString()); }
}
} else if (serviceDefinition) {
if (host_name) { stmp = new ServiceStatus(str); }
if (last_check) {
try {
stmp.setLastCheck(Long.parseLong(str)*1000);
}catch (NumberFormatException nfe) {}
}
if (current_attempt) {
int val = 0;
try {
val = Integer.parseInt(str);
} catch (NumberFormatException nfe) {}
stmp.setCurrentAttempt(val);
}
if (max_attempts) {
int val = 0;
try {
val = Integer.parseInt(str);
} catch (NumberFormatException nfe) {}
stmp.setMaxAttempts(val);
}
if (current_notification_number) {
int val = 0;
try {
val = Integer.parseInt(str);
} catch (NumberFormatException nfe) {}
stmp.setCurrentNotificationNumber(val);
}
if (current_state) {
int val = 0;
try {
val = Integer.parseInt(str);
} catch (NumberFormatException nfe) {}
StatusType st = StatusType.STATUS_UNKNOWN; ;
switch (val) {
case 0:
st = StatusType.Service_State_OK;
break;
case 1: