public interface NotificationListener
Interface that should be implemented to receive notification change callbacks from the NotificationProvider
A trivial implementation of NotificationListener
would be:
import com.caplin.streamlink.ServiceStatus;
import com.caplin.streamlink.StreamLink;
import com.caplin.streamlink.alerts.Notification;
import com.caplin.streamlink.alerts.NotificationListener;
import com.caplin.streamlink.alerts.NotificationService;
public class NotificationListenerSnippet
{
private NotificationService notificationService;
public NotificationListenerSnippet( StreamLink streamLink )
{
this.notificationService = new NotificationService(streamLink);
notificationService.addListener(new NotificationListener()
{
@Override
public void onNotificationRemoved( Notification notification )
{
System.out.println("onNotificationRemoved(" + notification.toString() + ")");
}
@Override
public void onNotification ( Notification notification )
{
System.out.println("onNotification(" + notification.toString() + ")");
}
@Override
public void onServiceStatus( ServiceStatus status )
{
System.out.println("onServiceStatus(" + status.toString() + ")");
}
});
}
}
Modifier and Type | Method and Description |
---|---|
void |
onNotification(Notification notification)
Received when notification gets added to the container.
|
void |
onNotificationRemoved(Notification notification)
Received when notification is removed from the container.
|
void |
onServiceStatus(ServiceStatus status)
Received when the notification service availability changes.
|
void onNotification(Notification notification)
Received when notification gets added to the container.
notification
- Notification
void onNotificationRemoved(Notification notification)
Received when notification is removed from the container.
notification
- Notification
void onServiceStatus(ServiceStatus status)
Received when the notification service availability changes.
status
- the updated ServiceStatus
.Please send bug reports and comments to Caplin support