Package org.linphone.core
Interface FriendList
public interface FriendList
This object representing a list of
You can use it to store contacts locally or synchronize them through CardDAV
protocol.
Friend
. You can use it to store contacts locally or synchronize them through CardDAV
protocol.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static enum
static enum
-
Method Summary
Modifier and TypeMethodDescriptionAdd a friend to a friend list.void
addListener
(FriendListListener listener) addLocalFriend
(Friend linphoneFriend) Add a friend to a friend list.void
exportFriendsAsVcard4File
(String vcardFile) findFriendByAddress
(Address address) Find a friend in the friend list using a LinphoneAddress.findFriendByPhoneNumber
(String phoneNumber) Find a friend in the friend list using a phone number.findFriendByRefKey
(String refKey) Find a friend in the friend list using a ref key.findFriendByUri
(String uri) Find a friend in the friend list using an URI string.Friend[]
findFriendsByAddress
(Address address) Find all friends in the friend list using a LinphoneAddress.Friend[]
findFriendsByUri
(String uri) Find all friends in the friend list using an URI string.getCore()
Returns theCore
object attached to this LinphoneFriendList.Get the display name of the friend list.Friend[]
Retrieves the list ofFriend
from this LinphoneFriendList.long
Gets the native pointer used by this class to make native method calls.Get the RLS (Resource List Server) URI associated with the friend list to
subscribe to these friends presence.Deprecated.27/10/2020.getType()
Get theFriendList.Type
of a friend list.getUri()
Get the URI associated with the friend list.Gets the object stored in this object user's dataint
importFriendsFromVcard4Buffer
(String vcardBuffer) int
importFriendsFromVcard4File
(String vcardFile) boolean
Gets whether this friend list and it's friends will be stored in DB or not.boolean
Get wheter the subscription of the friend list is bodyless or not.boolean
Gets whether subscription to NOTIFYs are enabled or not.void
notifyPresence
(PresenceModel presence) Notify our presence to all the friends in the friend list that have subscribed
to our presence directly (not using a RLS).removeFriend
(Friend linphoneFriend) Remove a friend from a friend list.void
removeListener
(FriendListListener listener) void
setDatabaseStorageEnabled
(boolean enable) Sets whether this friend list and it's friends will be stored in DB or not.void
setDisplayName
(String displayName) Set the display name of the friend list.void
setRlsAddress
(Address rlsAddr) Set the RLS (Resource List Server) URI associated with the friend list to
subscribe to these friends presence.void
Deprecated.27/10/2020.void
setSubscriptionBodyless
(boolean bodyless) Set wheter the subscription of the friend list is bodyless or not.void
setSubscriptionsEnabled
(boolean enabled) Enable subscription to NOTIFYs.void
setType
(FriendList.Type type) Assign a friend list type to the friend list.void
Set the URI associated with the friend list.void
setUserData
(Object data) Sets the object to store in this object user's datavoid
Starts a CardDAV synchronization using value set using
linphone_friend_list_set_uri.toString()
void
Goes through all theFriend
that are dirty and does a CardDAV PUT to
update the server.void
updateRevision
(int revision) Sets the revision from the last synchronization.void
Update presence subscriptions for the entire list.
-
Method Details
-
getCore
- Returns:
- a
Core
object
-
isDatabaseStorageEnabled
boolean isDatabaseStorageEnabled()Gets whether this friend list and it's friends will be stored in DB or not.
- Returns:
- Whether the list and it's friends will be saved in database or not
-
setDatabaseStorageEnabled
void setDatabaseStorageEnabled(boolean enable) Sets whether this friend list and it's friends will be stored in DB or not.
- Parameters:
enable
- true to enable this friend list storage in DB, false to disable
it.
-
getDisplayName
Get the display name of the friend list.
- Returns:
- The display name of the friend list.
-
setDisplayName
Set the display name of the friend list.
- Parameters:
displayName
- The new display name of the friend list.
-
getFriends
- Returns:
- A list of
Friend
-
isSubscriptionBodyless
boolean isSubscriptionBodyless()Get wheter the subscription of the friend list is bodyless or not.
- Returns:
- Wheter the subscription of the friend list is bodyless or not.
-
getRlsAddress
Get the RLS (Resource List Server) URI associated with the friend list to
subscribe to these friends presence.
- Returns:
- The RLS URI as
Address
associated with the friend list.
-
setRlsAddress
Set the RLS (Resource List Server) URI associated with the friend list to
subscribe to these friends presence.
- Parameters:
rlsAddr
- The RLS URI to associate with the friend list.
-
getRlsUri
Deprecated.27/10/2020. UsegetRlsAddress()
instead.Get the RLS (Resource List Server) URI associated with the friend list to
subscribe to these friends presence.
- Returns:
- The RLS URI associated with the friend list.
-
setRlsUri
Deprecated.27/10/2020. UsesetRlsAddress(org.linphone.core.Address)
instead.Set the RLS (Resource List Server) URI associated with the friend list to
subscribe to these friends presence.
- Parameters:
rlsUri
- The RLS URI to associate with the friend list.
-
setSubscriptionBodyless
void setSubscriptionBodyless(boolean bodyless) Set wheter the subscription of the friend list is bodyless or not.
- Parameters:
bodyless
- boolean telling if the subscription of the friend list is
bodyless or not.
-
isSubscriptionsEnabled
boolean isSubscriptionsEnabled()Gets whether subscription to NOTIFYs are enabled or not.
- Returns:
- Whether subscriptions are enabled or not
-
setSubscriptionsEnabled
void setSubscriptionsEnabled(boolean enabled) Enable subscription to NOTIFYs.
- Parameters:
enabled
- should subscription be enabled or not
-
getType
FriendList.Type getType() -
setType
Assign a friend list type to the friend list.
- Parameters:
type
-FriendList.Type
to assign
-
getUri
Get the URI associated with the friend list.
- Returns:
- The URI associated with the friend list.
-
setUri
Set the URI associated with the friend list.
- Parameters:
uri
- The URI to associate with the friend list.
-
addFriend
Add a friend to a friend list.
If or when a remote CardDAV server will be attached to the list, the friend
will be sent to the server.- Parameters:
linphoneFriend
-Friend
object to add to the friend list.- Returns:
FriendList.Status.OK
if successfully added,FriendList.Status.InvalidFriend
if the friend is not valid.
-
addLocalFriend
Add a friend to a friend list.
The friend will never be sent to a remote CardDAV server. Warning!
#LinphoneFriends added this way will be removed on the next synchronization,
and the callback contact_deleted will be called.- Parameters:
linphoneFriend
-Friend
object to add to the friend list.- Returns:
FriendList.Status.OK
if successfully added,FriendList.Status.InvalidFriend
if the friend is not valid.
-
exportFriendsAsVcard4File
- Parameters:
vcardFile
- the path to a file that will contain the vCards
-
findFriendByAddress
Find a friend in the friend list using a LinphoneAddress.
-
findFriendByPhoneNumber
Find a friend in the friend list using a phone number.
- Parameters:
phoneNumber
- a string of the phone number for which we want to find a
friend.- Returns:
- A
Friend
if found, null otherwise.
-
findFriendByRefKey
Find a friend in the friend list using a ref key.
- Parameters:
refKey
- The ref key string of the friend we want to search for.- Returns:
- A
Friend
if found, null otherwise.
-
findFriendByUri
Find a friend in the friend list using an URI string.
- Parameters:
uri
- A string containing the URI of the friend we want to search for.- Returns:
- A
Friend
if found, null otherwise.
-
findFriendsByAddress
Find all friends in the friend list using a LinphoneAddress.
-
findFriendsByUri
Find all friends in the friend list using an URI string.
- Parameters:
uri
- A string containing the URI of the friends we want to search for.- Returns:
- A list of
Friend
if found, null otherwise.
-
importFriendsFromVcard4Buffer
- Parameters:
vcardBuffer
- the buffer that contains the vCard(s) to parse- Returns:
- the amount of linphone friends created
-
importFriendsFromVcard4File
- Parameters:
vcardFile
- the path to a file that contains the vCard(s) to parse- Returns:
- the amount of linphone friends created
-
notifyPresence
Notify our presence to all the friends in the friend list that have subscribed
to our presence directly (not using a RLS).
- Parameters:
presence
-PresenceModel
object.
-
removeFriend
Remove a friend from a friend list.
- Parameters:
linphoneFriend
-Friend
object to remove from the friend list.- Returns:
FriendList.Status.OK
if removed successfully,FriendList.Status.NonExistentFriend
if the friend is not in the list.
-
synchronizeFriendsFromServer
void synchronizeFriendsFromServer()Starts a CardDAV synchronization using value set using
linphone_friend_list_set_uri.
-
updateDirtyFriends
void updateDirtyFriends() -
updateRevision
void updateRevision(int revision) Sets the revision from the last synchronization.
- Parameters:
revision
- The revision
-
updateSubscriptions
void updateSubscriptions()Update presence subscriptions for the entire list.
Calling this function is necessary when list subscriptions are enabled, ie when
a RLS presence server is used. -
addListener
-
removeListener
-
setUserData
Sets the object to store in this object user's data- Parameters:
data
- the object to store
-
getUserData
Object getUserData()Gets the object stored in this object user's data- Returns:
- the object store if any, null otherwise
-
getNativePointer
long getNativePointer()Gets the native pointer used by this class to make native method calls.- Returns:
- the nativer pointer, as long
-
toString
String toString()
-