Package 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
  Description
  `static enum`
  `RosterAbstract.PresenceType`
  `static class`
  `RosterAbstract.RosterModifiedEvent`
  `static enum`
  `RosterAbstract.StateTransition`
  `static enum`
  `RosterAbstract.SubscriptionType`

- ## Field Summary

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RosterAbstract()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addBuddy(XMPPResourceConnection session, JID jid, String name, String[] groups, String otherData)`
  Deprecated.
  `abstract void`
  `addBuddy(XMPPResourceConnection session, JID jid, String name, String[] groups, RosterAbstract.SubscriptionType subscription, String otherData)`
  Deprecated.
  `abstract void`
  `addBuddy(XMPPResourceConnection session, JID jid, String name, String[] groups, RosterAbstract.SubscriptionType subscription, String mixParticipantId, String otherData)`
  Deprecated.
  `abstract boolean`
  `addBuddyGroup(XMPPResourceConnection session, JID buddy, String[] groups)`
  Deprecated.
  `Queue<Packet>`
  `addJidToRoster(UserRepository repository, XMPPSession session, BareJID owner, RosterElement rosterElement)`
  `abstract boolean`
  `containsBuddy(XMPPResourceConnection session, JID buddy)`
  Deprecated.
  `protected List<XMPPResourceConnection>`
  `getActiveConnections(XMPPSession session)`
  `abstract JID[]`
  `getBuddies(XMPPResourceConnection session)`
  Deprecated.
  `JID[]`
  `getBuddies(XMPPResourceConnection session, EnumSet<RosterAbstract.SubscriptionType> subscrs)`
  Deprecated.
  `String`
  `getBuddiesHash(XMPPResourceConnection session)`
  `abstract String[]`
  `getBuddyGroups(XMPPResourceConnection session, JID buddy)`
  Deprecated.
  `Element`
  `getBuddyItem(XMPPResourceConnection session, JID buddy)`
  `abstract String`
  `getBuddyName(XMPPResourceConnection session, JID buddy)`
  Deprecated.
  `abstract RosterAbstract.SubscriptionType`
  `getBuddySubscription(XMPPResourceConnection session, JID buddy)`
  Deprecated.
  `abstract Element`
  `getCustomChild(XMPPResourceConnection session, JID buddy)`
  Deprecated.
  `List<Element>`
  `getCustomChildren(XMPPResourceConnection session, JID buddy)`
  Deprecated.
  `EventBus`
  `getEventBus()`
  `static int`
  `getMaxRosterSize()`
  `abstract String`
  `getMixParticipantId(XMPPResourceConnection session, JID buddy)`
  Deprecated.
  `RosterAbstract.PresenceType`
  `getPresenceType(XMPPResourceConnection session, Packet packet)`
  `abstract RosterElement`
  `getRosterElement(XMPPResourceConnection session, JID jid)`
  Deprecated.
  `List<Element>`
  `getRosterItems(XMPPResourceConnection session)`
  `static RosterAbstract.SubscriptionType`
  `getStateTransition(RosterAbstract.SubscriptionType subscription, RosterAbstract.PresenceType presence)`
  `String`
  `groupNode(JID buddy)`
  Deprecated.
  `void`
  `handleRosterModified(RosterAbstract.RosterModifiedEvent event)`
  `void`
  `init(UserRepository repo)`
  `static boolean`
  `isEmptyNameAllowed()`
  `abstract boolean`
  `isOnline(XMPPResourceConnection session, JID jid)`
  Deprecated.
  `boolean`
  `isPendingIn(XMPPResourceConnection session, JID jid)`
  Deprecated.
  `boolean`
  `isPreApproved(XMPPResourceConnection session, JID jid)`
  Deprecated.
  `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)`
  Deprecated.
  `boolean`
  `isSubscribedTo(XMPPResourceConnection session, JID jid)`
  Deprecated.
  `abstract void`
  `logout(XMPPResourceConnection session)`
  `void`
  `modifyStoredRoster(UserRepository repository, BareJID owner, Consumer<Map<BareJID,RosterElement>> modifyRoster)`
  `abstract boolean`
  `presenceSent(XMPPResourceConnection session, JID jid)`
  Deprecated.
  `abstract boolean`
  `removeBuddy(XMPPResourceConnection session, JID jid)`
  Deprecated.
  `Queue<Packet>`
  `removeJidFromRoster(UserRepository repository, XMPPSession session, BareJID owner, JID jid)`
  Deprecated.
  `abstract Function<JID,RosterElement>`
  `rosterElementProvider(XMPPResourceConnection session)`
  Deprecated.
  `abstract void`
  `setBuddyName(XMPPResourceConnection session, JID buddy, String name)`
  Deprecated.
  `abstract void`
  `setBuddySubscription(XMPPResourceConnection session, RosterAbstract.SubscriptionType subscription, JID buddy)`
  Deprecated.
  `static void`
  `setEmptyNameAllowed(boolean emptyNameAllowed)`
  `void`
  `setEventBus(EventBus eventBus)`
  `static void`
  `setMaxRosterSize(int maxRosterSize)`
  `abstract void`
  `setOnline(XMPPResourceConnection session, JID jid, boolean online)`
  Deprecated.
  `abstract void`
  `setPresenceSent(XMPPResourceConnection session, JID jid, boolean sent)`
  Deprecated.
  `void`
  `setProperties(Map<String,Object> settings)`
  `void`
  `updateBuddyChange(XMPPResourceConnection session, Queue<Packet> results, Element item)`
  `boolean`
  `updateBuddySubscription(XMPPResourceConnection session, RosterAbstract.PresenceType presence, JID jid)`
  Deprecated.
  `void`
  `updateRosterHash(String roster_str, XMPPResourceConnection session)`
  `void`
  `updateRosterHash(XMPPResourceConnection conn)`
  `protected void`
  `updateRosterHashForConnection(XMPPResourceConnection conn)`
  `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 Details

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

  - ### RosterAbstract

    public RosterAbstract()

