public interface Friend
Friend
is mainly used to implement an adressbook feature, and are usedMagicSearch
object. If your proxy supports it, you canFriendList
which are in turn stored insideCore
. They can be stored inside a database if the path to it isCore
is destroyed.Modifier and Type | Method and Description |
---|---|
void |
addAddress(Address address)
Adds an address in this friend.
|
void |
addPhoneNumber(java.lang.String phoneNumber)
Adds a phone number in this friend.
|
boolean |
createVcard(java.lang.String name)
Creates a vCard object associated to this friend if there isn't one yet and if
the full name is available, either by the parameter or the one in the friend's SIP URI. |
void |
done()
Commits modification made to the friend configuration.
|
void |
edit()
Starts editing a friend configuration.
|
int |
enableSubscribes(boolean enable)
Configure
Friend to subscribe to presence information. |
Address |
getAddress()
Get address of this friend.
|
Address[] |
getAddresses()
Returns a list of
Address for this friend. |
int |
getCapabilities()
Returns the capabilities associated to this friend.
|
float |
getCapabilityVersion(FriendCapability capability)
Returns the version of a friend's capbility.
|
ConsolidatedPresence |
getConsolidatedPresence()
Get the consolidated presence of a friend.
|
Core |
getCore()
Returns the
Core object managing this friend, if any. |
SubscribePolicy |
getIncSubscribePolicy()
|
java.lang.String |
getName()
Get the display name for this friend.
|
long |
getNativePointer()
Gets the native pointer used by this class to make native method calls.
|
java.lang.String[] |
getPhoneNumbers()
Returns a list of phone numbers for this friend.
|
PresenceModel |
getPresenceModel()
Get the presence model of a friend.
|
PresenceModel |
getPresenceModelForUriOrTel(java.lang.String uriOrTel)
Get the presence model for a specific SIP URI or phone number of a friend.
|
java.lang.String |
getRefKey()
Get the reference key of a friend.
|
SubscriptionState |
getSubscriptionState()
Get subscription state of a friend.
|
java.lang.Object |
getUserData()
Gets the object stored in this object user's data
|
Vcard |
getVcard()
Returns the vCard object associated to this friend, if any.
|
boolean |
hasCapability(FriendCapability capability)
Returns whether or not a friend has a capbility.
|
boolean |
hasCapabilityWithVersion(FriendCapability capability,
float version)
Returns whether or not a friend has a capbility with a given version.
|
boolean |
hasCapabilityWithVersionOrMore(FriendCapability capability,
float version)
Returns whether or not a friend has a capbility with a given version or more.
|
boolean |
hasPhoneNumber(java.lang.String phoneNumber)
Returns whether a friend contains the given phone number.
|
boolean |
inList()
Check that the given friend is in a friend list.
|
boolean |
isPresenceReceived()
Tells whether we already received presence information for a friend.
|
Friend |
newFromVcard(Vcard vcard)
|
void |
remove()
Removes a friend from it's friend list and from the rc if exists.
|
void |
removeAddress(Address address)
Removes an address in this friend.
|
void |
removePhoneNumber(java.lang.String phoneNumber)
Removes a phone number in this friend.
|
void |
save(Core core)
Saves a friend either in database if configured, otherwise in linphonerc.
|
int |
setAddress(Address address)
Set
Address for this friend. |
int |
setIncSubscribePolicy(SubscribePolicy policy)
Configure incoming subscription policy for this friend.
|
int |
setName(java.lang.String name)
Set the display name for this friend.
|
void |
setPresenceModel(PresenceModel presence)
Set the presence model of a friend.
|
void |
setPresenceModelForUriOrTel(java.lang.String uriOrTel,
PresenceModel presence)
Set the presence model for a specific SIP URI or phone number of a friend.
|
void |
setRefKey(java.lang.String key)
Set the reference key of a friend.
|
void |
setUserData(java.lang.Object data)
Sets the object to store in this object user's data
|
void |
setVcard(Vcard vcard)
Binds a vCard object to a friend.
|
boolean |
subscribesEnabled()
get subscription flag value
|
java.lang.String |
toString() |
@Nullable Address getAddress()
Address
object returned is hold by the LinphoneFriend,Address
. int setAddress(@Nullable Address address)
address
- the Address
to set return 0 if successfull, -1int getCapabilities()
ConsolidatedPresence getConsolidatedPresence()
ConsolidatedPresence
of the friend SubscribePolicy getIncSubscribePolicy()
SubscribePolicy
enum int setIncSubscribePolicy(SubscribePolicy policy)
policy
- SubscribePolicy
policy to apply. boolean isPresenceReceived()
@Nullable java.lang.String getName()
int setName(@Nullable java.lang.String name)
name
- the display name to set @NonNull java.lang.String[] getPhoneNumbers()
@Nullable PresenceModel getPresenceModel()
PresenceModel
object, or null if the friend do not havevoid setPresenceModel(@Nullable PresenceModel presence)
presence
- The PresenceModel
object to set for the friend @Nullable java.lang.String getRefKey()
void setRefKey(@Nullable java.lang.String key)
key
- The reference key to use for the friend. boolean subscribesEnabled()
int enableSubscribes(boolean enable)
enable
- if true this friend will receive subscription message SubscriptionState getSubscriptionState()
SubscriptionState
enum @Nullable Vcard getVcard()
Vcard
or null. void setVcard(@Nullable Vcard vcard)
vcard
- The Vcard
object to bind void addAddress(@NonNull Address address)
address
- Address
object void addPhoneNumber(@NonNull java.lang.String phoneNumber)
phoneNumber
- number to add boolean createVcard(@Nullable java.lang.String name)
name
- The full name of the friend or null to use the one from thevoid done()
void edit()
edit()
setAddress(org.linphone.core.Address)
setIncSubscribePolicy(org.linphone.core.SubscribePolicy)
). Once the modifications are done, then thedone()
to commit the changes. float getCapabilityVersion(FriendCapability capability)
capability
- FriendCapability
object @Nullable PresenceModel getPresenceModelForUriOrTel(@NonNull java.lang.String uriOrTel)
uriOrTel
- The SIP URI or phone number for which to get the presence modelPresenceModel
object, or null if the friend do not haveboolean hasCapability(FriendCapability capability)
capability
- FriendCapability
object boolean hasCapabilityWithVersion(FriendCapability capability, float version)
capability
- FriendCapability
object version
- the version to test boolean hasCapabilityWithVersionOrMore(FriendCapability capability, float version)
capability
- FriendCapability
object version
- the version to test boolean hasPhoneNumber(@NonNull java.lang.String phoneNumber)
phoneNumber
- the phone number to search for boolean inList()
void remove()
void removeAddress(@NonNull Address address)
address
- Address
object void removePhoneNumber(@NonNull java.lang.String phoneNumber)
phoneNumber
- number to remove void save(@NonNull Core core)
core
- the linphone core void setPresenceModelForUriOrTel(@NonNull java.lang.String uriOrTel, @Nullable PresenceModel presence)
uriOrTel
- The SIP URI or phone number for which to set the presence modelpresence
- The PresenceModel
object to set @Nullable Friend newFromVcard(@NonNull Vcard vcard)
vcard
- a Vcard
object Friend
which has its vCard attribute initialized from thegetVcard()
. void setUserData(java.lang.Object data)
data
- the object to storejava.lang.Object getUserData()
long getNativePointer()
java.lang.String toString()
toString
in class java.lang.Object