sfs2x.client.entities
Interface Buddy

All Known Implementing Classes:
SFSBuddy

public interface Buddy

The Buddy interface defines all the methods and properties that an object representing a SmartFoxServer Buddy entity exposes.

In the SmartFoxServer 2X client API this interface is implemented by the SFSBuddy class. Read the class description for additional informations.

See Also:
SFSBuddy

Method Summary
 void clearVolatileVariables()
          *Private*
 boolean containsVariable(java.lang.String varName)
          Indicates whether this buddy has the specified Buddy Variable set or not.
 int getId()
          Indicates the id of this buddy.
 java.lang.String getName()
          Indicates the name of this buddy.
 java.lang.String getNickName()
          Returns the nickname of this buddy.
 java.util.List<BuddyVariable> getOfflineVariables()
          Retrieves the list of persistent Buddy Variables of this buddy.
 java.util.List<BuddyVariable> getOnlineVariables()
          Retrieves the list of non-persistent Buddy Variables of this buddy.
 java.lang.String getState()
          Returns the custom state of this buddy.
 BuddyVariable getVariable(java.lang.String varName)
          Retrieves a Buddy Variable from its name.
 java.util.List<BuddyVariable> getVariables()
          Returns a list of BuddyVariable objects associated with the buddy.
 boolean isBlocked()
          Indicates whether this buddy is blocked in the current user's buddies list or not.
 boolean isOnline()
          Indicates whether this buddy is temporary (non-persistent) in the current user's buddies list or not.
 boolean isTemp()
          Return true if the Buddy is temporary (not persistent)
 void removeVariable(java.lang.String varName)
          *Private*
 void setBlocked(boolean blocked)
          *Private*
 void setId(int id)
          *Private*
 void setVariable(BuddyVariable bVar)
          *Private*
 void setVariables(java.util.List<BuddyVariable> variables)
          *Private*
 

Method Detail

getId

int getId()
Indicates the id of this buddy. This is equal to the id assigned by SmartFoxServer to the corresponding user.

See Also:
User.getId()

getName

java.lang.String getName()
Indicates the name of this buddy. This is equal to the name of the corresponding user.

See Also:
User.getName()

isBlocked

boolean isBlocked()
Indicates whether this buddy is blocked in the current user's buddies list or not. A buddy can be blocked by means of a BlockBuddyRequest request.

See Also:
BlockBuddyRequest

isOnline

boolean isOnline()
Indicates whether this buddy is temporary (non-persistent) in the current user's buddies list or not.


isTemp

boolean isTemp()
Return true if the Buddy is temporary (not persistent)


getState

java.lang.String getState()
Returns the custom state of this buddy. Examples of custom states are "Available", "Busy", "Be right back", etc. If the custom state is not set, null is returned.

The list of available custom states is returned by the IBuddyManager.buddyStates property.

See Also:
IBuddyManager.getBuddyStates()

getNickName

java.lang.String getNickName()
Returns the nickname of this buddy. If the nickname is not set, null is returned.


getVariables

java.util.List<BuddyVariable> getVariables()
Returns a list of BuddyVariable objects associated with the buddy.

See Also:
BuddyVariable, getVariable(String)

getVariable

BuddyVariable getVariable(java.lang.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 this buddy.
See Also:
getVariables(), SetBuddyVariablesRequest

containsVariable

boolean containsVariable(java.lang.String varName)
Indicates whether this buddy has the specified Buddy Variable set or not.

Parameters:
varName - The name of the Buddy Variable whose existance must be checked.
Returns:
true if a Buddy Variable with the passed name is set for this buddy.

getOfflineVariables

java.util.List<BuddyVariable> getOfflineVariables()
Retrieves the list of persistent Buddy Variables of this buddy.

Returns:
An array of BuddyVariable objects.
See Also:
BuddyVariable.isOffline

getOnlineVariables

java.util.List<BuddyVariable> getOnlineVariables()
Retrieves the list of non-persistent Buddy Variables of this buddy.

Returns:
An array of BuddyVariable objects.
See Also:
BuddyVariable.isOffline

setVariable

void setVariable(BuddyVariable bVar)
*Private*


setVariables

void setVariables(java.util.List<BuddyVariable> variables)
*Private*


setId

void setId(int id)
*Private*


setBlocked

void setBlocked(boolean blocked)
*Private*


removeVariable

void removeVariable(java.lang.String varName)
*Private*


clearVolatileVariables

void clearVolatileVariables()
*Private*