public class ContactJabberImpl extends AbstractContact
Constructor and Description |
---|
ContactJabberImpl(org.jivesoftware.smack.RosterEntry rosterEntry,
ServerStoredContactListJabberImpl ssclCallback,
boolean isPersistent,
boolean isResolved)
Creates an JabberContactImpl
|
ContactJabberImpl(java.lang.String id,
ServerStoredContactListJabberImpl ssclCallback,
boolean isPersistent)
Used to create unresolved contacts with specified id.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
void |
fireContactResourceEvent(ContactResourceEvent event)
Notifies all registered ContactResourceListeners that an event
has occurred.
|
java.lang.String |
getAddress()
Returns the Jabber Userid of this contact
|
java.lang.String |
getDisplayName()
Returns a String that could be used by any user interacting modules for
referring to this contact.
|
byte[] |
getImage()
Returns an avatar if one is already present or null in case it
is not in which case it the method also queues the contact for image
updates.
|
byte[] |
getImage(boolean retrieveIfNecessary)
Returns a reference to the image assigned to this contact.
|
ContactGroup |
getParentContactGroup()
Returns a reference to the contact group that this contact is currently
a child of or null if the underlying protocol does not support persistent
presence.
|
java.lang.String |
getPersistentData()
Returns the persistent data
|
PresenceStatus |
getPresenceStatus()
Returns the status of the contact as per the last status update we've
received for it.
|
ProtocolProviderService |
getProtocolProvider()
Returns a reference to the protocol provider that created the contact.
|
(package private) ContactResource |
getResourceFromJid(java.lang.String jid)
Finds the ContactResource corresponding to the given jid.
|
java.util.Collection<ContactResource> |
getResources()
Returns an iterator over the resources supported by this contact or null
if it doesn't support resources.
|
(package private) java.util.Map<java.lang.String,ContactResourceJabberImpl> |
getResourcesMap() |
(package private) java.lang.String |
getServerDisplayName()
Returns the display name used when the contact was resolved.
|
(package private) org.jivesoftware.smack.RosterEntry |
getSourceEntry()
Get source entry
|
java.lang.String |
getStatusMessage()
Return the current status message of this contact.
|
int |
hashCode()
Returns a hashCode for this contact.
|
boolean |
isLocal()
Determines whether or not this Contact instance represents the user used
by this protocol provider to connect to the service.
|
boolean |
isMobile()
Whether contact is mobile one.
|
boolean |
isPersistent()
Determines whether or not this contact is being stored by the server.
|
boolean |
isResolved()
Determines whether or not this contact has been resolved against the
server.
|
void |
setImage(byte[] imgBytes)
Set the image of the contact
|
protected void |
setJid(java.lang.String fullJid)
Used from volatile contacts to handle jid and resources.
|
(package private) void |
setLocal(boolean isLocal)
Changes the isLocal indicator.
|
(package private) void |
setMobile(boolean mobile)
Changes the mobile indicator value.
|
(package private) void |
setPersistent(boolean persistent)
Specifies whether this contact is to be considered persistent or not.
|
void |
setPersistentData(java.lang.String persistentData)
Not used.
|
(package private) void |
setResolved(org.jivesoftware.smack.RosterEntry entry)
Resolve this contact against the given entry
|
(package private) void |
setServerDisplayName(java.lang.String newValue)
Changes locally stored server display name.
|
protected void |
setStatusMessage(java.lang.String statusMessage)
Sets the current status message for this contact
|
boolean |
supportResources()
Indicates if this contact supports resources.
|
java.lang.String |
toString()
Returns a string representation of this contact, containing most of its
representative details.
|
(package private) void |
updatePresenceStatus(PresenceStatus status)
Sets the status that this contact is currently in.
|
addResourceListener, getPersistableAddress, removeResourceListener
ContactJabberImpl(org.jivesoftware.smack.RosterEntry rosterEntry, ServerStoredContactListJabberImpl ssclCallback, boolean isPersistent, boolean isResolved)
rosterEntry
- the RosterEntry object that we will be encapsulating.ssclCallback
- a reference to the ServerStoredContactListImpl
instance that created us.isPersistent
- determines whether this contact is persistent or not.isResolved
- specifies whether the contact has been resolved against
the server contact listContactJabberImpl(java.lang.String id, ServerStoredContactListJabberImpl ssclCallback, boolean isPersistent)
id
- contact idssclCallback
- the contact list handler that creates us.isPersistent
- is the contact persistent.public java.lang.String getAddress()
public boolean isLocal()
public byte[] getImage()
public byte[] getImage(boolean retrieveIfNecessary)
retrieveIfNecessary
- specifies whether the method should queue
this contact for avatar update from the server.public void setImage(byte[] imgBytes)
imgBytes
- the bytes of the image that we'd like to set.public int hashCode()
hashCode
in class AbstractContact
public boolean equals(java.lang.Object obj)
equals
in class AbstractContact
obj
- the reference object with which to compare.public java.lang.String toString()
toString
in class java.lang.Object
void updatePresenceStatus(PresenceStatus status)
status
- the JabberStatusEnum that this contact is currently in.public PresenceStatus getPresenceStatus()
public java.lang.String getDisplayName()
java.lang.String getServerDisplayName()
void setServerDisplayName(java.lang.String newValue)
newValue
- public ContactGroup getParentContactGroup()
public ProtocolProviderService getProtocolProvider()
public boolean isPersistent()
void setPersistent(boolean persistent)
persistent
- true if the buddy is to be considered persistent and
false for volatile.void setResolved(org.jivesoftware.smack.RosterEntry entry)
entry
- the server stored entrypublic java.lang.String getPersistentData()
public boolean isResolved()
public void setPersistentData(java.lang.String persistentData)
persistentData
- the persistent data.org.jivesoftware.smack.RosterEntry getSourceEntry()
public java.lang.String getStatusMessage()
protected void setStatusMessage(java.lang.String statusMessage)
statusMessage
- the messagepublic boolean supportResources()
supportResources
in interface Contact
supportResources
in class AbstractContact
public java.util.Collection<ContactResource> getResources()
getResources
in interface Contact
getResources
in class AbstractContact
ContactResource getResourceFromJid(java.lang.String jid)
jid
- the jid for which we're looking for a resourcejava.util.Map<java.lang.String,ContactResourceJabberImpl> getResourcesMap()
public void fireContactResourceEvent(ContactResourceEvent event)
fireContactResourceEvent
in class AbstractContact
event
- the ContactResourceEvent to fire notification forprotected void setJid(java.lang.String fullJid)
fullJid
- the full jid of the contact.public boolean isMobile()
isMobile
in interface Contact
isMobile
in class AbstractContact
void setMobile(boolean mobile)
mobile
- is mobilevoid setLocal(boolean isLocal)
isLocal
- the new value.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.