Package org.jivesoftware.smackx.mood
Class MoodManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.mood.MoodManager
Entry point for Smacks API for XEP-0107: User Mood.
To set a mood, please use one of the
In order to get updated about other users moods, register a
To stop publishing the users mood, refer to
It is also possible to add
The API can be extended with custom mood concretisations by extending
An example of how this can be done can be found in the MoodConcretisationTest in the test package.
setMood(Mood)
methods. This will publish the users mood to a pubsub
node.In order to get updated about other users moods, register a
PepEventListener
at
addMoodListener(PepEventListener)
. That listener will get updated about any incoming mood updates of contacts.To stop publishing the users mood, refer to
clearMood()
.It is also possible to add
MoodElement
s to Message
s by using addMoodToMessage(Message, Mood)
.The API can be extended with custom mood concretisations by extending
MoodConcretisation
and registering
MoodConcretisationProvider
s using ProviderManager.addExtensionProvider(String, String, Object)
.An example of how this can be done can be found in the MoodConcretisationTest in the test package.
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addMoodListener
(PepEventListener<MoodElement> listener) static void
addMoodToMessage
(Message message, Mood mood) static void
addMoodToMessage
(Message message, Mood mood, MoodConcretisation concretisation) void
static MoodManager
getInstanceFor
(XMPPConnection connection) boolean
removeMoodListener
(PepEventListener<MoodElement> listener) void
void
void
setMood
(Mood mood, MoodConcretisation concretisation) void
setMood
(Mood mood, MoodConcretisation concretisation, String text) Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Field Details
-
MOOD_NODE
- See Also:
-
-
Method Details
-
getInstanceFor
-
setMood
-
setMood
-
setMood
-
setMood
public void setMood(Mood mood, MoodConcretisation concretisation, String text) throws InterruptedException, SmackException.NotLoggedInException, SmackException.NoResponseException, SmackException.NotConnectedException, XMPPException.XMPPErrorException, PubSubException.NotALeafNodeException -
clearMood
-
addMoodToMessage
-
addMoodToMessage
-
addMoodListener
-
removeMoodListener
-