public class OfflineMessageStore extends BasicModule implements UserEventListener
Constructor and Description |
---|
OfflineMessageStore()
Constructs a new offline message store.
|
Modifier and Type | Method and Description |
---|---|
void |
addMessage(org.xmpp.packet.Message message)
Adds a message to this message store.
|
void |
deleteMessage(String username,
Date creationDate)
Deletes the specified offline message in the store for a user.
|
void |
deleteMessages(String username)
Deletes all offline messages in the store for a user.
|
static OfflineMessageStore |
getInstance()
Returns the instance of OfflineMessageStore being used by the XMPPServer.
|
OfflineMessage |
getMessage(String username,
Date creationDate)
Returns the offline message of the specified user with the given creation date.
|
Collection<OfflineMessage> |
getMessages(String username,
boolean delete)
Returns a Collection of all messages in the store for a user.
|
int |
getSize()
Returns the approximate size (in bytes) of the XML messages stored for all
users.
|
int |
getSize(String username)
Returns the approximate size (in bytes) of the XML messages stored for
a particular user.
|
void |
start()
Starts the basic module.
|
void |
stop()
Stops the basic module.
|
void |
userCreated(User user,
Map params)
A user was created.
|
void |
userDeleting(User user,
Map params)
A user is being deleted.
|
void |
userModified(User user,
Map params)
A user's name, email, or an extended property was changed.
|
destroy, getName, initialize
public OfflineMessageStore()
public static OfflineMessageStore getInstance()
public void addMessage(org.xmpp.packet.Message message)
message
- the message to store.public Collection<OfflineMessage> getMessages(String username, boolean delete)
username
- the username of the user who's messages you'd like to receive.delete
- true if the offline messages should be deleted.public OfflineMessage getMessage(String username, Date creationDate)
username
- the username of the user who's message you'd like to receive.creationDate
- the date when the offline message was stored in the database.public void deleteMessages(String username)
username
- the username of the user who's messages are going to be deleted.public void deleteMessage(String username, Date creationDate)
username
- the username of the user who's message is going to be deleted.creationDate
- the date when the offline message was stored in the database.public int getSize(String username)
username
- the username of the user.public int getSize()
public void userCreated(User user, Map params)
UserEventListener
userCreated
in interface UserEventListener
user
- the user.params
- event parameters.public void userDeleting(User user, Map params)
UserEventListener
userDeleting
in interface UserEventListener
user
- the user.params
- event parameters.public void userModified(User user, Map params)
UserEventListener
userModified
in interface UserEventListener
user
- the user.params
- event parameters.public void start() throws IllegalStateException
BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start
in interface Module
start
in class BasicModule
IllegalStateException
- If start is called before initialize
successfully returnspublic void stop()
BasicModule
Stops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop
in interface Module
stop
in class BasicModule
Copyright © 2003-2008 Jive Software.