Package 

Class InboxDatasource


  • 
    public final class InboxDatasource
    
                        

    Inbox datasource. Wraps SQLite queries (DAO).

    • Constructor Detail

      • InboxDatasource

        InboxDatasource(Context context)
    • Method Detail

      • wipeData

         void wipeData()

        Clear all content

      • close

         void close()

        Close the datasource. You should not make any other call to this datasource once this has been called.

      • getFetcherID

         long getFetcherID(FetcherType type, String identifier)

        Try to get the fetcher ID from the SQLiteCreate and insert it if it doesn't exist

        Parameters:
        type - The fetcher type
        identifier - The user identifier
      • updateNotification

         String updateNotification(JSONObject notification, long fetcherId)

        Read the notification object and update the row in databaseWe update different values depending on what the server actually sent

      • markAllAsRead

         int markAllAsRead(long time, long fetcherId)

        Mark all notification received before a specified time as read

      • markNotificationAsRead

         void markNotificationAsRead(String notificationID)

        Mark a notification as read

        Parameters:
        notificationID - the notification identifier
      • markNotificationAsDeleted

         void markNotificationAsDeleted(String notificationID)

        Mark a notification as deleted locally

        Parameters:
        notificationID - the notification identifier
      • deleteNotifications

         boolean deleteNotifications(List<String> notificationIds)

        Delete notification by ID

        Parameters:
        notificationIds - IDs of the notifications to delete
      • cleanDatabase

         boolean cleanDatabase()

        Remove notifications older than 90 daysAlso remove related row in other tables