public class MUCPersistenceManager extends Object
After the problem with the database has been solved, the information saved in the XML files will be moved to the database.
| Constructor and Description |
|---|
MUCPersistenceManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
deleteFromDB(MUCRoom room)
Removes the room configuration and its affiliates from the database.
|
static void |
deleteLocalProperty(String subdomain,
String name) |
static void |
deleteProperty(String subdomain,
String name)
Deletes a Jive property.
|
static boolean |
getBooleanProperty(String subdomain,
String name)
Returns a boolean value Jive property.
|
static boolean |
getBooleanProperty(String subdomain,
String name,
boolean defaultValue)
Returns a boolean value Jive property.
|
static int |
getIntProperty(String subdomain,
String name,
int defaultValue)
Returns an integer value Jive property.
|
static long |
getLongProperty(String subdomain,
String name,
long defaultValue)
Returns a long value Jive property.
|
static List<String> |
getProperties(String subdomain,
String parent)
Return all immediate children property values of a parent Jive property as a list of strings,
or an empty list if there are no children.
|
static String |
getProperty(String subdomain,
String name)
Returns a Jive property.
|
static String |
getProperty(String subdomain,
String name,
String defaultValue)
Returns a Jive property.
|
static List<String> |
getPropertyNames(String subdomain)
Returns all MUC service property names.
|
static List<String> |
getPropertyNames(String subdomain,
String parent)
Return all immediate children property names of a parent Jive property as a list of strings,
or an empty list if there are no children.
|
static String |
getReservedNickname(MUCRoom room,
String bareJID)
Returns the reserved room nickname for the bare JID in a given room or null if none.
|
static void |
loadFromDB(LocalMUCRoom room)
Loads the room configuration from the database if the room was persistent.
|
static Collection<LocalMUCRoom> |
loadRoomsFromDB(MultiUserChatService chatserver,
Date cleanupDate,
PacketRouter packetRouter)
Loads all the rooms that had occupants after a given date from the database.
|
static void |
refreshProperties(String subdomain)
Resets (reloads) the properties for a specified subdomain.
|
static void |
removeAffiliationFromDB(org.xmpp.packet.JID affiliationJID)
Removes the affiliation of the user from the DB if ANY room that is persistent.
|
static void |
removeAffiliationFromDB(MUCRoom room,
org.xmpp.packet.JID jid,
MUCRole.Affiliation oldAffiliation)
Removes the affiliation of the user from the DB if the room is persistent.
|
static void |
saveAffiliationToDB(MUCRoom room,
org.xmpp.packet.JID jid,
String nickname,
MUCRole.Affiliation newAffiliation,
MUCRole.Affiliation oldAffiliation)
Update the DB with the new affiliation of the user in the room.
|
static boolean |
saveConversationLogBatch(List<org.jivesoftware.openfire.muc.spi.ConversationLogEntry> batch)
Saves the conversation log entry batch to the database.
|
static void |
saveToDB(LocalMUCRoom room)
Save the room configuration to the DB.
|
static void |
setLocalProperty(String subdomain,
String name,
String value) |
static void |
setProperties(String subdomain,
Map<String,String> propertyMap)
Sets multiple Jive properties at once.
|
static void |
setProperty(String subdomain,
String name,
String value)
Sets a Jive property.
|
static void |
updateRoomEmptyDate(MUCRoom room)
Updates the room's lock status in the database.
|
static void |
updateRoomLock(LocalMUCRoom room)
Updates the room's lock status in the database.
|
static void |
updateRoomSubject(MUCRoom room)
Updates the room's subject in the database.
|
public static String getReservedNickname(MUCRoom room, String bareJID)
room - the room where the user would like to obtain his reserved nickname.bareJID - The bare jid of the user of which you'd like to obtain his reserved nickname.public static void loadFromDB(LocalMUCRoom room)
room - the room to load from the database if persistentpublic static void saveToDB(LocalMUCRoom room)
room - The room to save its configuration.public static void deleteFromDB(MUCRoom room)
room - the room to remove from the database.public static Collection<LocalMUCRoom> loadRoomsFromDB(MultiUserChatService chatserver, Date cleanupDate, PacketRouter packetRouter)
chatserver - the chat server that will hold the loaded rooms.cleanupDate - rooms that hadn't been used before this date won't be loaded.packetRouter - the PacketRouter that loaded rooms will use to send packets.public static void updateRoomSubject(MUCRoom room)
room - the room to update its subject in the database.public static void updateRoomLock(LocalMUCRoom room)
room - the room to update its lock status in the database.public static void updateRoomEmptyDate(MUCRoom room)
room - the room to update its lock status in the database.public static void saveAffiliationToDB(MUCRoom room, org.xmpp.packet.JID jid, String nickname, MUCRole.Affiliation newAffiliation, MUCRole.Affiliation oldAffiliation)
room - The room where the affiliation of the user was updated.jid - The bareJID of the user to update this affiliation.nickname - The reserved nickname of the user in the room or null if none.newAffiliation - the new affiliation of the user in the room.oldAffiliation - the previous affiliation of the user in the room.public static void removeAffiliationFromDB(MUCRoom room, org.xmpp.packet.JID jid, MUCRole.Affiliation oldAffiliation)
room - The room where the affiliation of the user was removed.jid - The bareJID of the user to remove his affiliation.oldAffiliation - the previous affiliation of the user in the room.public static void removeAffiliationFromDB(org.xmpp.packet.JID affiliationJID)
affiliationJID - The bareJID of the user to remove his affiliation from ALL persistent rooms.public static boolean saveConversationLogBatch(List<org.jivesoftware.openfire.muc.spi.ConversationLogEntry> batch)
batch - a list of ConversationLogEntry to save to the database.public static String getProperty(String subdomain, String name)
subdomain - the subdomain of the service to retrieve a property fromname - the name of the property to return.public static String getProperty(String subdomain, String name, String defaultValue)
defaultValue will be returned.subdomain - the subdomain of the service to retrieve a property fromname - the name of the property to return.defaultValue - value returned if the property doesn't exist.public static int getIntProperty(String subdomain, String name, int defaultValue)
defaultValue will be returned.subdomain - the subdomain of the service to retrieve a property fromname - the name of the property to return.defaultValue - value returned if the property doesn't exist or was not
a number.defaultValue.public static long getLongProperty(String subdomain, String name, long defaultValue)
defaultValue will be returned.subdomain - the subdomain of the service to retrieve a property fromname - the name of the property to return.defaultValue - value returned if the property doesn't exist or was not
a number.defaultValue.public static boolean getBooleanProperty(String subdomain, String name)
subdomain - the subdomain of the service to retrieve a property fromname - the name of the property to return."true" (ignoring case).
Otherwise false is returned.public static boolean getBooleanProperty(String subdomain, String name, boolean defaultValue)
defaultValue
will be returned.
If the specified property can't be found, or if the value is not a number, the
defaultValue will be returned.subdomain - the subdomain of the service to retrieve a property fromname - the name of the property to return.defaultValue - value returned if the property doesn't exist."true" (ignoring case).
Otherwise false is returned.public static List<String> getPropertyNames(String subdomain, String parent)
X.Y.A, X.Y.B, X.Y.C and X.Y.C.D, then
the immediate child properties of X.Y are A, B, and
C (C.D would not be returned using this method).subdomain - the subdomain of the service to retrieve a property fromparent - the root "node" of the properties to retrievepublic static List<String> getProperties(String subdomain, String parent)
X.Y.A, X.Y.B, X.Y.C and X.Y.C.D, then
the immediate child properties of X.Y are X.Y.A, X.Y.B, and
X.Y.C (the value of X.Y.C.D would not be returned using this method).subdomain - the subdomain of the service to retrieve a property fromparent - the name of the parent property to return the children for.public static List<String> getPropertyNames(String subdomain)
subdomain - the subdomain of the service to retrieve a property frompublic static void setProperty(String subdomain, String name, String value)
subdomain - the subdomain of the service to set a property forname - the name of the property being set.value - the value of the property being set.public static void setProperties(String subdomain, Map<String,String> propertyMap)
subdomain - the subdomain of the service to set properties forpropertyMap - a map of properties, keyed on property name.public static void deleteProperty(String subdomain, String name)
subdomain - the subdomain of the service to delete a property fromname - the name of the property to delete.public static void refreshProperties(String subdomain)
subdomain - the subdomain of the service to reload properties for.Copyright © 2003–2020 Ignite Realtime. All rights reserved.