Class PrivacyListProvider
java.lang.Object
org.jivesoftware.openfire.privacy.PrivacyListProvider
Provider for the privacy lists system. Privacy lists are read and written
from the
ofPrivacyList database table.- Author:
- Gaston Dombiak
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePrivacyList(String username, PrivacyList list) Creates and saves the new privacy list to the database.voiddeletePrivacyList(String username, String listName) Deletes an existing privacy list from the database.voiddeletePrivacyLists(String username) Deletes all existing privacy list from the database for the given user.static PrivacyListProviderReturns the unique instance of this class.getPrivacyLists(String username) Returns the names of the existing privacy lists indicating which one is the default privacy list associated to a user.loadDefaultPrivacyList(String username) Loads the default privacy list of a given user from the database.loadPrivacyList(String username, String listName) Loads the requested privacy list from the database.voidupdatePrivacyList(String username, PrivacyList list) Updated the existing privacy list in the database.
-
Method Details
-
getInstance
Returns the unique instance of this class.- Returns:
- the unique instance of this class.
-
getPrivacyLists
Returns the names of the existing privacy lists indicating which one is the default privacy list associated to a user.- Parameters:
username- the username of the user to get his privacy lists names.- Returns:
- the names of the existing privacy lists with a default flag.
-
loadPrivacyList
Loads the requested privacy list from the database. Returnsnullif a list with the specified name does not exist.- Parameters:
username- the username of the user to get his privacy list.listName- name of the list to load.- Returns:
- the privacy list with the specified name or
nullif a list with the specified name does not exist.
-
loadDefaultPrivacyList
Loads the default privacy list of a given user from the database. Returnsnullif no list was found.- Parameters:
username- the username of the user to get his default privacy list.- Returns:
- the default privacy list or
nullif no list was found.
-
createPrivacyList
Creates and saves the new privacy list to the database.- Parameters:
username- the username of the user that created a new privacy list.list- the PrivacyList to save.
-
updatePrivacyList
Updated the existing privacy list in the database.- Parameters:
username- the username of the user that updated a privacy list.list- the PrivacyList to update in the database.
-
deletePrivacyList
Deletes an existing privacy list from the database.- Parameters:
username- the username of the user that deleted a privacy list.listName- the name of the PrivacyList to delete.
-
deletePrivacyLists
Deletes all existing privacy list from the database for the given user.- Parameters:
username- the username of the user whose privacy lists are going to be deleted.
-