Class FSBuddyStorage
- All Implemented Interfaces:
BuddyStorage
Stores each buddy list under the {SFS-folder}/data/buddylists/{Zonename}/{Username} folder
Where {Username} is the "encoded" version of the User name. The encoded name consist simply of the hexadecimal version
of the name. This allows to store any user name in the file system including those containing avoid characters (such as *, :, ? etc...)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroy the Storage class.Get a reference to the BuddyManager managing this BuddyStorage classgetOfflineVariables(String buddyName) Load the offline persistent variables for a specific User.voidinit()Initialize the Storage classLoad a Buddy List from your data source.voidThis method is invoked by the Buddy System when a BuddyList needs to be saved.voidsetBuddyListManager(BuddyListManager buddyListManager)
-
Constructor Details
-
FSBuddyStorage
public FSBuddyStorage()
-
-
Method Details
-
init
public void init()Description copied from interface:BuddyStorageInitialize the Storage classAdd here all the necessary code to startup your BuddyStorage class. If you are using a database, this is the right place to start up your connection etc...
- Specified by:
initin interfaceBuddyStorage
-
destroy
public void destroy()Description copied from interface:BuddyStorageDestroy the Storage class.This method is invoked by the server when shutting down the Zones. Here you should make sure to release any resources you might have acquired in the init() phase.
- Specified by:
destroyin interfaceBuddyStorage
-
loadList
Description copied from interface:BuddyStorageLoad a Buddy List from your data source. This method is invoked by the Buddy System when Buddy data needs to be loaded.- Specified by:
loadListin interfaceBuddyStorage- Parameters:
ownerName- name of the BuddyList owner- Returns:
- the BuddyList
- Throws:
SFSBuddyListNotFoundException- thrown if no BuddyList is found for the required UserIOException- thrown if any problem arises during the loading process
-
saveList
Description copied from interface:BuddyStorageThis method is invoked by the Buddy System when a BuddyList needs to be saved.- Specified by:
saveListin interfaceBuddyStorage- Parameters:
buddyList- the BuddyList- Throws:
IOException- thrown if any error arises during the saving process
-
getOfflineVariables
Description copied from interface:BuddyStorageLoad the offline persistent variables for a specific User.Since offline variables are available even when the Buddy is not online this method can be called at any time by the Buddy System. Using a cache to store these variables is usually recommended in order to avoid loading this data multiple timese from a "slow" data sources, such as the Database.
- Specified by:
getOfflineVariablesin interfaceBuddyStorage- Parameters:
buddyName- the name of the Buddy- Returns:
- the List of offline BuddyVariables
- Throws:
IOException- thrown if the loading process fails
-
getBuddyListManager
Description copied from interface:BuddyStorageGet a reference to the BuddyManager managing this BuddyStorage class- Specified by:
getBuddyListManagerin interfaceBuddyStorage- Returns:
- the BuddyManager
-
setBuddyListManager
- Specified by:
setBuddyListManagerin interfaceBuddyStorage
-