Class FallbackIndicationManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smackx.fallback_indication.FallbackIndicationManager
-
public final class FallbackIndicationManager extends org.jivesoftware.smack.Manager
Smacks API for XEP-0428: Fallback Indication. In some scenarios it might make sense to mark the body of a message as fallback for legacy clients. Examples are encryption mechanisms where the sender might include a hint for legacy clients stating that the body (eg. "This message is encrypted") should be ignored.- See Also:
- XEP-0428: Fallback Indication
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.jivesoftware.smack.packet.MessageBuilder
addFallbackIndication(org.jivesoftware.smack.packet.MessageBuilder messageBuilder)
Add aFallbackIndicationElement
to the provided message builder.void
addFallbackIndicationListener(FallbackIndicationListener listener)
Register aFallbackIndicationListener
that gets notified whenever a message that contains aFallbackIndicationElement
is received.static org.jivesoftware.smack.packet.MessageBuilder
addFallbackIndicationWithBody(org.jivesoftware.smack.packet.MessageBuilder messageBuilder, java.lang.String fallbackMessageBody)
Set the body of the message to the provided fallback message and add aFallbackIndicationElement
.static FallbackIndicationManager
getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
void
removeFallbackIndicationListener(FallbackIndicationListener listener)
Unregister aFallbackIndicationListener
.boolean
serverSupportsFallbackIndications()
Determine, whether or not the server supports Fallback Indications.boolean
userSupportsFallbackIndications(org.jxmpp.jid.EntityBareJid jid)
Determine, whether or not a user supports Fallback Indications.
-
-
-
Method Detail
-
getInstanceFor
public static FallbackIndicationManager getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
-
userSupportsFallbackIndications
public boolean userSupportsFallbackIndications(org.jxmpp.jid.EntityBareJid jid) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException
Determine, whether or not a user supports Fallback Indications.- Parameters:
jid
- BareJid of the user.- Returns:
- feature support
- Throws:
org.jivesoftware.smack.XMPPException.XMPPErrorException
- if a protocol level error happensorg.jivesoftware.smack.SmackException.NotConnectedException
- if the connection is not connectedjava.lang.InterruptedException
- if the thread is being interruptedorg.jivesoftware.smack.SmackException.NoResponseException
- if the server doesn't send a response in time
-
serverSupportsFallbackIndications
public boolean serverSupportsFallbackIndications() throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException
Determine, whether or not the server supports Fallback Indications.- Returns:
- server side feature support
- Throws:
org.jivesoftware.smack.XMPPException.XMPPErrorException
- if a protocol level error happensorg.jivesoftware.smack.SmackException.NotConnectedException
- if the connection is not connectedjava.lang.InterruptedException
- if the thread is being interruptedorg.jivesoftware.smack.SmackException.NoResponseException
- if the server doesn't send a response in time
-
addFallbackIndicationWithBody
public static org.jivesoftware.smack.packet.MessageBuilder addFallbackIndicationWithBody(org.jivesoftware.smack.packet.MessageBuilder messageBuilder, java.lang.String fallbackMessageBody)
Set the body of the message to the provided fallback message and add aFallbackIndicationElement
.- Parameters:
messageBuilder
- message builderfallbackMessageBody
- fallback message body- Returns:
- builder with set body and added fallback element
-
addFallbackIndication
public static org.jivesoftware.smack.packet.MessageBuilder addFallbackIndication(org.jivesoftware.smack.packet.MessageBuilder messageBuilder)
Add aFallbackIndicationElement
to the provided message builder.- Parameters:
messageBuilder
- message builder- Returns:
- message builder with added fallback element
-
addFallbackIndicationListener
public void addFallbackIndicationListener(FallbackIndicationListener listener)
Register aFallbackIndicationListener
that gets notified whenever a message that contains aFallbackIndicationElement
is received.- Parameters:
listener
- listener to be registered.
-
removeFallbackIndicationListener
public void removeFallbackIndicationListener(FallbackIndicationListener listener)
Unregister aFallbackIndicationListener
.- Parameters:
listener
- listener to be unregistered.
-
-