Package com.netmera

Class NetmeraInbox


  • public class NetmeraInbox
    extends java.lang.Object
    This 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 via Netmera.fetchInbox(NetmeraInboxFilter, NetmeraInboxFetchCallback)
    • 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 the pageSize value of the NetmeraInboxFilter object. 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. If error parameter is null, it means that the fetch operation has been succeeded.

        Parameters:
        callback - A NetmeraInbox.NetmeraInboxFetchCallback to 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 given NetmeraInbox.NetmeraInboxStatusCallback object. A null error value 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 - A NetmeraInbox.NetmeraInboxStatusCallback to 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.