Class IoTProvisioningManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.iot.provisioning.IoTProvisioningManager
A manager for XEP-0324: Internet of Things - Provisioning.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddBecameFriendListener(BecameFriendListener becameFriendListener) booleanaddWasUnfriendedListener(WasUnfriendedListener wasUnfriendedListener) Try to find a provisioning server component.static IoTProvisioningManagergetInstanceFor(XMPPConnection connection) Get the manger instance responsible for the given connection.booleaniAmFriendOf(BareJid otherJid) booleanAs the given provisioning server is the given JID is a friend.booleanisMyFriend(Jid friendInQuestion) booleanremoveBecameFriendListener(BecameFriendListener becameFriendListener) booleanremoveWasUnfriendedListener(WasUnfriendedListener wasUnfriendedListener) voidsendFriendshipRequest(BareJid bareJid) voidvoidsetConfiguredProvisioningServer(Jid provisioningServer) Set the configured provisioning server.voidMethods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Method Details
-
getInstanceFor
Get the manger instance responsible for the given connection.- Parameters:
connection- the XMPP connection.- Returns:
- a manager instance.
-
setConfiguredProvisioningServer
Set the configured provisioning server. Usenullas provisioningServer to use automatic discovery of the provisioning server (the default behavior).- Parameters:
provisioningServer- TODO javadoc me please
-
getConfiguredProvisioningServer
-
findProvisioningServerComponent
public DomainBareJid findProvisioningServerComponent() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedExceptionTry to find a provisioning server component.- Returns:
- the XMPP address of the provisioning server component if one was found.
- 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.- See Also:
-
isFriend
public boolean isFriend(Jid provisioningServer, BareJid friendInQuestion) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException As the given provisioning server is the given JID is a friend.- Parameters:
provisioningServer- the provisioning server to ask.friendInQuestion- the JID to ask about.- Returns:
trueif the JID is a friend,falseotherwise.- 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.
-
iAmFriendOf
-
sendFriendshipRequest
public void sendFriendshipRequest(BareJid bareJid) throws SmackException.NotConnectedException, InterruptedException -
sendFriendshipRequestIfRequired
public void sendFriendshipRequestIfRequired(BareJid jid) throws SmackException.NotConnectedException, InterruptedException -
isMyFriend
-
unfriend
-
addBecameFriendListener
-
removeBecameFriendListener
-
addWasUnfriendedListener
-
removeWasUnfriendedListener
-