tigase.xmpp.impl.roster

## Class RosterAbstract

- java.lang.Object
- - tigase.xmpp.impl.roster.RosterAbstract

- Direct Known Subclasses:
    Roster, RosterFlat

      public abstract class RosterAbstract
      extends Object

  Describe class RosterAbstract here. Created: Thu Sep 4 18:09:52 2008
  Author:
    Artur Hefczyc

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RosterAbstract.PresenceType` Enum description
    `static class` | `RosterAbstract.StateTransition` Enum description
    `static class` | `RosterAbstract.SubscriptionType`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CLIENT_XMLNS` Field description
    `static Element[]` | `DISCO_FEATURES` Field description
    `protected static boolean` | `emptyNameAllowed`
    `static Element[]` | `FEATURES` Field description
    `static EnumSet<RosterAbstract.SubscriptionType>` | `FROM_SUBSCRIBED` Holds all {link @SubscriptionType} elements that can be perceived as FROM subscription
    `static String` | `GROUP` Field description
    `static String` | `GROUPS` Field description
    `static EnumSet<StanzaType>` | `INITIAL_PRESENCES` Field description
    `protected static int` | `maxRosterSize`
    `static String` | `NAME` Field description
    `static EnumSet<RosterAbstract.SubscriptionType>` | `PENDING_IN` Field description
    `static EnumSet<RosterAbstract.SubscriptionType>` | `PENDING_OUT` Field description
    `static String` | `ROSTER` Field description
    `static String` | `ROSTER_XMLNS` Field description
    `static String` | `ROSTERHASH` Field description
    `static EnumSet<RosterAbstract.SubscriptionType>` | `SUB_BOTH` Field description
    `static EnumSet<RosterAbstract.SubscriptionType>` | `SUB_FROM` Field description
    `static EnumSet<RosterAbstract.SubscriptionType>` | `SUB_NONE` Field description
    `static EnumSet<RosterAbstract.SubscriptionType>` | `SUB_TO` Field description
    `static String` | `SUBSCRIPTION` Field description
    `static EnumSet<RosterAbstract.SubscriptionType>` | `TO_SUBSCRIBED` Field description
    `static String` | `VER_ATT` Field description
    `static String` | `XMLNS` Field description
    `static String` | `XMLNS_DYNAMIC` Field description
    `static String` | `XMLNS_LOAD` Field description

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RosterAbstract()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `addBuddy(XMPPResourceConnection session, JID jid, String name, String[] groups, String otherData)`
    `abstract boolean` | `addBuddyGroup(XMPPResourceConnection session, JID buddy, String[] groups)`
    `abstract boolean` | `containsBuddy(XMPPResourceConnection session, JID buddy)`
    `abstract JID[]` | `getBuddies(XMPPResourceConnection session)`
    `JID[]` | `getBuddies(XMPPResourceConnection session, EnumSet<RosterAbstract.SubscriptionType> subscrs)`
    `String` | `getBuddiesHash(XMPPResourceConnection session)`
    `abstract String[]` | `getBuddyGroups(XMPPResourceConnection session, JID buddy)`
    `Element` | `getBuddyItem(XMPPResourceConnection session, JID buddy)`
    `abstract String` | `getBuddyName(XMPPResourceConnection session, JID buddy)`
    `abstract RosterAbstract.SubscriptionType` | `getBuddySubscription(XMPPResourceConnection session, JID buddy)`
    `abstract Element` | `getCustomChild(XMPPResourceConnection session, JID buddy)`
    `List<Element>` | `getCustomChildren(XMPPResourceConnection session, JID buddy)`
    `RosterAbstract.PresenceType` | `getPresenceType(XMPPResourceConnection session, Packet packet)`
    `abstract RosterElement` | `getRosterElement(XMPPResourceConnection session, JID jid)`
    `List<Element>` | `getRosterItems(XMPPResourceConnection session)`
    `static RosterAbstract.SubscriptionType` | `getStateTransition(RosterAbstract.SubscriptionType subscription, RosterAbstract.PresenceType presence)`
    `String` | `groupNode(JID buddy)`
    `void` | `init(UserRepository repo)`
    `abstract boolean` | `isOnline(XMPPResourceConnection session, JID jid)`
    `boolean` | `isPendingIn(XMPPResourceConnection session, JID jid)`
    `abstract boolean` | `isRosterLoaded(XMPPResourceConnection session)` Check if data containing user roster for this session is loaded from database
    `boolean` | `isSubscribedFrom(RosterAbstract.SubscriptionType subscr)`
    `boolean` | `isSubscribedFrom(XMPPResourceConnection session, JID jid)`
    `boolean` | `isSubscribedTo(XMPPResourceConnection session, JID jid)`
    `abstract void` | `logout(XMPPResourceConnection session)`
    `abstract boolean` | `presenceSent(XMPPResourceConnection session, JID jid)`
    `abstract boolean` | `removeBuddy(XMPPResourceConnection session, JID jid)`
    `abstract void` | `setBuddyName(XMPPResourceConnection session, JID buddy, String name)`
    `abstract void` | `setBuddySubscription(XMPPResourceConnection session, RosterAbstract.SubscriptionType subscription, JID buddy)`
    `abstract void` | `setOnline(XMPPResourceConnection session, JID jid, boolean online)`
    `abstract void` | `setPresenceSent(XMPPResourceConnection session, JID jid, boolean sent)`
    `void` | `setProperties(Map<String,Object> settings)`
    `void` | `updateBuddyChange(XMPPResourceConnection session, Queue<Packet> results, Element item)`
    `boolean` | `updateBuddySubscription(XMPPResourceConnection session, RosterAbstract.PresenceType presence, JID jid)`
    `void` | `updateRosterHash(String roster_str, XMPPResourceConnection session)`

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

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

