Class IoTProvisioningManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smackx.iot.provisioning.IoTProvisioningManager
-
public final class IoTProvisioningManager extends Manager
A manager for XEP-0324: Internet of Things - Provisioning.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addBecameFriendListener(BecameFriendListener becameFriendListener)
boolean
addWasUnfriendedListener(WasUnfriendedListener wasUnfriendedListener)
DomainBareJid
findProvisioningServerComponent()
Try to find a provisioning server component.Jid
getConfiguredProvisioningServer()
static IoTProvisioningManager
getInstanceFor(XMPPConnection connection)
Get the manger instance responsible for the given connection.boolean
iAmFriendOf(BareJid otherJid)
boolean
isFriend(Jid provisioningServer, BareJid friendInQuestion)
As the given provisioning server is the given JID is a friend.boolean
isMyFriend(Jid friendInQuestion)
boolean
removeBecameFriendListener(BecameFriendListener becameFriendListener)
boolean
removeWasUnfriendedListener(WasUnfriendedListener wasUnfriendedListener)
void
sendFriendshipRequest(BareJid bareJid)
void
sendFriendshipRequestIfRequired(BareJid jid)
void
setConfiguredProvisioningServer(Jid provisioningServer)
Set the configured provisioning server.void
unfriend(Jid friend)
-
Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
-
-
-
Method Detail
-
getInstanceFor
public static IoTProvisioningManager getInstanceFor(XMPPConnection connection)
Get the manger instance responsible for the given connection.- Parameters:
connection
- the XMPP connection.- Returns:
- a manager instance.
-
setConfiguredProvisioningServer
public void setConfiguredProvisioningServer(Jid provisioningServer)
Set the configured provisioning server. Usenull
as provisioningServer to use automatic discovery of the provisioning server (the default behavior).- Parameters:
provisioningServer
- TODO javadoc me please
-
getConfiguredProvisioningServer
public Jid getConfiguredProvisioningServer() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
-
findProvisioningServerComponent
public DomainBareJid findProvisioningServerComponent() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
Try 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.java.lang.InterruptedException
- if the calling thread was interrupted.- See Also:
- XEP-0324 ยง 3.1.2 Provisioning Server as a server component
-
isFriend
public boolean isFriend(Jid provisioningServer, BareJid friendInQuestion) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.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:
true
if the JID is a friend,false
otherwise.- 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.java.lang.InterruptedException
- if the calling thread was interrupted.
-
iAmFriendOf
public boolean iAmFriendOf(BareJid otherJid)
-
sendFriendshipRequest
public void sendFriendshipRequest(BareJid bareJid) throws SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NotConnectedException
java.lang.InterruptedException
-
sendFriendshipRequestIfRequired
public void sendFriendshipRequestIfRequired(BareJid jid) throws SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NotConnectedException
java.lang.InterruptedException
-
isMyFriend
public boolean isMyFriend(Jid friendInQuestion)
-
unfriend
public void unfriend(Jid friend) throws SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NotConnectedException
java.lang.InterruptedException
-
addBecameFriendListener
public boolean addBecameFriendListener(BecameFriendListener becameFriendListener)
-
removeBecameFriendListener
public boolean removeBecameFriendListener(BecameFriendListener becameFriendListener)
-
addWasUnfriendedListener
public boolean addWasUnfriendedListener(WasUnfriendedListener wasUnfriendedListener)
-
removeWasUnfriendedListener
public boolean removeWasUnfriendedListener(WasUnfriendedListener wasUnfriendedListener)
-
-