public class DeliveryReceiptManager
extends org.jivesoftware.smack.Manager
implements org.jivesoftware.smack.PacketListener
DeliveryReceipt support, enabling and disabling of
automatic DeliveryReceipt transmission.| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
addDeliveryReceiptRequest(org.jivesoftware.smack.packet.Message m)
Add a delivery receipt request to an outgoing packet.
|
void |
addReceiptReceivedListener(ReceiptReceivedListener listener)
Get informed about incoming delivery receipts with a
ReceiptReceivedListener. |
void |
disableAutoReceipts()
Helper method to disable automatic DeliveryReceipt transmission.
|
void |
enableAutoReceipts()
Helper method to enable automatic DeliveryReceipt transmission.
|
boolean |
getAutoReceiptsEnabled()
Check if AutoReceipts are enabled on this connection.
|
static DeliveryReceiptManager |
getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
Obtain the DeliveryReceiptManager responsible for a connection.
|
static boolean |
hasDeliveryReceiptRequest(org.jivesoftware.smack.packet.Packet p)
Test if a packet requires a delivery receipt.
|
boolean |
isSupported(java.lang.String jid)
Returns true if Delivery Receipts are supported by a given JID
|
void |
processPacket(org.jivesoftware.smack.packet.Packet packet) |
void |
removeReceiptReceivedListener(ReceiptReceivedListener listener)
Stop getting informed about incoming delivery receipts.
|
void |
setAutoReceiptsEnabled(boolean new_state)
Configure whether the
DeliveryReceiptManager should automatically
reply to incoming DeliveryReceipts. |
public static DeliveryReceiptManager getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
connection - the connection object.public boolean isSupported(java.lang.String jid)
throws org.jivesoftware.smack.SmackException,
org.jivesoftware.smack.XMPPException
jid - org.jivesoftware.smack.SmackException - if there was no response from the server.org.jivesoftware.smack.XMPPExceptionpublic void processPacket(org.jivesoftware.smack.packet.Packet packet)
throws org.jivesoftware.smack.SmackException.NotConnectedException
processPacket in interface org.jivesoftware.smack.PacketListenerorg.jivesoftware.smack.SmackException.NotConnectedExceptionpublic void setAutoReceiptsEnabled(boolean new_state)
DeliveryReceiptManager should automatically
reply to incoming DeliveryReceipts. By default, this feature is off.new_state - whether automatic transmission of
DeliveryReceipts should be enabled or disabledpublic void enableAutoReceipts()
public void disableAutoReceipts()
public boolean getAutoReceiptsEnabled()
public void addReceiptReceivedListener(ReceiptReceivedListener listener)
ReceiptReceivedListener.listener - the listener to be informed about new receiptspublic void removeReceiptReceivedListener(ReceiptReceivedListener listener)
listener - the listener to be removedpublic static boolean hasDeliveryReceiptRequest(org.jivesoftware.smack.packet.Packet p)
p - Packet object to check for a DeliveryReceiptRequestpublic static java.lang.String addDeliveryReceiptRequest(org.jivesoftware.smack.packet.Message m)
m - Message object to add a request to