Class SFSBuddyManager

  • All Implemented Interfaces:
    IBuddyManager

    public class SFSBuddyManager
    extends java.lang.Object
    implements IBuddyManager
    The SFSBuddyManager class is the entity in charge of managing the current user's Buddy List system. It keeps track of all the user's buddies, their state and their Buddy Variables. It also provides utility methods to set the user's properties when he is part of the buddies list of other users.
    See Also:
    SmartFox.getBuddyManager()
    • Constructor Summary

      Constructors 
      Constructor Description
      SFSBuddyManager​(ISmartFox sfs)
      Creates a new SFSBuddyManager instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addBuddy​(Buddy buddy)
      * API internal usage only *
      void clearAll()
      * API internal usage only *
      boolean containsBuddy​(java.lang.String name)
      Indicates whether a buddy exists in user's buddies list or not.
      Buddy getBuddyById​(int id)
      Retrieves a Buddy object from its id property.
      Buddy getBuddyByName​(java.lang.String name)
      Retrieves a Buddy object from its name property.
      Buddy getBuddyByNickName​(java.lang.String nickName)
      Retrieves a Buddy object from its nickName property (if set).
      java.util.List<Buddy> getBuddyList()
      Returns a list of Buddy objects representing all the buddies in the user's buddies list.
      java.util.List<java.lang.String> getBuddyStates()
      Returns a list of strings representing the available custom buddy states.
      java.lang.String getMyNickName()
      Returns the current user's nickname (if set).
      boolean getMyOnlineState()
      Returns the current user's online/offline state.
      java.lang.String getMyState()
      Returns the current user's custom state (if set).
      BuddyVariable getMyVariable​(java.lang.String varName)
      Retrieves a Buddy Variable from its name.
      java.util.List<BuddyVariable> getMyVariables()
      Returns all the Buddy Variables associated with the current user.
      java.util.List<Buddy> getOfflineBuddies()
      Returns a list of Buddy objects representing all the offline buddies in the user's buddies list.
      java.util.List<Buddy> getOnlineBuddies()
      Returns a list of Buddy objects representing all the online buddies in the user's buddies list.
      boolean isInited()
      Indicates whether the client's Buddy List system is initialized or not.
      Buddy removeBuddyById​(int id)
      * API internal usage only *
      Buddy removeBuddyByName​(java.lang.String name)
      * API internal usage only *
      void setBuddyStates​(java.util.List<java.lang.String> states)
      * API internal usage only *
      void setInited​(boolean inited)
      * API internal usage only *
      void setMyNickName​(java.lang.String nickName)
      * API internal usage only *
      void setMyOnlineState​(boolean isOnline)
      * API internal usage only *
      void setMyState​(java.lang.String state)
      * API internal usage only *
      void setMyVariable​(BuddyVariable bVar)
      * API internal usage only *
      void setMyVariables​(java.util.List<BuddyVariable> variables)
      * API internal usage only *
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SFSBuddyManager

        public SFSBuddyManager​(ISmartFox sfs)
        Creates a new SFSBuddyManager instance.

        NOTE: developers never instantiate a SFSBuddyManager manually: this is done by the SmartFoxServer 2X API internally. A reference to the existing instance can be retrieved using the SmartFox.getBuddyManager() method.

        Parameters:
        sfs - An instance of the SmartFoxServer 2X client API main SmartFox class.
        See Also:
        SmartFox.getBuddyManager()