Interface IBuddyManager
- All Known Implementing Classes:
SFSBuddyManager
In the SmartFoxServer 3 client API this interface is implemented by the SFSBuddyManager class. Read the class description for additional informations.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclearAll()booleancontainsBuddy(String name) Indicates whether a buddy exists in user's buddies list or not.getBuddyById(int id) Retrieves a Buddy object from its id property.getBuddyByName(String name) Retrieves a Buddy object from its name property.getBuddyByNickName(String nickName) Retrieves a Buddy object from its nickName property (if set).Returns a list of Buddy objects representing all the buddies in the user's buddies list.Returns a list of strings representing the available custom buddy states.Gets the nickname of the current User or the User's name, if nickname is not setReturns the current user's nickname (if set).booleanReturns the current user's online/offline state.Returns the current user's custom state (if set).getMyVariable(String varName) Retrieves a Buddy Variable from its name.Returns all the Buddy Variables associated with the current user.Returns a list of Buddy objects representing all the offline buddies in the user's buddies list.Returns a list of Buddy objects representing all the online buddies in the user's buddies list.booleanisInited()Indicates whether the client's Buddy List system is initialized or not.removeBuddyById(int id) removeBuddyByName(String name) voidsetBuddyStates(List<String> states) voidsetInited(boolean inited) voidsetMyNickName(String nickName) voidsetMyOnlineState(boolean isOnline) voidsetMyState(String state) voidsetMyVariable(BuddyVariable bVar) voidsetMyVariables(List<BuddyVariable> variables)
-
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
- Internal
-
removeBuddyById
- Internal
-
removeBuddyByName
- Internal
-
containsBuddy
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:
trueif the specified buddy exists in the buddies list.- See Also:
-
getBuddyById
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
nullif no buddy with the passed id exists in the buddies list. - See Also:
-
getBuddyByName
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
nullif no buddy with the passed name exists in the buddies list. - See Also:
-
getBuddyByNickName
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
nullif no buddy with the passed nickName exists in the buddies list. - See Also:
-
getOfflineBuddies
Returns a list of Buddy objects representing all the offline buddies in the user's buddies list.- See Also:
-
getOnlineBuddies
Returns a list of Buddy objects representing all the online buddies in the user's buddies list.- See Also:
-
getBuddyList
Returns a list of Buddy objects representing all the buddies in the user's buddies list. The list isnullif the Buddy List system is not initialized.- See Also:
-
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
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
nullif 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. Iftrue, 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,nullis 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,nullis 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
- Internal
-
setMyVariables
- Internal
-
setMyOnlineState
- Throws:
SFSException- Internal
-
setMyNickName
- Throws:
SFSException- Internal
-
setMyState
- Throws:
SFSException- Internal
-
setBuddyStates
- Internal
-
clearAll
void clearAll()- Internal
-