Package com.netmera
Class NetmeraInbox
- java.lang.Object
-
- com.netmera.NetmeraInbox
-
public class NetmeraInbox extends java.lang.ObjectThis class provides methods and properties needed after initial fetch of the list of push notifications with given filter. Filter properties of an inbox instance could not be changed. If you need modified filter properties, you have to start a new fetch operation viaNetmera.fetchInbox(NetmeraInboxFilter, NetmeraInboxFetchCallback)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceNetmeraInbox.NetmeraInboxFetchCallbackstatic interfaceNetmeraInbox.NetmeraInboxStatusCallback
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountForStatus(int status)Returns count of objects matching with given status options.voidfetchNextPage(NetmeraInbox.NetmeraInboxFetchCallback callback)Fetch the contents of the next page from Netmera servers.booleanhasNextPage()Use this boolean to check if inbox still has next pages to fetchjava.util.List<NetmeraPushObject>pushObjects()Accessing the list which contains all objects fetched in an aggregated manner.voidupdateStatus(java.util.List<NetmeraPushObject> pushObjectList, int inboxStatus, NetmeraInbox.NetmeraInboxStatusCallback callback)Update status of given push objects.
-
-
-
Method Detail
-
fetchNextPage
public void fetchNextPage(NetmeraInbox.NetmeraInboxFetchCallback callback)
Fetch the contents of the next page from Netmera servers. NetmeraInbox object fetches and stores the list of push objects incrementally respecting to thepageSizevalue of theNetmeraInboxFilterobject. Use this method to fetch the list of push objects belonging to the next page. When fetch process is finished, given callback will be called. Iferrorparameter isnull, it means that the fetch operation has been succeeded.- Parameters:
callback- ANetmeraInbox.NetmeraInboxFetchCallbackto be triggered after fetch process is completed.
-
updateStatus
public void updateStatus(java.util.List<NetmeraPushObject> pushObjectList, int inboxStatus, NetmeraInbox.NetmeraInboxStatusCallback callback)
Update status of given push objects. Calling this method will update the inbox status of given push objects, and result will be informed via givenNetmeraInbox.NetmeraInboxStatusCallbackobject. Anullerrorvalue means operation succeeded. Setting multiple status options to status parameter will result in an immediate error.- Parameters:
pushObjectList- The list of push objects whose status will be updated.inboxStatus- Status option to be set upon given push objects.callback- ANetmeraInbox.NetmeraInboxStatusCallbackto be triggered after update process is completed.
-
pushObjects
public java.util.List<NetmeraPushObject> pushObjects()
Accessing the list which contains all objects fetched in an aggregated manner. That is, if you have fetched 3 pages and your page size 20, this list will contain all 60 objects, rather than holding the data of only last page.- Returns:
- List of fetched push objects.
-
countForStatus
public int countForStatus(int status)
Returns count of objects matching with given status options. You can combine different status types using|operator.- Parameters:
status- Status types to include while calculating count.- Returns:
- Number of objects matching with any of the given status types.
-
hasNextPage
public boolean hasNextPage()
Use this boolean to check if inbox still has next pages to fetch- Returns:
- True if next page is available, false otherwise.
-
-