*/
@Override
public void sendNotification(Notification notification) {
Event event = notification.getEvent();
ResultsSummary result = getResultSummary(event);
BuildState buildState = result.getBuildState();
String committersText = createCommittersText(result);
try {
client.startInteractiveMode();
KarotzActionPublisher actionPublisher = new KarotzActionPublisher(client);
String message = "";
if (buildState.equals(BuildState.FAILED)) {
message = String.format("Bild ist fehlgeschlagen. %s.", committersText);
changeLight(actionPublisher, RED);
playSound(actionPublisher, FAILED_SOUND, 42000);
} else if (buildState.equals(BuildState.SUCCESS)) {
message = String.format("Bild war erfolgreich. %s.", committersText);
changeLight(actionPublisher, GREEN);
playSound(actionPublisher, SUCCESS_SOUND, 24000);
} else if (buildState.equals(BuildState.UNKNOWN)) {
message = String.format("Bild Resultat ist unbekannt. %s.", committersText);
changeLight(actionPublisher, BLUE);
playSound(actionPublisher, UNKNOWN_SOUND, 23000);
}
actionPublisher.performAction(new SpeakAction(message, LANGUAGE));