- - ### Field Detail

    - #### CLIENT_XMLNS

          public static final String CLIENT_XMLNS

      Field description
      See Also:
        Constant Field Values

    - #### GROUP

          public static final String GROUP

      Field description
      See Also:
        Constant Field Values

    - #### GROUPS

          public static final String GROUPS

      Field description
      See Also:
        Constant Field Values

    - #### NAME

          public static final String NAME

      Field description
      See Also:
        Constant Field Values

    - #### ROSTER

          public static final String ROSTER

      Field description
      See Also:
        Constant Field Values

    - #### ROSTER_XMLNS

          public static final String ROSTER_XMLNS

      Field description
      See Also:
        Constant Field Values

    - #### ROSTERHASH

          public static final String ROSTERHASH

      Field description
      See Also:
        Constant Field Values

    - #### SUBSCRIPTION

          public static final String SUBSCRIPTION

      Field description
      See Also:
        Constant Field Values

    - #### VER_ATT

          public static final String VER_ATT

      Field description
      See Also:
        Constant Field Values

    - #### XMLNS

          public static final String XMLNS

      Field description
      See Also:
        Constant Field Values

    - #### XMLNS_DYNAMIC

          public static final String XMLNS_DYNAMIC

      Field description
      See Also:
        Constant Field Values

    - #### XMLNS_LOAD

          public static final String XMLNS_LOAD

      Field description
      See Also:
        Constant Field Values

    - #### TO_SUBSCRIBED

          public static final EnumSet<RosterAbstract.SubscriptionType> TO_SUBSCRIBED

      Field description

    - #### SUB_TO

          public static final EnumSet<RosterAbstract.SubscriptionType> SUB_TO

      Field description

    - #### SUB_NONE

          public static final EnumSet<RosterAbstract.SubscriptionType> SUB_NONE

      Field description

    - #### SUB_FROM

          public static final EnumSet<RosterAbstract.SubscriptionType> SUB_FROM

      Field description

    - #### SUB_BOTH

          public static final EnumSet<RosterAbstract.SubscriptionType> SUB_BOTH

      Field description

    - #### PENDING_OUT

          public static final EnumSet<RosterAbstract.SubscriptionType> PENDING_OUT

      Field description

    - #### PENDING_IN

          public static final EnumSet<RosterAbstract.SubscriptionType> PENDING_IN

      Field description

    - #### INITIAL_PRESENCES

          public static final EnumSet<StanzaType> INITIAL_PRESENCES

      Field description

    - #### FROM_SUBSCRIBED

          public static final EnumSet<RosterAbstract.SubscriptionType> FROM_SUBSCRIBED

      Holds all {link @SubscriptionType} elements that can be perceived as FROM subscription

    - #### FEATURES

          public static final Element[] FEATURES

      Field description

    - #### DISCO_FEATURES

          public static final Element[] DISCO_FEATURES

      Field description

    - #### emptyNameAllowed

          protected static boolean emptyNameAllowed

    - #### maxRosterSize

          protected static int maxRosterSize

  - ### Constructor Detail

    - #### RosterAbstract

          public RosterAbstract()

  - ### Method Detail

    - #### addBuddy

          public abstract void addBuddy(XMPPResourceConnection session,
                                        JID jid,
                                        String name,
                                        String[] groups,
                                        String otherData)
                                 throws NotAuthorizedException,
                                        TigaseDBException,
                                        PolicyViolationException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`
        `PolicyViolationException`

    - #### addBuddyGroup

          public abstract boolean addBuddyGroup(XMPPResourceConnection session,
                                                JID buddy,
                                                String[] groups)
                                         throws NotAuthorizedException,
                                                TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### containsBuddy

          public abstract boolean containsBuddy(XMPPResourceConnection session,
                                                JID buddy)
                                         throws NotAuthorizedException,
                                                TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### groupNode

          public String groupNode(JID buddy)

    - #### init

          public void init(UserRepository repo)
                    throws TigaseDBException,
                           TigaseDBException

      Throws:
        `TigaseDBException`

    - #### logout

          public abstract void logout(XMPPResourceConnection session)

    - #### presenceSent

          public abstract boolean presenceSent(XMPPResourceConnection session,
                                               JID jid)
                                        throws NotAuthorizedException,
                                               TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### removeBuddy

          public abstract boolean removeBuddy(XMPPResourceConnection session,
                                              JID jid)
                                       throws NotAuthorizedException,
                                              TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### updateBuddyChange

          public void updateBuddyChange(XMPPResourceConnection session,
                                        Queue<Packet> results,
                                        Element item)
                                 throws NotAuthorizedException,
                                        TigaseDBException,
                                        NoConnectionIdException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`
        `NoConnectionIdException`

    - #### updateBuddySubscription

          public boolean updateBuddySubscription(XMPPResourceConnection session,
                                                 RosterAbstract.PresenceType presence,
                                                 JID jid)
                                          throws NotAuthorizedException,
                                                 TigaseDBException,
                                                 PolicyViolationException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`
        `PolicyViolationException`

    - #### updateRosterHash

          public void updateRosterHash(String roster_str,
                                       XMPPResourceConnection session)

    - #### getBuddies

          public abstract JID[] getBuddies(XMPPResourceConnection session)
                                    throws NotAuthorizedException,
                                           TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getBuddies

          public JID[] getBuddies(XMPPResourceConnection session,
                                  EnumSet<RosterAbstract.SubscriptionType> subscrs)
                           throws NotAuthorizedException,
                                  TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getBuddiesHash

          public String getBuddiesHash(XMPPResourceConnection session)

    - #### getBuddyGroups

          public abstract String[] getBuddyGroups(XMPPResourceConnection session,
                                                  JID buddy)
                                           throws NotAuthorizedException,
                                                  TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getBuddyItem

          public Element getBuddyItem(XMPPResourceConnection session,
                                      JID buddy)
                               throws NotAuthorizedException,
                                      TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getBuddyName

          public abstract String getBuddyName(XMPPResourceConnection session,
                                              JID buddy)
                                       throws NotAuthorizedException,
                                              TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getBuddySubscription

          public abstract RosterAbstract.SubscriptionType getBuddySubscription(XMPPResourceConnection session,
                                                                               JID buddy)
                                                                        throws NotAuthorizedException,
                                                                               TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getCustomChild

          public abstract Element getCustomChild(XMPPResourceConnection session,
                                                 JID buddy)
                                          throws NotAuthorizedException,
                                                 TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getCustomChildren

          public List<Element> getCustomChildren(XMPPResourceConnection session,
                                                 JID buddy)
                                          throws NotAuthorizedException,
                                                 TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getPresenceType

          public RosterAbstract.PresenceType getPresenceType(XMPPResourceConnection session,
                                                             Packet packet)
                                                      throws NotAuthorizedException

      Throws:
        `NotAuthorizedException`

    - #### getRosterElement

          public abstract RosterElement getRosterElement(XMPPResourceConnection session,
                                                         JID jid)
                                                  throws NotAuthorizedException,
                                                         TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getRosterItems

          public List<Element> getRosterItems(XMPPResourceConnection session)
                                       throws NotAuthorizedException,
                                              TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getStateTransition

          public static RosterAbstract.SubscriptionType getStateTransition(RosterAbstract.SubscriptionType subscription,
                                                                           RosterAbstract.PresenceType presence)

    - #### isRosterLoaded

          public abstract boolean isRosterLoaded(XMPPResourceConnection session)

      Check if data containing user roster for this session is loaded from database
      Parameters:
        `session` -
      Returns:

    - #### isOnline

          public abstract boolean isOnline(XMPPResourceConnection session,
                                           JID jid)
                                    throws NotAuthorizedException,
                                           TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### isPendingIn

          public boolean isPendingIn(XMPPResourceConnection session,
                                     JID jid)
                              throws NotAuthorizedException,
                                     TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### isSubscribedFrom

          public boolean isSubscribedFrom(XMPPResourceConnection session,
                                          JID jid)
                                   throws NotAuthorizedException,
                                          TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### isSubscribedFrom

          public boolean isSubscribedFrom(RosterAbstract.SubscriptionType subscr)

    - #### isSubscribedTo

          public boolean isSubscribedTo(XMPPResourceConnection session,
                                        JID jid)
                                 throws NotAuthorizedException,
                                        TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### setBuddyName

          public abstract void setBuddyName(XMPPResourceConnection session,
                                            JID buddy,
                                            String name)
                                     throws NotAuthorizedException,
                                            TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### setBuddySubscription

          public abstract void setBuddySubscription(XMPPResourceConnection session,
                                                    RosterAbstract.SubscriptionType subscription,
                                                    JID buddy)
                                             throws NotAuthorizedException,
                                                    TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### setOnline

          public abstract void setOnline(XMPPResourceConnection session,
                                         JID jid,
                                         boolean online)
                                  throws NotAuthorizedException,
                                         TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### setPresenceSent

          public abstract void setPresenceSent(XMPPResourceConnection session,
                                               JID jid,
                                               boolean sent)
                                        throws NotAuthorizedException,
                                               TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### setProperties

          public void setProperties(Map<String,Object> settings)

Copyright © 2022 "Tigase, Inc.". All rights reserved.