- ## Method Details

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

  - ### addJidToRoster

    public Queue<Packet> addJidToRoster(UserRepository repository, XMPPSession session, BareJID owner, RosterElement rosterElement) throws NotAuthorizedException, PolicyViolationException, TigaseDBException, NoConnectionIdException
    Throws:
      `NotAuthorizedException`
      `PolicyViolationException`
      `TigaseDBException`
      `NoConnectionIdException`

  - ### removeJidFromRoster

    @Deprecated public Queue<Packet> removeJidFromRoster(UserRepository repository, XMPPSession session, BareJID owner, JID jid) throws TigaseDBException, NotAuthorizedException, NoConnectionIdException
    Deprecated.
    Throws:
      `TigaseDBException`
      `NotAuthorizedException`
      `NoConnectionIdException`

  - ### getActiveConnections

    protected List<XMPPResourceConnection> getActiveConnections(XMPPSession session)

  - ### modifyStoredRoster

    public void modifyStoredRoster(UserRepository repository, BareJID owner, Consumer<Map<BareJID,RosterElement>> modifyRoster) throws TigaseDBException
    Throws:
      `TigaseDBException`

  - ### addBuddy

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

  - ### addBuddy

    @Deprecated public abstract void addBuddy(XMPPResourceConnection session, JID jid, String name, String[] groups, RosterAbstract.SubscriptionType subscription, String otherData) throws NotAuthorizedException, TigaseDBException, PolicyViolationException
    Deprecated.
    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

    @Deprecated public abstract boolean addBuddyGroup(XMPPResourceConnection session, JID buddy, String[] groups) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### containsBuddy

    @Deprecated public abstract boolean containsBuddy(XMPPResourceConnection session, JID buddy) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### groupNode

    @Deprecated public String groupNode(JID buddy)
    Deprecated.

  - ### init

    public void init(UserRepository repo) throws TigaseDBException, TigaseDBException
    Throws:
      `TigaseDBException`
      `TigaseDBException`

  - ### logout

    public abstract void logout(XMPPResourceConnection session)

  - ### presenceSent

    @Deprecated public abstract boolean presenceSent(XMPPResourceConnection session, JID jid) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### removeBuddy

    @Deprecated public abstract boolean removeBuddy(XMPPResourceConnection session, JID jid) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### updateBuddyChange

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

  - ### updateBuddySubscription

    @Deprecated public boolean updateBuddySubscription(XMPPResourceConnection session, RosterAbstract.PresenceType presence, JID jid) throws NotAuthorizedException, TigaseDBException, PolicyViolationException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`
      `PolicyViolationException`

  - ### updateRosterHash

    public void updateRosterHash(String roster_str, XMPPResourceConnection session)

  - ### getBuddies

    @Deprecated public abstract JID[] getBuddies(XMPPResourceConnection session) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### getBuddies

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

  - ### getBuddiesHash

    public String getBuddiesHash(XMPPResourceConnection session)

  - ### getBuddyGroups

    @Deprecated public abstract String[] getBuddyGroups(XMPPResourceConnection session, JID buddy) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### getBuddyItem

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

  - ### getBuddyName

    @Deprecated public abstract String getBuddyName(XMPPResourceConnection session, JID buddy) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### getBuddySubscription

    @Deprecated public abstract RosterAbstract.SubscriptionType getBuddySubscription(XMPPResourceConnection session, JID buddy) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### getCustomChild

    @Deprecated public abstract Element getCustomChild(XMPPResourceConnection session, JID buddy) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### getCustomChildren

    @Deprecated public List<Element> getCustomChildren(XMPPResourceConnection session, JID buddy) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### getMixParticipantId

    @Deprecated public abstract String getMixParticipantId(XMPPResourceConnection session, JID buddy) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### getPresenceType

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

  - ### getRosterElement

    @Deprecated public abstract RosterElement getRosterElement(XMPPResourceConnection session, JID jid) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### rosterElementProvider

    @Deprecated public abstract Function<JID,RosterElement> rosterElementProvider(XMPPResourceConnection session) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    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

    @Deprecated public abstract boolean isOnline(XMPPResourceConnection session, JID jid) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### isPendingIn

    @Deprecated public boolean isPendingIn(XMPPResourceConnection session, JID jid) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### isSubscribedFrom

    @Deprecated public boolean isSubscribedFrom(XMPPResourceConnection session, JID jid) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### isSubscribedFrom

    public boolean isSubscribedFrom(RosterAbstract.SubscriptionType subscr)

  - ### isSubscribedTo

    @Deprecated public boolean isSubscribedTo(XMPPResourceConnection session, JID jid) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### isPreApproved

    @Deprecated public boolean isPreApproved(XMPPResourceConnection session, JID jid) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### setBuddyName

    @Deprecated public abstract void setBuddyName(XMPPResourceConnection session, JID buddy, String name) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### setBuddySubscription

    @Deprecated public abstract void setBuddySubscription(XMPPResourceConnection session, RosterAbstract.SubscriptionType subscription, JID buddy) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### setOnline

    @Deprecated public abstract void setOnline(XMPPResourceConnection session, JID jid, boolean online) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### setPresenceSent

    @Deprecated public abstract void setPresenceSent(XMPPResourceConnection session, JID jid, boolean sent) throws NotAuthorizedException, TigaseDBException
    Deprecated.
    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`

  - ### updateRosterHash

    public void updateRosterHash(XMPPResourceConnection conn) throws NotAuthorizedException, TigaseDBException
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`

  - ### updateRosterHashForConnection

    protected void updateRosterHashForConnection(XMPPResourceConnection conn) throws NotAuthorizedException, TigaseDBException
    Throws:
      `NotAuthorizedException`
      `TigaseDBException`