public class DeliveryReceiptManager extends Manager implements PacketListener
DeliveryReceipt support, enabling and disabling of
automatic DeliveryReceipt transmission.| Modifier and Type | Method and Description |
|---|---|
static void |
addDeliveryReceiptRequest(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(XMPPConnection connection)
Obtain the DeliveryReceiptManager responsible for a connection.
|
static boolean |
hasDeliveryReceiptRequest(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(Packet packet)
Process the next packet sent to this packet listener.
|
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. |
connection, schedulepublic static DeliveryReceiptManager getInstanceFor(XMPPConnection connection)
connection - the connection object.public boolean isSupported(java.lang.String jid)
throws SmackException,
XMPPException
jid - SmackException - if there was no response from the server.XMPPExceptionpublic void processPacket(Packet packet) throws SmackException.NotConnectedException
PacketListenerA single thread is responsible for invoking all listeners, so it's very important that implementations of this method not block for any extended period of time.
processPacket in interface PacketListenerpacket - the packet to process.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(Packet p)
p - Packet object to check for a DeliveryReceiptRequestpublic static void addDeliveryReceiptRequest(Message m)
m - Message object to add a request to