Package org.jivesoftware.openfire.muc
Class MUCRoomHistory
java.lang.Object
org.jivesoftware.openfire.muc.MUCRoomHistory
- All Implemented Interfaces:
Externalizable,Serializable
Represent the data model for one
MUCRoom history. Including chat transcript,
joining and leaving times.- Author:
- Gaston Dombiak, Guus der Kinderen, guus@goodbytes.nl
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionThis constructor is provided to comply with the Externalizable interface contract.MUCRoomHistory(MUCRoom room, HistoryStrategy historyStrategy) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(org.xmpp.packet.Message packet) voidaddOldMessages(List<org.xmpp.packet.Message> oldMessages) Add message(s) to the history of the chat room.voidaddOldMessages(org.xmpp.packet.Message... oldMessages) Add message(s) to the history of the chat room.booleanorg.xmpp.packet.MessageDeprecated, for removal: This API element is subject to removal in a future version.intReturns the maximum number of messages that is kept in history for this room, or -1 when there is no such limit.Iterator<org.xmpp.packet.Message>ListIterator<org.xmpp.packet.Message>Obtain the current history to be iterated in reverse mode.protected MUCRoomgetRoom()Returns the room for which this instance is operating.booleanDeprecated, for removal: This API element is subject to removal in a future version.Since Openfire 5.1.0, a room's subject is managed byMUCRoomdirectly.inthashCode()booleanisSubjectChangeRequest(org.xmpp.packet.Message message) Deprecated.Since Openfire 5.1.0, a room's subject is managed byMUCRoomdirectly.org.xmpp.packet.MessageparseHistoricMessage(String senderJID, String nickname, Date sentDate, String subject, String body, String stanza) Creates a new message, representing a message that was exchanged in a chat room in the past, based on the provided information.voidpurge()Removes all history that is maintained for this instance.voidvoid
-
Constructor Details
-
MUCRoomHistory
public MUCRoomHistory()This constructor is provided to comply with the Externalizable interface contract. It should not be used directly. -
MUCRoomHistory
-
-
Method Details
-
addMessage
public void addMessage(org.xmpp.packet.Message packet) -
getMessageHistory
-
getReverseMessageHistory
Obtain the current history to be iterated in reverse mode. This means that the returned list iterator will be positioned at the end of the history so senders of this message must traverse the list in reverse mode.- Returns:
- A list iterator of Message objects positioned at the end of the list.
-
addOldMessages
Add message(s) to the history of the chat room. The messages will likely come from the database when loading the room history from the database.- Parameters:
oldMessages- The messages to add to the history
-
addOldMessages
public void addOldMessages(@Nonnull org.xmpp.packet.Message... oldMessages) Add message(s) to the history of the chat room. The messages will likely come from the database when loading the room history from the database.- Parameters:
oldMessages- The messages to add to the history
-
parseHistoricMessage
public org.xmpp.packet.Message parseHistoricMessage(String senderJID, String nickname, Date sentDate, String subject, String body, String stanza) Creates a new message, representing a message that was exchanged in a chat room in the past, based on the provided information. This information will likely come from the database when loading the room history from the database.- Parameters:
senderJID- the sender's JID of the message.nickname- the sender's nickname of the message.sentDate- the date when the message was sent to the room.subject- the subject included in the message.body- the body of the message.stanza- the stanza to add- Returns:
- A historic chat message.
-
purge
public void purge()Removes all history that is maintained for this instance. -
getRoom
Returns the room for which this instance is operating.- Returns:
- A room.
-
hasChangedSubject
Deprecated, for removal: This API element is subject to removal in a future version.Since Openfire 5.1.0, a room's subject is managed byMUCRoomdirectly.Returns true if there is a message within the history of the room that has changed the room's subject.- Returns:
- true if there is a message within the history of the room that has changed the room's subject.
-
getChangedSubject
Deprecated, for removal: This API element is subject to removal in a future version.Since Openfire 5.1.0, a room's subject is managed byMUCRoomdirectly.Returns the message within the history of the room that has changed the room's subject.- Returns:
- the latest room subject change or null if none exists yet.
-
isSubjectChangeRequest
Deprecated.Since Openfire 5.1.0, a room's subject is managed byMUCRoomdirectly.Returns true if the given message qualifies as a subject change request, per XEP-0045.- Parameters:
message- the message to check- Returns:
- true if the given packet is a subject change request
-
getMaxMessages
public int getMaxMessages()Returns the maximum number of messages that is kept in history for this room, or -1 when there is no such limit.- Returns:
- The maximum number of historic messages to keep for this room, or -1.
-
equals
-
hashCode
public int hashCode() -
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
MUCRoomdirectly.