public class GHNotificationStream extends java.lang.Object implements java.lang.Iterable<GHThread>
This class supports two modes of retrieving notifications that can
be controlled via nonBlocking(boolean).
In the blocking mode, which is the default, iterator will be infinite.
The call to Iterator.next() will block until a new notification
arrives. This is useful for application that runs perpetually and reacts
to notifications.
In the non-blocking mode, the iterator will only report the set of notifications initially retrieved from GitHub, then quit. This is useful for a batch application to process the current set of notifications.
GitHub.listNotifications(),
GHRepository.listNotifications()| Modifier and Type | Method and Description |
|---|---|
java.util.Iterator<GHThread> |
iterator()
Returns an infinite blocking
Iterator that returns
GHThread as notifications arrive. |
void |
markAsRead() |
void |
markAsRead(long timestamp)
Marks all the notifications as read.
|
GHNotificationStream |
nonBlocking(boolean v)
If set to true,
iterator() will stop iterating instead of blocking and
waiting for the updates to arrive. |
GHNotificationStream |
participating(boolean v)
Should the stream be restricted to notifications in which the user
is directly participating or mentioned?
|
GHNotificationStream |
read(boolean v)
Should the stream include notifications that are already read?
|
GHNotificationStream |
since(java.util.Date dt) |
GHNotificationStream |
since(long timestamp) |
public GHNotificationStream read(boolean v)
public GHNotificationStream participating(boolean v)
public GHNotificationStream since(long timestamp)
public GHNotificationStream since(java.util.Date dt)
public GHNotificationStream nonBlocking(boolean v)
iterator() will stop iterating instead of blocking and
waiting for the updates to arrive.public java.util.Iterator<GHThread> iterator()
Iterator that returns
GHThread as notifications arrive.iterator in interface java.lang.Iterable<GHThread>public void markAsRead()
throws java.io.IOException
java.io.IOExceptionpublic void markAsRead(long timestamp)
throws java.io.IOException
java.io.IOExceptionCopyright © 2016. All Rights Reserved.