tigase.jaxmpp.android.roster

## Class RosterProvider

- java.lang.Object
- - tigase.jaxmpp.android.roster.RosterProvider

- All Implemented Interfaces:
    RosterCacheProvider

      public class RosterProvider
      extends Object
      implements RosterCacheProvider

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `RosterProvider.Listener`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Context` | `context`
    `protected SQLiteOpenHelper` | `dbHelper`
    `protected RosterProvider.Listener` | `listener`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RosterProvider(Context context, SQLiteOpenHelper dbHelper, RosterProvider.Listener listener, String versionKeyPrefix)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<String>` | `addItem(SessionObject sessionObject, RosterItem rosterItem)`
    `String` | `getCachedVersion(SessionObject sessionObject)` Returns version of cached roster.
    `int` | `getCount(SessionObject sessionObject)`
    `Collection<? extends String>` | `getGroups(SessionObject sessionObject)`
    `RosterItem` | `getItem(SessionObject sessionObject, BareJID jid)`
    `long` | `getRosterItemId(SessionObject sessionObject, BareJID jid)`
    `Collection<RosterItem>` | `loadCachedRoster(SessionObject sessionObject)` Loads cached roster.
    `void` | `removeAll(SessionObject sessionObject)`
    `void` | `removeItem(SessionObject sessionObject, RosterItem rosterItem)`
    `void` | `updateReceivedVersion(SessionObject sessionObject, String ver)` Update roster cache.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### context

          protected final Context context

    - #### dbHelper

          protected final SQLiteOpenHelper dbHelper

    - #### listener

          protected final RosterProvider.Listener listener

  - ### Constructor Detail

    - #### RosterProvider

          public RosterProvider(Context context,
                                SQLiteOpenHelper dbHelper,
                                RosterProvider.Listener listener,
                                String versionKeyPrefix)

  - ### Method Detail

    - #### addItem

          public Set<String> addItem(SessionObject sessionObject,
                                     RosterItem rosterItem)

    - #### getCachedVersion

          public String getCachedVersion(SessionObject sessionObject)

      Description copied from interface: `RosterCacheProvider`
      Returns version of cached roster.
      Specified by:
        `getCachedVersion` in interface `RosterCacheProvider`
      Parameters:
        `sessionObject` - session object
      Returns:
        version id

    - #### getCount

          public int getCount(SessionObject sessionObject)

    - #### getGroups

          public Collection<? extends String> getGroups(SessionObject sessionObject)

    - #### getItem

          public RosterItem getItem(SessionObject sessionObject,
                                    BareJID jid)

    - #### getRosterItemId

          public long getRosterItemId(SessionObject sessionObject,
                                      BareJID jid)

    - #### loadCachedRoster

          public Collection<RosterItem> loadCachedRoster(SessionObject sessionObject)

      Description copied from interface: `RosterCacheProvider`
      Loads cached roster.
      Specified by:
        `loadCachedRoster` in interface `RosterCacheProvider`
      Returns:
        collection of loaded roster items.

    - #### removeAll

          public void removeAll(SessionObject sessionObject)

    - #### removeItem

          public void removeItem(SessionObject sessionObject,
                                 RosterItem rosterItem)

    - #### updateReceivedVersion

          public void updateReceivedVersion(SessionObject sessionObject,
                                            String ver)

      Description copied from interface: `RosterCacheProvider`
      Update roster cache. RosterStore should be get from session object.
      Specified by:
        `updateReceivedVersion` in interface `RosterCacheProvider`
      Parameters:
        `sessionObject` - session object.
        `ver` - version of roster.

Copyright © 2006–2017 Tigase. All rights reserved.