Interface IBuddyManager

All Known Implementing Classes:
SFSBuddyManager

public interface IBuddyManager
The IBuddyManager interface defines all the methods and properties exposed by the client-side manager of the SmartFoxServer Buddy List system.

In the SmartFoxServer 3 client API this interface is implemented by the SFSBuddyManager class. Read the class description for additional informations.

See Also:
  • Method Details

    • isInited

      boolean isInited()
      Indicates whether the client's Buddy List system is initialized or not. If not, an InitBuddyListRequest request should be sent to the server in order to retrieve the persistent Buddy List data.

      No Buddy List related operations are allowed until the system is initialized.

      See Also:
    • setInited

      void setInited(boolean inited)
      Internal
    • addBuddy

      void addBuddy(Buddy buddy)
      Internal
    • removeBuddyById

      Buddy removeBuddyById(int id)
      Internal
    • removeBuddyByName

      Buddy removeBuddyByName(String name)
      Internal
    • containsBuddy

      boolean containsBuddy(String name)
      Indicates whether a buddy exists in user's buddies list or not.
      Parameters:
      name - The name of the buddy whose presence in the buddies list is to be tested.
      Returns:
      true if the specified buddy exists in the buddies list.
      See Also:
    • getBuddyById

      Buddy getBuddyById(int id)
      Retrieves a Buddy object from its id property.
      Parameters:
      id - The id of the buddy to be found.
      Returns:
      The Buddy object representing the buddy, or null if no buddy with the passed id exists in the buddies list.
      See Also:
    • getBuddyByName

      Buddy getBuddyByName(String name)
      Retrieves a Buddy object from its name property.
      Parameters:
      name - The name of the buddy to be found.
      Returns:
      The Buddy object representing the buddy, or null if no buddy with the passed name exists in the buddies list.
      See Also:
    • getBuddyByNickName

      Buddy getBuddyByNickName(String nickName)
      Retrieves a Buddy object from its nickName property (if set).
      Parameters:
      nickName - The nickName of the buddy to be found.
      Returns:
      The Buddy object representing the buddy, or null if no buddy with the passed nickName exists in the buddies list.
      See Also:
    • getOfflineBuddies

      List<Buddy> getOfflineBuddies()
      Returns a list of Buddy objects representing all the offline buddies in the user's buddies list.
      See Also:
    • getOnlineBuddies

      List<Buddy> getOnlineBuddies()
      Returns a list of Buddy objects representing all the online buddies in the user's buddies list.
      See Also:
    • getBuddyList

      List<Buddy> getBuddyList()
      Returns a list of Buddy objects representing all the buddies in the user's buddies list. The list is null if the Buddy List system is not initialized.
      See Also:
    • getBuddyStates

      List<String> getBuddyStates()
      Returns a list of strings representing the available custom buddy states. The custom states are received by the client upon initialization of the Buddy List system. They can be configured by means of the SmartFoxServer 3 Administration Tool.
      See Also:
    • getMyVariable

      BuddyVariable getMyVariable(String varName)
      Retrieves a Buddy Variable from its name.
      Parameters:
      varName - The name of the Buddy Variable to be retrieved.
      Returns:
      The BuddyVariable object representing the Buddy Variable, or null if no Buddy Variable with the passed name is associated with the current user.
      See Also:
    • getMyVariables

      List<BuddyVariable> getMyVariables()
      Returns all the Buddy Variables associated with the current user.
      See Also:
    • getMyOnlineState

      boolean getMyOnlineState()
      Returns the current user's online/offline state. If true, the user appears to be online in the buddies list of other users who have him as a buddy.

      The online state of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class); it can be changed using the dedicated GoOnlineRequest request.

      See Also:
    • getMyNickName

      String getMyNickName()
      Returns the current user's nickname (if set). If the nickname was never set before, null is returned.

      As the nickname of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class), it can be set using the SetBuddyVariablesRequest request.

      See Also:
    • getMyState

      String getMyState()
      Returns the current user's custom state (if set). Examples of custom states are "Available", "Busy", "Be right back", etc. If the custom state was never set before, null is returned.

      As the custom state of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class), it can be set using the SetBuddyVariablesRequest request.

      See Also:
    • getMyDisplayName

      String getMyDisplayName()
      Gets the nickname of the current User or the User's name, if nickname is not set
      Returns:
      nickname of the current User or the User's name, if nickname is not set
    • setMyVariable

      void setMyVariable(BuddyVariable bVar)
      Internal
    • setMyVariables

      void setMyVariables(List<BuddyVariable> variables)
      Internal
    • setMyOnlineState

      void setMyOnlineState(boolean isOnline) throws SFSException
      Throws:
      SFSException
      Internal
    • setMyNickName

      void setMyNickName(String nickName) throws SFSException
      Throws:
      SFSException
      Internal
    • setMyState

      void setMyState(String state) throws SFSException
      Throws:
      SFSException
      Internal
    • setBuddyStates

      void setBuddyStates(List<String> states)
      Internal
    • clearAll

      void clearAll()
      Internal