public class HistoryStrategy extends Object
Multi-User Chat rooms may cache history of the conversations in the room in order to play them back to newly arriving members.
This class is an internal component of MUCRoomHistory that describes the strategy that can be used, and provides a method of administering the history behavior.
Modifier and Type | Class and Description |
---|---|
static class |
HistoryStrategy.Type
Strategy type.
|
Constructor and Description |
---|
HistoryStrategy(HistoryStrategy parentStrategy)
Create a history strategy with the given parent strategy (for defaults) or null if no
parent exists.
|
Modifier and Type | Method and Description |
---|---|
void |
addMessage(org.xmpp.packet.Message packet)
Add a message to the current chat history.
|
org.xmpp.packet.Message |
getChangedSubject()
Returns the message within the history of the room that has changed the
room's subject.
|
int |
getMaxNumber()
Obtain the maximum number of messages for strategies using message number limitations.
|
Iterator<org.xmpp.packet.Message> |
getMessageHistory()
Obtain the current history as an iterator of messages to play back to a new room member.
|
ListIterator<org.xmpp.packet.Message> |
getReverseMessageHistory()
Obtain the current history to be iterated in reverse mode.
|
HistoryStrategy.Type |
getType()
Obtain the type of history strategy being used.
|
boolean |
hasChangedSubject()
Returns true if there is a message within the history of the room that has changed the
room's subject.
|
void |
setContext(String subdomain,
String prefix)
Sets the prefix to use for retrieving and saving settings (and also
triggers an immediate loading of properties).
|
void |
setMaxNumber(int max)
Set the maximum number of messages for strategies using message number limitations.
|
void |
setType(HistoryStrategy.Type newType)
Set the type of history strategy being used.
|
void |
setTypeFromString(String typeName)
Obtain the strategy type from string name.
|
public HistoryStrategy(HistoryStrategy parentStrategy)
parentStrategy
- The parent strategy of this strategy or null if none exists.public int getMaxNumber()
public void setMaxNumber(int max)
max
- the maximum number of messages to store in applicable strategies.public void setType(HistoryStrategy.Type newType)
newType
- The new type of chat history to use.public HistoryStrategy.Type getType()
public void addMessage(org.xmpp.packet.Message packet)
packet
- The packet to add to the chatroom's history.public Iterator<org.xmpp.packet.Message> getMessageHistory()
public ListIterator<org.xmpp.packet.Message> getReverseMessageHistory()
public void setTypeFromString(String typeName)
typeName
- the text name of the strategy type.public void setContext(String subdomain, String prefix)
subdomain
- the subdomain of the muc service to pull properties for.prefix
- the prefix to use (without trailing dot) on property names.public boolean hasChangedSubject()
public org.xmpp.packet.Message getChangedSubject()
Copyright © 2003-2008 Jive Software.