Package org.peripheralware.karotz.publisher

Examples of org.peripheralware.karotz.publisher.KarotzActionPublisher


    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));
      Thread.sleep(10000); // wait 10 seconds till karotz has surely finished talking.
      client.stopInteractiveMode();
    } catch (KarotzException e) {
      LOGGER.error("There was an error with Karotz.", e);
    } catch (InterruptedException e) {
View Full Code Here

TOP

Related Classes of org.peripheralware.karotz.publisher.KarotzActionPublisher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.