*
* @param livenessTestResult
*/
private void updateStateAndAlertOnChange(
LivenessTestResult livenessTestResult) {
Machine machine = livenessTestResult.getMachine();
LivenessState newState = livenessTestResult.getState();
String id = machine.getId();
LivenessState previousState = this.livenessObservations.get(id);
this.livenessObservations.put(machine.getId(), newState);
if ((previousState == null) || (previousState != newState)) {
LivenessStateChange livenessChange = new LivenessStateChange(
machine, previousState, newState);
LOG.info("liveness state change: " + livenessChange);