public interface PagedTopicHandler
This is an object which is used to send commands to a 'paged' Topic. (see PagedTopicData). The handler simplifies the use of such a Topic and avoids having to format messages to send to the Topic or parse messages received from it.
Such a handler is created using
AbstractDiffusionClient.createPagedTopicHandler(Message, PagedTopicListener)
and all notifications from the Topic will be routed through the supplied
listener.
When such a handler is in use then messages received on the Topic will not
be delivered to the Listener
declared to the
client connection
object.
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the Topic.
|
AbstractDiffusionClient |
getConnection()
Get the connection (the client object that created the handler).
|
void |
open(int linesPerPage,
int openPage)
Open the Topic.
|
void |
page(int number)
Requests a page by absolute page number.
|
void |
page(com.pushtechnology.mobile.enums.PageOption page)
Requests a page, relative to the current page.
|
AbstractDiffusionClient getConnection()
void open(int linesPerPage, int openPage) throws APIException
This is used to request the initial page and then receive updates.
Updates will be received until close()
is called or the Topic is
unsubscribed.
If the Topic is already open then this may be called again to resubmit with a different number of lines if required.
linesPerPage
- the number of lines required per page. This must be a
positive value.openPage
- specifies the first page to be sent. This can be an
absolute page number (from 1 to n) or -1 to indicate the current last
page. The resulting page will be received on the
PagedTopicListener.page(PagedTopicHandler, PageStatus, Lines)
method of the associated listener.APIException
- if unable to openvoid page(com.pushtechnology.mobile.enums.PageOption page) throws APIException
The resulting page will be received on the
PagedTopicListener.page(PagedTopicHandler, PageStatus, Lines)
method of the associated listener.
page
- specifies the page option required.APIException
- if the Topic is not open or the request fails.void page(int number) throws APIException
number
- the page number or -1 to indicate the last page.APIException
- if the Topic is not open or the request fails.void close() throws APIException
The Topic will remain subscribed but no more notifications will be received and no requests can be sent.
APIException
- if unable to send close requestCopyright © 2016 Push Technology Ltd. All Rights Reserved.