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 BuddyaddBuddy(java.lang.String ownerName, java.lang.String buddyName, boolean isTemp)Use the SFSBuddyAPIbooleanallowOfflineBuddyVariables()Check if the "offline" (persistent) Buddy Variables are supported in the current ZonebooleangetApplyBadWordsFilter()Check if the current Zone applies the WordFilter to the Buddy messagesBuddyListgetBuddyList(java.lang.String ownerName)Get the Buddy List of a specific userintgetBuddyListMaxSize()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)intgetMaxBuddyVariables()Get the limit of BuddyVariables that each User can createBuddyVariablegetOfflineBuddyVariable(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)intgetOfflineBuddyVariablesCacheSize()Get the size of the "offline" Buddy Variables cache.java.util.List<java.lang.String>getRecipientNamesForUpdate(java.lang.String owner)BuddyStoragegetStorageHandler()Get a reference to the instance of the BuddyStorage class, which handles the data persistencebooleangetUseTempBuddies()Check if the current Zone supports temporary BuddiesZonegetZone()Get the parent ZonebooleanisActive()Check if the BuddyList management is active in the ZoneBuddyListloadBuddyList(java.lang.String ownerName)Use the SFSBuddyAPIBuddyremoveBuddy(java.lang.String ownerName, java.lang.String buddyName)Use the SFSBuddyAPIvoidremoveBuddyList(java.lang.String ownerName)voidsaveAll()This is called automatically by the systemvoidsaveBuddyList(java.lang.String ownerName)This is called automatically by the systemvoidsetActive(boolean value)voidsetAllowOfflineBuddyVariables(boolean value)voidsetApplyBadWordsFilter(boolean value)voidsetBuddyListMaxSize(int maxSize)voidsetBuddyStates(java.util.List<java.lang.String> states)voidsetMaxBuddyVariables(int maxVariables)voidsetOfflineBuddyVariablesCacheSize(int size)voidsetStorageHandler(BuddyStorage buddyStorage)voidsetUseTempBuddies(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.IOExceptionThis 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)
-
-