@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Application) { Application that = (Application) o; return (this.id.equals(that.id())) && (this.name.equals(that.name())) && (this.timeout == that.timeout()) && (this.icon.equals(that.icon())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Application) { Application that = (Application) o; return (this.id.equals(that.id())) && (this.name.equals(that.name())) && (this.timeout == that.timeout()) && (this.icon.equals(that.icon())); } return false; }
public SnarlNotifier(Application application, SnarlConfiguration configuration) { LOGGER.debug("Configuring Snarl for application {}: {}.", application, configuration); this.application = application; this.configuration = configuration; this.snarlApplication = fr.jcgay.snp4j.Application.withPassword(application.id(), application.name(), configuration.applicationPassword()); }
public SnarlNotifier(Application application, SnarlConfiguration configuration) { LOGGER.debug("Configuring Snarl for application {}: {}.", application, configuration); this.application = application; this.configuration = configuration; this.snarlApplication = fr.jcgay.snp4j.Application.withPassword(application.id(), application.name(), configuration.applicationPassword()); }
commands.add(configuration.bin()); commands.add("-title"); commands.add(application.name()); if (notification.subtitle() != null) { commands.add("-subtitle");
commands.add(configuration.bin()); commands.add("-title"); commands.add(application.name()); if (notification.subtitle() != null) { commands.add("-subtitle");
private String attachments(Notification notification) { return "[{" + "\"fallback\":\"" + notification.message() + "\"," + "\"color\":\"" + colorize(notification) + "\"," + "\"author_name\":\"" + application.name() + "\"," + "\"title\":\"" + notification.title() + "\"," + "\"text\":\"" + notification.message() + "\n" + notification.subtitle() + "\"," + "}]"; }
private String attachments(Notification notification) { return "[{" + "\"fallback\":\"" + notification.message() + "\"," + "\"color\":\"" + colorize(notification) + "\"," + "\"author_name\":\"" + application.name() + "\"," + "\"title\":\"" + notification.title() + "\"," + "\"text\":\"" + notification.message() + "\n" + notification.subtitle() + "\"," + "}]"; }
@Override public Notifier init() { if (icon != null) { return this; } if (!SystemTray.isSupported()) { skipNotifications = true; LOGGER.warn("SystemTray is not supported, skipping notifications..."); return this; } icon = new TrayIcon(createImage(application.icon().toByteArray()), application.name()); icon.setImageAutoSize(true); try { SystemTray.getSystemTray().add(icon); } catch (AWTException e) { throw new SystemTrayNotificationException("Error initializing SystemTray Icon.", e); } return this; }
@Override public Notifier init() { if (icon != null) { return this; } if (!SystemTray.isSupported()) { skipNotifications = true; LOGGER.warn("SystemTray is not supported, skipping notifications..."); return this; } icon = new TrayIcon(createImage(application.icon().toByteArray()), application.name()); icon.setImageAutoSize(true); try { SystemTray.getSystemTray().add(icon); } catch (AWTException e) { throw new SystemTrayNotificationException("Error initializing SystemTray Icon.", e); } return this; }
@Override public Notifier init() { if (isClientRegistered()) { return this; } GntpApplicationInfo gApplication = Gntp.appInfo(application.name()).build(); gNotification = Gntp.notificationInfo(gApplication, application.id()) .icon(application.icon().toImage()) .build(); Gntp clientBuilder = Gntp.client(gApplication) .onPort(configuration.port()) .forHost(configuration.host()) .withoutRetry() .listener(logListener); if (configuration.password() != null) { clientBuilder.withPassword(configuration.password()); } gClient = clientBuilder.build(); gClient.register(); try { gClient.waitRegistration(1L, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } return this; }
@Override public Notifier init() { if (isClientRegistered()) { return this; } GntpApplicationInfo gApplication = Gntp.appInfo(application.name()).build(); gNotification = Gntp.notificationInfo(gApplication, application.id()) .icon(application.icon().toImage()) .build(); Gntp clientBuilder = Gntp.client(gApplication) .onPort(configuration.port()) .forHost(configuration.host()) .withoutRetry() .listener(logListener); if (configuration.password() != null) { clientBuilder.withPassword(configuration.password()); } gClient = clientBuilder.build(); gClient.register(); try { gClient.waitRegistration(1L, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } return this; }