public class ServerStoredContactListJabberImpl
extends java.lang.Object
Constructor and Description |
---|
ServerStoredContactListJabberImpl(OperationSetPersistentPresenceJabberImpl parentOperationSet,
ProtocolProviderServiceJabberImpl provider,
InfoRetreiver infoRetreiver)
Creates a ServerStoredContactList wrapper for the specified BuddyList.
|
Modifier and Type | Method and Description |
---|---|
void |
addContact(ContactGroup parent,
java.lang.String id)
Adds a new contact with the specified screenname to the list under the
specified group.
|
void |
addContact(java.lang.String id)
Adds a new contact with the specified screenname to the list under a
default location.
|
protected void |
addContactForImageUpdate(ContactJabberImpl contact)
when there is no image for contact we must retrieve it
add contacts for image update
|
(package private) void |
addGroupListener(ServerStoredGroupListener listener)
Registers the specified group listener so that it would receive events
on group modification/creation/destruction.
|
(package private) void |
cleanup()
Cleanups references and listeners.
|
void |
createGroup(java.lang.String groupName)
Creates the specified group on the server stored contact list.
|
(package private) ContactJabberImpl |
createUnresolvedContact(ContactGroup parentGroup,
java.lang.String id)
Creates a non resolved contact for the specified address and inside the
specified group.
|
(package private) ContactGroupJabberImpl |
createUnresolvedContactGroup(java.lang.String groupName)
Creates a non resolved contact group for the specified name.
|
(package private) ContactJabberImpl |
createVolatileContact(java.lang.String id,
boolean isPrivateMessagingContact,
java.lang.String displayName)
Creates a non persistent contact for the specified address.
|
ContactJabberImpl |
findContactById(java.lang.String id)
Returns the Contact with the specified id or null if
no such id was found.
|
ContactGroup |
findContactGroup(ContactJabberImpl child)
Returns the ContactGroup containing the specified contact or null
if no such group or contact exist.
|
ContactGroupJabberImpl |
findContactGroup(java.lang.String name)
Returns the ConntactGroup with the specified name or null if no such
group was found.
|
(package private) void |
fireContactAdded(ContactGroup parentGroup,
ContactJabberImpl contact)
Make the parent persistent presence operation set dispatch a contact
added event.
|
(package private) void |
fireContactRemoved(ContactGroup parentGroup,
ContactJabberImpl contact)
Make the parent persistent presence operation set dispatch a contact
removed event.
|
(package private) void |
fireContactResolved(ContactGroup parentGroup,
ContactJabberImpl contact)
Make the parent persistent presence operation set dispatch a contact
resolved event.
|
(package private) void |
fireGroupEvent(ContactGroupJabberImpl 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.
|
(package private) ContactGroupJabberImpl |
getNonPersistentGroup()
Returns the volatile group that we use when creating volatile contacts.
|
(package private) ProtocolProviderServiceJabberImpl |
getParentProvider()
Retrns a reference to the provider that created us.
|
java.util.Iterator<org.jivesoftware.smack.packet.Presence> |
getPresences(java.lang.String user)
Return all the presences for the user.
|
ContactGroup |
getRootGroup()
Returns the root group of the contact list.
|
(package private) org.jivesoftware.smack.RosterEntry |
getRosterEntry(java.lang.String user)
Returns the roster entry associated with the given XMPP address or
null if the user is not an entry in the roster.
|
(package private) org.jivesoftware.smack.RosterGroup |
getRosterGroup(java.lang.String name)
Returns the roster group with the specified name, or null if the
group doesn't exist.
|
(package private) java.lang.Object |
getRosterInitLock()
The lock around isRosterInitialized variable.
|
(package private) void |
init(OperationSetPersistentPresenceJabberImpl.ContactChangesListener presenceChangeListener)
Sets a reference to the currently active and valid instance of
roster that this list is to use for retrieving
server stored information
|
(package private) static boolean |
isEntryDisplayable(org.jivesoftware.smack.RosterEntry entry)
Some roster entries are not supposed to be seen.
|
boolean |
isPrivateMessagingContact(java.lang.String contactAddress)
Checks if the contact address is associated with private messaging
contact or not.
|
(package private) boolean |
isRosterInitialized()
Returns whether roster is initialized.
|
void |
moveContact(ContactJabberImpl contact,
AbstractContactGroupJabberImpl newParent)
Moves the specified contact to the group indicated by
newParent.
|
(package private) void |
removeContact(ContactJabberImpl contactToRemove)
Removes a contact from the serverside list
Event will come for successful operation
|
void |
removeGroup(ContactGroupJabberImpl groupToRemove)
Removes the specified group from the buddy list.
|
(package private) void |
removeGroupListener(ServerStoredGroupListener listener)
Removes the specified group listener so that it won't receive further
events on group modification/creation/destruction.
|
void |
renameGroup(ContactGroupJabberImpl groupToRename,
java.lang.String newName)
Renames the specified group according to the specified new name..
|
(package private) void |
sendInitialStatus()
Sends the initial presence to server.
|
(package private) void |
setInitialStatus(PresenceStatus initialStatus)
Saves the initial status for later dispatching.
|
(package private) void |
setInitialStatusMessage(java.lang.String initialStatusMessage)
Saves the initial status message for later dispatching.
|
ServerStoredContactListJabberImpl(OperationSetPersistentPresenceJabberImpl parentOperationSet, ProtocolProviderServiceJabberImpl provider, InfoRetreiver infoRetreiver)
parentOperationSet
- the operation set that created us and that
we could use for dispatching subscription eventsprovider
- the provider that has instantiated us.infoRetreiver
- retrieve contact information.public ContactGroup getRootGroup()
org.jivesoftware.smack.RosterEntry getRosterEntry(java.lang.String user)
user
- the XMPP address of the user (e.g. "[email protected]").
The address could be in any valid format (e.g. "domain/resource",
"[email protected]" or "[email protected]/resource").org.jivesoftware.smack.RosterGroup getRosterGroup(java.lang.String name)
name
- the name of the group.void addGroupListener(ServerStoredGroupListener listener)
listener
- the ServerStoredGroupListener to register for group eventsvoid removeGroupListener(ServerStoredGroupListener listener)
listener
- the ServerStoredGroupListener to unregistervoid fireGroupEvent(ContactGroupJabberImpl group, int eventID)
group
- the ContactGroup that has been created/modified/removedeventID
- the id of the event to generate.void fireContactRemoved(ContactGroup parentGroup, ContactJabberImpl contact)
parentGroup
- the group where that the removed contact belonged to.contact
- the contact that was removed.ProtocolProviderServiceJabberImpl getParentProvider()
public ContactGroupJabberImpl findContactGroup(java.lang.String name)
name
- the name of the group we're looking for.public ContactJabberImpl findContactById(java.lang.String id)
id
- the id of the contact to find.public ContactGroup findContactGroup(ContactJabberImpl child)
child
- the contact whose parent group we're looking for.public void addContact(java.lang.String id) throws OperationFailedException
id
- the id of the contact to add.OperationFailedException
public void addContact(ContactGroup parent, java.lang.String id) throws OperationFailedException
id
- the id of the contact to add.parent
- the group under which we want the new contact placed.OperationFailedException
- if the contact already existContactJabberImpl createVolatileContact(java.lang.String id, boolean isPrivateMessagingContact, java.lang.String displayName)
id
- the address of the contact to create.isPrivateMessagingContact
- indicates if the contact should be
private messaging contact or not.displayName
- the display name of the contactpublic boolean isPrivateMessagingContact(java.lang.String contactAddress)
contactAddress
- the address of the contact.ContactJabberImpl createUnresolvedContact(ContactGroup parentGroup, java.lang.String id)
parentGroup
- the group where the unersolved contact is to be
createdid
- the Address of the contact to create.ContactGroupJabberImpl createUnresolvedContactGroup(java.lang.String groupName)
groupName
- the name of the group to create.public void createGroup(java.lang.String groupName) throws OperationFailedException
groupName
- a String containing the name of the new group.OperationFailedException
- with code CONTACT_GROUP_ALREADY_EXISTS
if the group we're trying to create is already in our contact list.public void removeGroup(ContactGroupJabberImpl groupToRemove) throws OperationFailedException
groupToRemove
- the group that we'd like removed.OperationFailedException
void removeContact(ContactJabberImpl contactToRemove) throws OperationFailedException
contactToRemove
- ContactJabberImplOperationFailedException
public void renameGroup(ContactGroupJabberImpl groupToRename, java.lang.String newName)
groupToRename
- the group that we'd like removed.newName
- the new name of the grouppublic void moveContact(ContactJabberImpl contact, AbstractContactGroupJabberImpl newParent) throws OperationFailedException
contact
- the contact that we'd like moved under the new group.newParent
- the group where we'd like the parent placed.OperationFailedException
void init(OperationSetPersistentPresenceJabberImpl.ContactChangesListener presenceChangeListener)
void sendInitialStatus()
void cleanup()
ContactGroupJabberImpl getNonPersistentGroup()
void fireContactAdded(ContactGroup parentGroup, ContactJabberImpl contact)
parentGroup
- the group where the new contact was addedcontact
- the contact that was addedvoid fireContactResolved(ContactGroup parentGroup, ContactJabberImpl contact)
parentGroup
- the group that the resolved contact belongs to.contact
- the contact that was resolvedprotected void addContactForImageUpdate(ContactJabberImpl contact)
contact
- ContactJabberImplstatic boolean isEntryDisplayable(org.jivesoftware.smack.RosterEntry entry)
entry
- the entry to check.public java.util.Iterator<org.jivesoftware.smack.packet.Presence> getPresences(java.lang.String user)
user
- the id of the user to check for presences.boolean isRosterInitialized()
java.lang.Object getRosterInitLock()
void setInitialStatus(PresenceStatus initialStatus)
initialStatus
- to be dispatched later.void setInitialStatusMessage(java.lang.String initialStatusMessage)
initialStatusMessage
- to be dispatched later.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.