Package org.jivesoftware.smack.roster
Class RosterEntry
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smack.roster.RosterEntry
Each user in your roster is represented by a roster entry, which contains the user's
JID and a name or nickname you assign.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancel the presence subscription the XMPP entity representing this roster entry has with us.boolean
Check if we are subscribed to the contact's presence.boolean
Check if the contact is subscribed to "my" presence.boolean
boolean
equalsDeep
(Object obj) Indicates whether some other object is "equal to" this by comparing all members.Returns a copied list of the roster groups that this entry belongs to.getJid()
Returns the JID associated with this entry.getName()
Returns the name associated with this entry.getType()
Returns the roster subscription type of the entry.getUser()
Deprecated.int
hashCode()
boolean
Returns the pre-approval state of this entry.boolean
Returns the roster subscription request status of the entry.void
Sets the name associated with this entry.toString()
Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Method Details
-
getUser
Deprecated.usegetJid()
instead.Returns the JID of the user associated with this entry.- Returns:
- the user associated with this entry.
-
getJid
Returns the JID associated with this entry.- Returns:
- the user associated with this entry.
-
getName
Returns the name associated with this entry.- Returns:
- the name.
-
setName
public void setName(String name) throws SmackException.NotConnectedException, SmackException.NoResponseException, XMPPException.XMPPErrorException, InterruptedException Sets the name associated with this entry.- Parameters:
name
- the name.- Throws:
SmackException.NotConnectedException
- if the XMPP connection is not connected.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NoResponseException
- if there was no response from the remote entity.InterruptedException
- if the calling thread was interrupted.
-
isApproved
Returns the pre-approval state of this entry.- Returns:
- the pre-approval state.
-
getGroups
Returns a copied list of the roster groups that this entry belongs to.- Returns:
- an iterator for the groups this entry belongs to.
-
getType
Returns the roster subscription type of the entry. When the type is RosterPacket.ItemType.none or RosterPacket.ItemType.from, refer togetStatus()
to see if a subscription request is pending.- Returns:
- the type.
-
isSubscriptionPending
Returns the roster subscription request status of the entry. Iftrue
, then the contact did not answer the subscription request yet.- Returns:
- the status.
- Since:
- 4.2
-
canSeeMyPresence
Check if the contact is subscribed to "my" presence. This allows the contact to see the presence information.- Returns:
- true if the contact has a presence subscription.
- Since:
- 4.2
-
canSeeHisPresence
Check if we are subscribed to the contact's presence. Iftrue
then the contact has allowed us to receive presence information.- Returns:
- true if we are subscribed to the contact's presence.
- Since:
- 4.2
-
cancelSubscription
Cancel the presence subscription the XMPP entity representing this roster entry has with us.- Throws:
SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.- Since:
- 4.2
-
toString
-
hashCode
-
equals
-
equalsDeep
Indicates whether some other object is "equal to" this by comparing all members.The
equals(Object)
method returnstrue
if the user JIDs are equal.- Parameters:
obj
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
getJid()
instead.