Package com.smartfoxserver.v2.buddylist
Interface BuddyListManager
-
- All Superinterfaces:
com.smartfoxserver.bitswarm.service.IService
- All Known Implementing Classes:
SFSBuddyListManager
public interface BuddyListManager extends com.smartfoxserver.bitswarm.service.IService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Buddy
addBuddy(java.lang.String ownerName, java.lang.String buddyName, boolean isTemp)
Use the SFSBuddyAPIboolean
allowOfflineBuddyVariables()
Check if the "offline" (persistent) Buddy Variables are supported in the current Zoneboolean
getApplyBadWordsFilter()
Check if the current Zone applies the WordFilter to the Buddy messagesBuddyList
getBuddyList(java.lang.String ownerName)
Get the Buddy List of a specific userint
getBuddyListMaxSize()
Get the maximum size of a BuddyListjava.util.List<java.lang.String>
getBuddyStates()
Get a list of custom Buddy states such as "Available", "Occupied", "Be right back" etc...java.util.List<ISession>
getClientsWatchingBuddy(java.lang.String buddyName)
java.util.List<ISession>
getClientsWatchingBuddy(java.lang.String buddyName, boolean onlineUsersOnly)
int
getMaxBuddyVariables()
Get the limit of BuddyVariables that each User can createBuddyVariable
getOfflineBuddyVariable(java.lang.String ownerName, java.lang.String varName)
java.util.List<BuddyVariable>
getOfflineBuddyVariables(java.lang.String ownerName)
java.util.List<BuddyVariable>
getOfflineBuddyVariables(java.lang.String ownerName, boolean bypassCache)
int
getOfflineBuddyVariablesCacheSize()
Get the size of the "offline" Buddy Variables cache.java.util.List<java.lang.String>
getRecipientNamesForUpdate(java.lang.String owner)
BuddyStorage
getStorageHandler()
Get a reference to the instance of the BuddyStorage class, which handles the data persistenceboolean
getUseTempBuddies()
Check if the current Zone supports temporary BuddiesZone
getZone()
Get the parent Zoneboolean
isActive()
Check if the BuddyList management is active in the ZoneBuddyList
loadBuddyList(java.lang.String ownerName)
Use the SFSBuddyAPIBuddy
removeBuddy(java.lang.String ownerName, java.lang.String buddyName)
Use the SFSBuddyAPIvoid
removeBuddyList(java.lang.String ownerName)
void
saveAll()
This is called automatically by the systemvoid
saveBuddyList(java.lang.String ownerName)
This is called automatically by the systemvoid
setActive(boolean value)
void
setAllowOfflineBuddyVariables(boolean value)
void
setApplyBadWordsFilter(boolean value)
void
setBuddyListMaxSize(int maxSize)
void
setBuddyStates(java.util.List<java.lang.String> states)
void
setMaxBuddyVariables(int maxVariables)
void
setOfflineBuddyVariablesCacheSize(int size)
void
setStorageHandler(BuddyStorage buddyStorage)
void
setUseTempBuddies(boolean value)
-
-
-
Method Detail
-
getZone
Zone getZone()
Get the parent Zone- Returns:
- the parent Zone
-
getBuddyListMaxSize
int getBuddyListMaxSize()
Get the maximum size of a BuddyList- Returns:
- the maximum size of a BuddyList
-
setBuddyListMaxSize
void setBuddyListMaxSize(int maxSize)
-
getOfflineBuddyVariablesCacheSize
int getOfflineBuddyVariablesCacheSize()
Get the size of the "offline" Buddy Variables cache.- Returns:
- the size of the "offline" Buddy Variables cache.
-
setOfflineBuddyVariablesCacheSize
void setOfflineBuddyVariablesCacheSize(int size)
-
getMaxBuddyVariables
int getMaxBuddyVariables()
Get the limit of BuddyVariables that each User can create- Returns:
- the limit of BuddyVariables that each User can create
-
setMaxBuddyVariables
void setMaxBuddyVariables(int maxVariables)
-
isActive
boolean isActive()
Check if the BuddyList management is active in the Zone- Returns:
- true if the BuddyList management is active in the Zone
-
setActive
void setActive(boolean value)
-
allowOfflineBuddyVariables
boolean allowOfflineBuddyVariables()
Check if the "offline" (persistent) Buddy Variables are supported in the current Zone- Returns:
- true if the "offline" (persistent) Buddy Variables are supported in the current Zone
-
setAllowOfflineBuddyVariables
void setAllowOfflineBuddyVariables(boolean value)
-
getStorageHandler
BuddyStorage getStorageHandler()
Get a reference to the instance of the BuddyStorage class, which handles the data persistence- Returns:
- a reference to the instance of the BuddyStorage class, which handles the data persistence
-
setStorageHandler
void setStorageHandler(BuddyStorage buddyStorage)
-
addBuddy
Buddy addBuddy(java.lang.String ownerName, java.lang.String buddyName, boolean isTemp) throws SFSBuddyListException
Use the SFSBuddyAPI
-
removeBuddy
Buddy removeBuddy(java.lang.String ownerName, java.lang.String buddyName)
Use the SFSBuddyAPI
-
getBuddyList
BuddyList getBuddyList(java.lang.String ownerName)
Get the Buddy List of a specific user- Parameters:
ownerName
- the user name- Returns:
- the Buddy List
-
removeBuddyList
void removeBuddyList(java.lang.String ownerName)
-
loadBuddyList
BuddyList loadBuddyList(java.lang.String ownerName) throws java.io.IOException
Use the SFSBuddyAPI- Throws:
java.io.IOException
- See Also:
SFSBuddyApi.initBuddyList(com.smartfoxserver.v2.entities.User, boolean)
-
saveBuddyList
void saveBuddyList(java.lang.String ownerName) throws java.io.IOException
This is called automatically by the system- Throws:
java.io.IOException
-
saveAll
void saveAll()
This is called automatically by the system
-
getOfflineBuddyVariables
java.util.List<BuddyVariable> getOfflineBuddyVariables(java.lang.String ownerName)
-
getOfflineBuddyVariables
java.util.List<BuddyVariable> getOfflineBuddyVariables(java.lang.String ownerName, boolean bypassCache)
-
getOfflineBuddyVariable
BuddyVariable getOfflineBuddyVariable(java.lang.String ownerName, java.lang.String varName)
-
getClientsWatchingBuddy
java.util.List<ISession> getClientsWatchingBuddy(java.lang.String buddyName)
-
getClientsWatchingBuddy
java.util.List<ISession> getClientsWatchingBuddy(java.lang.String buddyName, boolean onlineUsersOnly)
-
getBuddyStates
java.util.List<java.lang.String> getBuddyStates()
Get a list of custom Buddy states such as "Available", "Occupied", "Be right back" etc... These states are defined in the Zone configuration and are transmitted to the client upon Buddy List initialization.- Returns:
- a list of custom Buddy states
-
setBuddyStates
void setBuddyStates(java.util.List<java.lang.String> states)
-
getUseTempBuddies
boolean getUseTempBuddies()
Check if the current Zone supports temporary Buddies- Returns:
- true if the current Zone supports temporary Buddies
-
setUseTempBuddies
void setUseTempBuddies(boolean value)
-
getApplyBadWordsFilter
boolean getApplyBadWordsFilter()
Check if the current Zone applies the WordFilter to the Buddy messages- Returns:
- true if the current Zone applies the WordFilter to the Buddy messages
- See Also:
SFSBuddyApi.sendBuddyMessage(com.smartfoxserver.v2.entities.User, com.smartfoxserver.v2.entities.User, String, com.smartfoxserver.v2.entities.data.ISFSObject)
-
setApplyBadWordsFilter
void setApplyBadWordsFilter(boolean value)
-
getRecipientNamesForUpdate
java.util.List<java.lang.String> getRecipientNamesForUpdate(java.lang.String owner)
-
-