Class FallbackIndicationManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.fallback_indication.FallbackIndicationManager
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:
-
Method Summary
Modifier and TypeMethodDescriptionstatic MessageBuilderaddFallbackIndication(MessageBuilder messageBuilder) Add aFallbackIndicationElementto the provided message builder.voidRegister aFallbackIndicationListenerthat gets notified whenever a message that contains aFallbackIndicationElementis received.static MessageBuilderaddFallbackIndicationWithBody(MessageBuilder messageBuilder, String fallbackMessageBody) Set the body of the message to the provided fallback message and add aFallbackIndicationElement.static FallbackIndicationManagergetInstanceFor(XMPPConnection connection) voidUnregister aFallbackIndicationListener.booleanDetermine, whether or not the server supports Fallback Indications.booleanDetermine, whether or not a user supports Fallback Indications.Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Method Details
-
getInstanceFor
-
userSupportsFallbackIndications
public boolean userSupportsFallbackIndications(EntityBareJid jid) throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException Determine, whether or not a user supports Fallback Indications.- Parameters:
jid- BareJid of the user.- Returns:
- feature support
- Throws:
XMPPException.XMPPErrorException- if a protocol level error happensSmackException.NotConnectedException- if the connection is not connectedInterruptedException- if the thread is being interruptedSmackException.NoResponseException- if the server doesn't send a response in time
-
serverSupportsFallbackIndications
public boolean serverSupportsFallbackIndications() throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseExceptionDetermine, whether or not the server supports Fallback Indications.- Returns:
- server side feature support
- Throws:
XMPPException.XMPPErrorException- if a protocol level error happensSmackException.NotConnectedException- if the connection is not connectedInterruptedException- if the thread is being interruptedSmackException.NoResponseException- if the server doesn't send a response in time
-
addFallbackIndicationWithBody
public static MessageBuilder addFallbackIndicationWithBody(MessageBuilder messageBuilder, 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
Add aFallbackIndicationElementto the provided message builder.- Parameters:
messageBuilder- message builder- Returns:
- message builder with added fallback element
-
addFallbackIndicationListener
Register aFallbackIndicationListenerthat gets notified whenever a message that contains aFallbackIndicationElementis received.- Parameters:
listener- listener to be registered.
-
removeFallbackIndicationListener
Unregister aFallbackIndicationListener.- Parameters:
listener- listener to be unregistered.
-