public class GHNotificationStream extends Object implements 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 |
|---|---|
Iterator<GHThread> |
iterator()
|
void |
markAsRead()
Mark as read.
|
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(Date dt)
Since gh notification stream.
|
GHNotificationStream |
since(long timestamp)
Since gh notification stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic GHNotificationStream read(boolean v)
v - the vpublic GHNotificationStream participating(boolean v)
v - the vpublic GHNotificationStream since(long timestamp)
timestamp - the timestamppublic GHNotificationStream since(Date dt)
dt - the dtpublic GHNotificationStream nonBlocking(boolean v)
iterator() will stop iterating instead of blocking and waiting for the updates to
arrive.v - the vpublic void markAsRead()
throws IOException
IOException - the io exceptionpublic void markAsRead(long timestamp)
throws IOException
timestamp - the timestampIOException - the io exceptionCopyright © 2020. All rights reserved.