public abstract class ServerStoredContactList
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected OperationSetPresenceSipImpl |
parentOperationSet
The operation set that created us and that we could use when dispatching
subscription events.
|
protected static java.lang.String |
ROOT_GROUP_NAME
Root group name.
|
protected ContactGroupSipImpl |
rootGroup
The root contact group.
|
protected ProtocolProviderServiceSipImpl |
sipProvider
The provider that is on top of us.
|
Constructor and Description |
---|
ServerStoredContactList(ProtocolProviderServiceSipImpl sipProvider,
OperationSetPresenceSipImpl parentOperationSet)
Creates a ServerStoredContactList wrapper for the specified BuddyList.
|
Modifier and Type | Method and Description |
---|---|
void |
addGroupListener(ServerStoredGroupListener listener)
Registers the specified group listener so that it would receive events
on group modification/creation/destruction.
|
abstract void |
authorizationAccepted(ContactSipImpl contact)
The user accepted authorization request for contact
|
abstract void |
authorizationIgnored(ContactSipImpl contact)
The user ignored authorization request for contact
|
abstract void |
authorizationRejected(ContactSipImpl contact)
The user rejected authorization request for contact
|
ContactSipImpl |
createContact(ContactGroupSipImpl parentGroup,
java.lang.String contactId,
boolean persistent,
java.lang.String contactType)
Creates contact for the specified address and inside the
specified group .
|
abstract ContactSipImpl |
createContact(ContactGroupSipImpl parentGroup,
java.lang.String contactId,
java.lang.String displayName,
boolean persistent,
java.lang.String contactType)
Creates contact for the specified address and inside the
specified group .
|
abstract ContactGroupSipImpl |
createGroup(ContactGroupSipImpl parentGroup,
java.lang.String groupName,
boolean persistent)
Creates a group with the specified name and parent in the server stored
contact list.
|
ContactSipImpl |
createUnresolvedContact(ContactGroupSipImpl parentGroup,
java.lang.String contactId,
java.lang.String persistentData)
Creates a non resolved contact for the specified address and inside the
specified group.
|
ContactGroupSipImpl |
createUnresolvedContactGroup(ContactGroupSipImpl parentGroup,
java.lang.String groupName)
Creates a non resolved contact group for the specified name.
|
abstract void |
deleteAccountImage()
Deletes current account image from server.
|
abstract void |
destroy()
Destroys the server stored list.
|
protected ContactGroupSipImpl |
findGroupByName(java.lang.String name)
Finds a group with supplied name.
|
protected void |
fireContactAdded(ContactGroupSipImpl parentGroup,
ContactSipImpl contact)
Make the parent persistent presence operation set dispatch a contact
added event.
|
protected void |
fireContactMoved(ContactGroupSipImpl oldParentGroup,
ContactGroupSipImpl newParentGroup,
ContactSipImpl contact)
Make the parent persistent presence operation set dispatch a subscription
moved event.
|
protected void |
fireContactRemoved(ContactGroupSipImpl parentGroup,
ContactSipImpl contact)
Make the parent persistent presence operation set dispatch a contact
removed event.
|
protected void |
fireContactResolved(ContactGroupSipImpl parentGroup,
ContactSipImpl contact)
Make the parent persistent presence operation set dispatch a contact
resolved event.
|
protected void |
fireGroupEvent(ContactGroup group,
int eventID)
Creates the corresponding event and notifies all
ServerStoredGroupListeners that the source group has been
removed, changed, renamed or whatever happened to it.
|
abstract ServerStoredDetails.ImageDetail |
getAccountImage()
Get current account image from server if any.
|
java.util.List<ContactSipImpl> |
getAllContacts(ContactGroupSipImpl group)
Returns all avaliable contacts from group and all subgroups.
|
java.util.List<ContactGroupSipImpl> |
getAllGroups(ContactGroupSipImpl group)
Returns all avaliable groups from group and all subgroups.
|
abstract byte[] |
getImage(java.net.URI imageUri)
Gets image from the specified uri.
|
abstract java.net.URI |
getImageUri()
Gets the pres-content image uri.
|
ContactGroupSipImpl |
getRootGroup()
Returns the root group of the contact list.
|
java.util.List<ContactSipImpl> |
getUniqueContacts(ContactGroupSipImpl group)
Gets all unique contacts from group and all subgroups.
|
abstract void |
init()
Initializes the server stored list.
|
abstract boolean |
isAccountImageSupported()
Whether current contact list supports account image.
|
abstract void |
moveContactToGroup(ContactSipImpl contact,
ContactGroupSipImpl newParentGroup)
Removes the specified contact from its current parent and places it
under newParent.
|
abstract void |
removeContact(ContactSipImpl contact)
Removes a contact.
|
abstract void |
removeGroup(ContactGroupSipImpl group)
Removes the specified group from the server stored contact list.
|
void |
removeGroupListener(ServerStoredGroupListener listener)
Removes the specified group listener so that it won't receive further
events on group modification/creation/destruction.
|
abstract void |
renameContact(ContactSipImpl contact,
java.lang.String newName)
Renames the specified contact.
|
abstract void |
renameGroup(ContactGroupSipImpl group,
java.lang.String newName)
Renames the specified group from the server stored contact list.
|
abstract void |
setAccountImage(byte[] newImageBytes)
Change the image of the account on server.
|
protected static final java.lang.String ROOT_GROUP_NAME
protected final ProtocolProviderServiceSipImpl sipProvider
protected final OperationSetPresenceSipImpl parentOperationSet
protected final ContactGroupSipImpl rootGroup
ServerStoredContactList(ProtocolProviderServiceSipImpl sipProvider, OperationSetPresenceSipImpl parentOperationSet)
sipProvider
- the provider that has instantiated us.parentOperationSet
- the operation set that created us and that
we could use for dispatching subscription eventspublic ContactGroupSipImpl getRootGroup()
public void addGroupListener(ServerStoredGroupListener listener)
listener
- the ServerStoredGroupListener to register for group
events.public void removeGroupListener(ServerStoredGroupListener listener)
listener
- the ServerStoredGroupListener to unregister.protected void fireGroupEvent(ContactGroup group, int eventID)
group
- the ContactGroup that has been created/modified/removed.eventID
- the id of the event to generate.public ContactSipImpl createUnresolvedContact(ContactGroupSipImpl parentGroup, java.lang.String contactId, java.lang.String persistentData)
parentGroup
- the group where the unersolved contact is to be
created.contactId
- the sip id of the contact to create.persistentData
- a String returned Contact's getPersistentData()
method during a previous run and that has been persistently stored
locally.public ContactGroupSipImpl createUnresolvedContactGroup(ContactGroupSipImpl parentGroup, java.lang.String groupName)
parentGroup
- the group under which the new group is to be created.groupName
- the name of the group to create.protected ContactGroupSipImpl findGroupByName(java.lang.String name)
name
- the name to search for.protected void fireContactAdded(ContactGroupSipImpl parentGroup, ContactSipImpl contact)
parentGroup
- the group where the new contact was added.contact
- the contact that was added.protected void fireContactMoved(ContactGroupSipImpl oldParentGroup, ContactGroupSipImpl newParentGroup, ContactSipImpl contact)
oldParentGroup
- the group where the source contact was located
before being moved.newParentGroup
- the group that the source contact is currently in.contact
- the contact that was added.protected void fireContactRemoved(ContactGroupSipImpl parentGroup, ContactSipImpl contact)
parentGroup
- the group where that the removed contact belonged to.contact
- the contact that was removed.protected void fireContactResolved(ContactGroupSipImpl parentGroup, ContactSipImpl contact)
parentGroup
- the group that the resolved contact belongs to.contact
- the contact that was resolved.public java.util.List<ContactSipImpl> getUniqueContacts(ContactGroupSipImpl group)
group
- the parent of the contacts.public java.util.List<ContactSipImpl> getAllContacts(ContactGroupSipImpl group)
group
- the parent of the contacts.public java.util.List<ContactGroupSipImpl> getAllGroups(ContactGroupSipImpl group)
group
- the parent of the contacts.public abstract void init()
public abstract void destroy()
public abstract java.net.URI getImageUri()
java.lang.IllegalStateException
- if the user has not been connected.public abstract byte[] getImage(java.net.URI imageUri)
imageUri
- the image uri.public abstract ContactGroupSipImpl createGroup(ContactGroupSipImpl parentGroup, java.lang.String groupName, boolean persistent) throws OperationFailedException
parentGroup
- the group where the new group should be created.groupName
- the name of the new group to create.persistent
- specify whether created contact is persistent ot not.OperationFailedException
- with code NETWORK_FAILURE if creating
the group fails because of XCAP server
error or with code
CONTACT_GROUP_ALREADY_EXISTS if contact
group with such name already exists.public abstract void renameGroup(ContactGroupSipImpl group, java.lang.String newName)
group
- the group to rename.newName
- the new name of the group.public abstract void moveContactToGroup(ContactSipImpl contact, ContactGroupSipImpl newParentGroup) throws OperationFailedException
contact
- the Contact to movenewParentGroup
- the ContactGroup where Contact
would be placed.OperationFailedException
- with code NETWORK_FAILURE if the
operation if failed during network
communication.public abstract void removeGroup(ContactGroupSipImpl group)
group
- the group to delete.public ContactSipImpl createContact(ContactGroupSipImpl parentGroup, java.lang.String contactId, boolean persistent, java.lang.String contactType) throws OperationFailedException
parentGroup
- the group where the unersolved contact is to be
created.contactId
- the sip id of the contact to create.persistent
- specify whether created contact is persistent ot not.contactType
- the contact type to create, if missing null.OperationFailedException
- with code NETWORK_FAILURE if the
operation if failed during network
communication.public abstract ContactSipImpl createContact(ContactGroupSipImpl parentGroup, java.lang.String contactId, java.lang.String displayName, boolean persistent, java.lang.String contactType) throws OperationFailedException
parentGroup
- the group where the unersolved contact is to be
created.contactId
- the sip id of the contact to create.displayName
- the display name of the contact to createpersistent
- specify whether created contact is persistent ot not.contactType
- the contact type to create, if missing null.OperationFailedException
- with code NETWORK_FAILURE if the
operation if failed during network
communication.public abstract void removeContact(ContactSipImpl contact) throws OperationFailedException
contact
- contact to be removed.OperationFailedException
- with code NETWORK_FAILURE if the
operation if failed during network
communication.public abstract void renameContact(ContactSipImpl contact, java.lang.String newName)
contact
- the contact to be renamed.newName
- the new contact name.OperationFailedException
- with code NETWORK_FAILURE if the
operation if failed during network
communication.public abstract void authorizationAccepted(ContactSipImpl contact)
contact
- the user has accepted.public abstract void authorizationRejected(ContactSipImpl contact)
contact
- the user has rejected.public abstract void authorizationIgnored(ContactSipImpl contact)
contact
- the user has ignored.public abstract boolean isAccountImageSupported()
public abstract ServerStoredDetails.ImageDetail getAccountImage() throws OperationFailedException
OperationFailedException
public abstract void deleteAccountImage() throws OperationFailedException
OperationFailedException
public abstract void setAccountImage(byte[] newImageBytes) throws OperationFailedException
newImageBytes
- the new image.OperationFailedException
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.