Package org.jivesoftware.smackx.blocking
Class BlockingCommandManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.blocking.BlockingCommandManager
Block communications with contacts and other entities using XEP-0191.
Allows to
- Check push notifications support
- Get blocking list
- Block contact
- Unblock contact
- Unblock all
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllJidsUnblockedListener(AllJidsUnblockedListener allJidsUnblockedListener) voidaddJidsBlockedListener(JidsBlockedListener jidsBlockedListener) voidaddJidsUnblockedListener(JidsUnblockedListener jidsUnblockedListener) voidblockContacts(List<Jid> jids) Block contacts.Returns the block list.static BlockingCommandManagergetInstanceFor(XMPPConnection connection) Get the singleton instance of BlockingCommandManager.booleanReturns true if Blocking Command is supported by the server.voidremoveAllJidsUnblockedListener(AllJidsUnblockedListener allJidsUnblockedListener) voidremoveJidsBlockedListener(JidsBlockedListener jidsBlockedListener) voidremoveJidsUnblockedListener(JidsUnblockedListener jidsUnblockedListener) voidUnblock all.voidunblockContacts(List<Jid> jids) Unblock contacts.Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Field Details
-
NAMESPACE
- See Also:
-
-
Method Details
-
getInstanceFor
Get the singleton instance of BlockingCommandManager.- Parameters:
connection- TODO javadoc me please- Returns:
- the instance of BlockingCommandManager
-
isSupportedByServer
public boolean isSupportedByServer() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedExceptionReturns true if Blocking Command is supported by the server.- Returns:
- true if Blocking Command is supported by the server.
- Throws:
SmackException.NoResponseException- if there was no response from the remote entity.XMPPException.XMPPErrorException- if there was an XMPP error returned.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.
-
getBlockList
public List<Jid> getBlockList() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedExceptionReturns the block list.- Returns:
- the blocking list
- Throws:
SmackException.NoResponseException- if there was no response from the remote entity.XMPPException.XMPPErrorException- if there was an XMPP error returned.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.
-
blockContacts
public void blockContacts(List<Jid> jids) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException Block contacts.- Parameters:
jids- TODO javadoc me please- Throws:
SmackException.NoResponseException- if there was no response from the remote entity.XMPPException.XMPPErrorException- if there was an XMPP error returned.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.
-
unblockContacts
public void unblockContacts(List<Jid> jids) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException Unblock contacts.- Parameters:
jids- TODO javadoc me please- Throws:
SmackException.NoResponseException- if there was no response from the remote entity.XMPPException.XMPPErrorException- if there was an XMPP error returned.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.
-
unblockAll
public void unblockAll() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedExceptionUnblock all.- Throws:
SmackException.NoResponseException- if there was no response from the remote entity.XMPPException.XMPPErrorException- if there was an XMPP error returned.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.
-
addJidsBlockedListener
-
removeJidsBlockedListener
-
addJidsUnblockedListener
-
removeJidsUnblockedListener
-
addAllJidsUnblockedListener
-
removeAllJidsUnblockedListener
-