public class ContactSipImpl extends AbstractContact
Constructor and Description |
---|
ContactSipImpl(javax.sip.address.Address contactAddress,
ProtocolProviderServiceSipImpl parentProvider)
Creates an instance of a meta contact with the specified string used
as a name and identifier.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one which in terms
of contacts translates to having equal ids.
|
java.lang.String |
getAddress()
Returns a String that can be used for identifying the contact.
|
(package private) java.util.List<org.w3c.dom.Element> |
getAny()
Gets the entry custom elements.
|
java.lang.String |
getDisplayName()
Returns a String that could be used by any user interacting modules
for referring to this contact.
|
(package private) EntryType |
getEntry()
Gets the entry.
|
byte[] |
getImage()
Gets a byte array containing an image (most often a photo or an avatar)
that the contact uses as a representation.
|
(package private) java.net.URI |
getImageUri()
Gets the image uri.
|
ContactGroup |
getParentContactGroup()
Returns the group that contains this contact.
|
OperationSetPresenceSipImpl |
getParentPresenceOperationSet()
Returns the presence operation set that this contact belongs
to.
|
java.lang.String |
getPersistentData()
Gets the persistent data - for now only the XCAP resolved is needed
for restoring the contact data.
|
PresenceStatus |
getPresenceStatus()
Returns the status of the contact.
|
ProtocolProviderService |
getProtocolProvider()
Returns a reference to the protocol provider that created the contact.
|
java.util.Collection<ContactResource> |
getResources()
Returns a collection of resources supported by this contact or null
if it doesn't support resources.
|
javax.sip.address.Address |
getSipAddress()
Returns the jain-sip Address instance that this contact is wrapping.
|
java.lang.String |
getStatusMessage()
Return the current status message of this contact.
|
java.lang.String |
getSubscriptionState()
Current subscription state of the contact.
|
java.lang.String |
getUri()
Gets the entry's uri.
|
boolean |
isLocal()
Determines whether or not this contact represents our own identity.
|
boolean |
isPersistent()
Determines whether or not this contact is being stored by the server.
|
boolean |
isResolvable()
Determines whether or not this contact can be resolved against the
server.
|
boolean |
isResolved()
Determines whether or not this contact has been resolved against the
server.
|
boolean |
isXCapResolved()
Gets the value of the xCapResolved property.
|
(package private) void |
setAny(java.util.List<org.w3c.dom.Element> any)
Sets the entry custom elements.
|
void |
setDisplayName(DisplayNameType displayName)
Sets a String that could be used by any user interacting modules for
referring to this contact.
|
void |
setDisplayName(java.lang.String displayName)
Sets a String that could be used by any user interacting modules
for referring to this contact.
|
(package private) void |
setImage(byte[] image)
Sets a byte array containing an image (most often a photo or an avatar)
that the contact uses as a representation.
|
(package private) void |
setImageUri(java.net.URI imageUri)
Sets the image uri.
|
(package private) void |
setOtherAttributes(java.util.Map<javax.xml.namespace.QName,java.lang.String> otherAttributes)
Sets the entry custom attributes.
|
(package private) void |
setParentGroup(ContactGroupSipImpl newParentGroup)
This method is only called when the contact is added to a new
ContactGroupSipImpl by the
ContactGroupSipImpl itself.
|
void |
setPersistent(boolean isPersistent)
Specifies whether or not this contact is being stored by the server.
|
void |
setPersistentData(java.lang.String persistentData)
Sets the persistent data.
|
void |
setPresenceStatus(PresenceStatus sipPresenceStatus)
Sets sipPresenceStatus as the PresenceStatus that this
contact is currently in.
|
void |
setResolvable(boolean resolvable)
Makes the contact resolvable or unresolvable.
|
void |
setResolved(boolean resolved)
Makes the contact resolved or unresolved.
|
void |
setSubscriptionState(java.lang.String subscriptionState)
Change current subscription state.
|
void |
setXCapResolved(boolean xCapResolved)
Sets the value of the xCapResolved property.
|
(package private) static java.lang.String |
stripAddress(java.lang.String address)
Get rid of any parameters, ports etc.
|
static java.lang.String |
stripScheme(java.lang.String from) |
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.
|
addResourceListener, fireContactResourceEvent, getPersistableAddress, hashCode, isMobile, removeResourceListener
public ContactSipImpl(javax.sip.address.Address contactAddress, ProtocolProviderServiceSipImpl parentProvider)
contactAddress
- the identifier of this contact
(also used as a name).parentProvider
- the provider that created us.EntryType getEntry()
public java.lang.String getUri()
void setParentGroup(ContactGroupSipImpl newParentGroup)
newParentGroup
- the ContactGroupSipImpl that is now
parent of this ContactSipImplpublic java.lang.String getAddress()
public javax.sip.address.Address getSipAddress()
public java.lang.String getDisplayName()
public void setDisplayName(java.lang.String displayName)
displayName
- a human readable name to use for this contact.public void setDisplayName(DisplayNameType displayName)
displayName
- a human readable name to use for this contact.void setOtherAttributes(java.util.Map<javax.xml.namespace.QName,java.lang.String> otherAttributes)
otherAttributes
- the custom attributes.void setAny(java.util.List<org.w3c.dom.Element> any)
any
- the custom elements.java.util.List<org.w3c.dom.Element> getAny()
java.net.URI getImageUri()
void setImageUri(java.net.URI imageUri)
imageUri
- the image uri.public byte[] getImage()
void setImage(byte[] image)
image
- an image representing the contact.public PresenceStatus getPresenceStatus()
public void setPresenceStatus(PresenceStatus sipPresenceStatus)
sipPresenceStatus
- the SipPresenceStatus
currently valid for this contact.public ProtocolProviderService getProtocolProvider()
public boolean isLocal()
public ContactGroup getParentContactGroup()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isPersistent()
public void setPersistent(boolean isPersistent)
isPersistent
- true if the contact is persistent and false
otherwise.public boolean isXCapResolved()
public void setXCapResolved(boolean xCapResolved)
xCapResolved
- the xCapResolved to set.public java.lang.String getPersistentData()
public void setPersistentData(java.lang.String persistentData)
persistentData
- the persistent data to set.public boolean isResolved()
public void setResolved(boolean resolved)
resolved
- true to make the contact resolved; false to
make it unresolvedpublic boolean isResolvable()
public void setResolvable(boolean resolvable)
resolvable
- true to make the contact resolvable; false to
make it unresolvablepublic boolean equals(java.lang.Object obj)
equals
in class AbstractContact
obj
- the reference object with which to compare.true
if this contact has the same id as that of the
obj
argument.static java.lang.String stripAddress(java.lang.String address)
address
- the address to strippublic static java.lang.String stripScheme(java.lang.String from)
from
- address to strippublic OperationSetPresenceSipImpl getParentPresenceOperationSet()
public java.lang.String getStatusMessage()
public java.lang.String getSubscriptionState()
public void setSubscriptionState(java.lang.String subscriptionState)
subscriptionState
- the new state.public boolean supportResources()
supportResources
in interface Contact
supportResources
in class AbstractContact
public java.util.Collection<ContactResource> getResources()
getResources
in interface Contact
getResources
in class AbstractContact
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.