tigase.jaxmpp.core.client.xmpp.modules.roster

## Class RosterStore

- java.lang.Object
- - tigase.jaxmpp.core.client.xmpp.modules.roster.RosterStore

- All Implemented Interfaces:
    Property
  Direct Known Subclasses:
    DefaultRosterStore

      public abstract class RosterStore
      extends Object
      implements Property

  Storage for keeping roster.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `RosterStore.Predicate`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SessionObject` | `sessionObject`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RosterStore()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(BareJID jid, String name, AsyncCallback asyncCallback)` Adds new contact to roster.
    `void` | `add(BareJID jid, String name, Collection<String> groups, AsyncCallback asyncCallback)` Adds new contact to roster.
    `void` | `add(BareJID jid, String name, String[] groups, AsyncCallback asyncCallback)` Adds new contact to roster.
    `protected abstract Set<String>` | `addItem(RosterItem item)`
    `protected abstract Set<String>` | `calculateModifiedGroups(HashSet<String> groupsOld)`
    `void` | `clear()` Clears storage.
    `abstract RosterItem` | `get(BareJID jid)` Returns RosterItem of given bare JID.
    `List<RosterItem>` | `getAll()` Returns all buddies from roster.
    `abstract List<RosterItem>` | `getAll(RosterStore.Predicate predicate)` Returns all roster items selected by selector.
    `abstract int` | `getCount()` Returns number of roster items in storage.
    `abstract Collection<? extends String>` | `getGroups()` Get all known groups of buddies.
    `Class<RosterStore>` | `getPropertyClass()` Method which returns class which implements this interface which may be used as a key to store instance of this class in JaxmppCore.
    `void` | `remove(BareJID jid)` Removes buddy from roster.
    `abstract void` | `removeAll()`
    `protected abstract void` | `removeItem(BareJID jid)`
    `void` | `setSessionObject(SessionObject sessionObject)`
    `void` | `update(RosterItem item)` Sends changed RosterItem to server.

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

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

- - ### Field Detail

    - #### sessionObject

          protected SessionObject sessionObject

  - ### Constructor Detail

    - #### RosterStore

          public RosterStore()

  - ### Method Detail

    - #### add

          public void add(BareJID jid,
                          String name,
                          AsyncCallback asyncCallback)
                   throws JaxmppException

      Adds new contact to roster.
      Parameters:
        `jid` - JID of buddy
        `name` - name of buddy
        `asyncCallback` - callback
      Throws:
        `JaxmppException`

    - #### add

          public void add(BareJID jid,
                          String name,
                          Collection<String> groups,
                          AsyncCallback asyncCallback)
                   throws JaxmppException

      Adds new contact to roster.
      Parameters:
        `jid` - JID of buddy
        `name` - name of buddy
        `groups` - collection of groups name
        `asyncCallback` - callback
      Throws:
        `JaxmppException`

    - #### add

          public void add(BareJID jid,
                          String name,
                          String[] groups,
                          AsyncCallback asyncCallback)
                   throws JaxmppException

      Adds new contact to roster.
      Parameters:
        `jid` - JID of buddy
        `name` - name of buddy
        `groups` - array of groups name
        `asyncCallback` - callback
      Throws:
        `JaxmppException`

    - #### addItem

          protected abstract Set<String> addItem(RosterItem item)

    - #### calculateModifiedGroups

          protected abstract Set<String> calculateModifiedGroups(HashSet<String> groupsOld)

    - #### clear

          public void clear()

      Clears storage.

    - #### get

          public abstract RosterItem get(BareJID jid)

      Returns RosterItem of given bare JID.
      Parameters:
        `jid` - bare JID.
      Returns:
        roster item.

    - #### getAll

          public List<RosterItem> getAll()

      Returns all buddies from roster.
      Returns:
        all roster items.

    - #### getAll

          public abstract List<RosterItem> getAll(RosterStore.Predicate predicate)

      Returns all roster items selected by selector.
      Parameters:
        `predicate` - selector.
      Returns:
        all matched roster items.

    - #### getCount

          public abstract int getCount()

      Returns number of roster items in storage.
      Returns:
        number of roster items in storage.

    - #### getGroups

          public abstract Collection<? extends String> getGroups()

      Get all known groups of buddies.
      Returns:
        collection of group names.

    - #### getPropertyClass

          public Class<RosterStore> getPropertyClass()

      Description copied from interface: `Property`
      Method which returns class which implements this interface which may be used as a key to store instance of this class in JaxmppCore.
      Specified by:
        `getPropertyClass` in interface `Property`
      Returns:

    - #### remove

          public void remove(BareJID jid)
                      throws JaxmppException

      Removes buddy from roster.
      Parameters:
        `jid` - jid of buddy to remove.
      Throws:
        `JaxmppException`

    - #### removeAll

          public abstract void removeAll()

    - #### removeItem

          protected abstract void removeItem(BareJID jid)

    - #### setSessionObject

          public void setSessionObject(SessionObject sessionObject)

    - #### update

          public void update(RosterItem item)
                      throws JaxmppException

      Sends changed RosterItem to server.
      Parameters:
        `item` - changed roster item.
      Throws:
        `JaxmppException`

Copyright © 2006–2019 Tigase. All rights reserved.