tigase.xmpp.impl.roster

## Class RosterAbstract

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

- Direct Known Subclasses:
    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`
    `static class` | `RosterAbstract.RosterModifiedEvent`
    `static class` | `RosterAbstract.StateTransition`
    `static class` | `RosterAbstract.SubscriptionType`

  - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RosterAbstract()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `addBuddy(XMPPResourceConnection session, JID jid, String name, String[] groups, RosterAbstract.SubscriptionType subscription, String otherData)`
    `void` | `addBuddy(XMPPResourceConnection session, JID jid, String name, String[] groups, String otherData)` Deprecated.
    `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)`
    `String` | `getBuddiesHash(XMPPSession 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)`
    `EventBus` | `getEventBus()`
    `static int` | `getMaxRosterSize()`
    `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` | `handleRosterModified(RosterAbstract.RosterModifiedEvent event)`
    `void` | `init(UserRepository repo)`
    `static boolean` | `isEmptyNameAllowed()`
    `abstract boolean` | `isOnline(XMPPResourceConnection session, JID jid)`
    `boolean` | `isPendingIn(XMPPResourceConnection session, JID jid)`
    `boolean` | `isPreApproved(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 Function<JID,RosterElement>` | `rosterElementProvider(XMPPResourceConnection session)`
    `abstract void` | `setBuddyName(XMPPResourceConnection session, JID buddy, String name)`
    `abstract void` | `setBuddySubscription(XMPPResourceConnection session, RosterAbstract.SubscriptionType subscription, JID buddy)`
    `static void` | `setEmptyNameAllowed(boolean emptyNameAllowed)`
    `void` | `setEventBus(EventBus eventBus)`
    `static void` | `setMaxRosterSize(int maxRosterSize)`
    `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)`
    `protected void` | `updateRosterItem(XMPPResourceConnection conn, RosterAbstract.RosterModifiedEvent event)`

    - ### 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

      See Also:
        Constant Field Values

    - #### GROUP

          public static final String GROUP

      See Also:
        Constant Field Values

    - #### GROUPS

          public static final String GROUPS

      See Also:
        Constant Field Values

    - #### NAME

          public static final String NAME

      See Also:
        Constant Field Values

    - #### ROSTER

          public static final String ROSTER

      See Also:
        Constant Field Values

    - #### ROSTER_XMLNS

          public static final String ROSTER_XMLNS

      See Also:
        Constant Field Values

    - #### ROSTERHASH

          public static final String ROSTERHASH

      See Also:
        Constant Field Values

    - #### SUBSCRIPTION

          public static final String SUBSCRIPTION

      See Also:
        Constant Field Values

    - #### VER_ATT

          public static final String VER_ATT

      See Also:
        Constant Field Values

    - #### XMLNS

          public static final String XMLNS

      See Also:
        Constant Field Values

    - #### XMLNS_DYNAMIC

          public static final String XMLNS_DYNAMIC

      See Also:
        Constant Field Values

    - #### XMLNS_LOAD

          public static final String XMLNS_LOAD

      See Also:
        Constant Field Values

    - #### TO_SUBSCRIBED

          public static final EnumSet<RosterAbstract.SubscriptionType> TO_SUBSCRIBED

    - #### SUB_TO

          public static final EnumSet<RosterAbstract.SubscriptionType> SUB_TO

    - #### SUB_NONE

          public static final EnumSet<RosterAbstract.SubscriptionType> SUB_NONE

    - #### SUB_FROM

          public static final EnumSet<RosterAbstract.SubscriptionType> SUB_FROM

    - #### SUB_BOTH

          public static final EnumSet<RosterAbstract.SubscriptionType> SUB_BOTH

    - #### PENDING_OUT

          public static final EnumSet<RosterAbstract.SubscriptionType> PENDING_OUT

    - #### PENDING_IN

          public static final EnumSet<RosterAbstract.SubscriptionType> PENDING_IN

    - #### INITIAL_PRESENCES

          public static final EnumSet<StanzaType> INITIAL_PRESENCES

    - #### FROM_SUBSCRIBED

          public static final EnumSet<RosterAbstract.SubscriptionType> FROM_SUBSCRIBED

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

    - #### PRE_APPROVED

          public static final EnumSet<RosterAbstract.SubscriptionType> PRE_APPROVED

      Holds all {link @SubscriptionType} that are pre-approved subscriptions on the contact's side

    - #### FEATURES

          public static final Element[] FEATURES

    - #### DISCO_FEATURES

          public static final Element[] DISCO_FEATURES

    - #### emptyNameAllowed

          protected static boolean emptyNameAllowed

    - #### maxRosterSize

          protected static int maxRosterSize

  - ### Constructor Detail

    - #### RosterAbstract

          public RosterAbstract()

  - ### Method Detail

    - #### getMaxRosterSize

          public static int getMaxRosterSize()

    - #### setMaxRosterSize

          public static void setMaxRosterSize(int maxRosterSize)

    - #### getStateTransition

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

    - #### isEmptyNameAllowed

          public static boolean isEmptyNameAllowed()

    - #### setEmptyNameAllowed

          public static void setEmptyNameAllowed(boolean emptyNameAllowed)

    - #### getEventBus

          public EventBus getEventBus()

    - #### setEventBus

          public void setEventBus(EventBus eventBus)

    - #### addBuddy

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

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`
        `PolicyViolationException`

    - #### addBuddy

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

      Deprecated.
      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)

    - #### getBuddiesHash

          public String getBuddiesHash(XMPPSession 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`

    - #### rosterElementProvider

          public abstract Function<JID,RosterElement> rosterElementProvider(XMPPResourceConnection session)
                                                                     throws NotAuthorizedException,
                                                                            TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### getRosterItems

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

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

    - #### isRosterLoaded

          public abstract boolean isRosterLoaded(XMPPResourceConnection session)

      Check if data containing user roster for this session is loaded from database

    - #### 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`

    - #### isPreApproved

          public boolean isPreApproved(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)

    - #### handleRosterModified

          @HandleEvent
          public void handleRosterModified(RosterAbstract.RosterModifiedEvent event)

    - #### updateRosterItem

          protected void updateRosterItem(XMPPResourceConnection conn,
                                          RosterAbstract.RosterModifiedEvent event)
                                   throws NotAuthorizedException,
                                          TigaseDBException

      Throws:
        `NotAuthorizedException`
        `TigaseDBException`

Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.