public class ContactGroupIcqImpl extends AbstractContactGroupIcqImpl
Constructor and Description |
---|
ContactGroupIcqImpl(net.kano.joustsim.oscar.oscar.service.ssi.MutableGroup joustSimGroup,
java.lang.Iterable<? extends net.kano.joustsim.oscar.oscar.service.ssi.Buddy> groupMembers,
ServerStoredContactListIcqImpl ssclCallback,
boolean isResolved,
boolean isPersistent)
Creates an ICQ group using the specified joustSimGroup as
a source.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addContact(ContactIcqImpl contact)
Adds the specified contact to the end of this group.
|
boolean |
canContainSubgroups()
Determines whether the group may contain subgroups or not.
|
java.util.Iterator<Contact> |
contacts()
Returns an Iterator over all contacts, member of this
ContactGroup.
|
int |
countContacts()
Returns the number of Contact members of this
ContactGroup
|
int |
countSubgroups()
Returns the number of subgroups contained by this group, which is
always 0 since sub groups in the icq protocol may only be contained
by the root group - RootContactGroupIcqImpl.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this group.
|
(package private) ContactIcqImpl |
findContact(net.kano.joustsim.oscar.oscar.service.ssi.Buddy joustSimBuddy)
Returns the icq contact encapsulating the specified joustSim buddy or null
if no such buddy was found.
|
(package private) ContactIcqImpl |
findContact(java.lang.String screenName)
Returns the icq contact encapsulating with the specified screen name or
null if no such contact was found.
|
(package private) int |
findContactIndex(Contact contact)
Returns the index of contact in this group -1 if no such contact was
found.
|
Contact |
getContact(java.lang.String id)
Returns the Contact with the specified address or
identifier.
|
ContactGroup |
getGroup(int index)
Returns the subgroup with the specified index (i.e.
|
ContactGroup |
getGroup(java.lang.String groupName)
Returns the subgroup with the specified name.
|
java.lang.String |
getGroupName()
Returns the name of this group.
|
(package private) net.kano.joustsim.oscar.oscar.service.ssi.MutableGroup |
getJoustSimSourceGroup()
Returns the JoustSIM group that this class is encapsulating.
|
(package private) java.lang.String |
getNameCopy()
Returns the name of the group as it was at the last call of initNameCopy.
|
ContactGroup |
getParentContactGroup()
Returns a reference to the root icq group which in ICQ is the parent of
any other group since the protocol does not support subgroups.
|
java.lang.String |
getPersistentData()
Returns null as no persistent data is required and the contact address is
sufficient for restoring the contact.
|
ProtocolProviderService |
getProtocolProvider()
Returns the protocol provider that this group belongs to.
|
java.lang.String |
getUID()
Returns a String that uniquely represents the group.
|
int |
hashCode()
Returns a hash code value for the object, which is actually the hashcode
value of the groupname.
|
(package private) void |
initNameCopy()
Sets the name copy field that we use as a means of detecting changes in
the group name.
|
boolean |
isPersistent()
Determines whether or not this contact group is being stored by the
server.
|
boolean |
isResolved()
Determines whether or not this contact group has been resolved against
the server.
|
(package private) void |
removeContact(ContactIcqImpl contact)
Removes the specified contact from this contact group
|
(package private) void |
setResolved(boolean resolved)
Specifies whether or not this contact group is to be considered resolved
against the server.
|
java.util.Iterator<ContactGroup> |
subgroups()
Returns an empty iterator.
|
java.lang.String |
toString()
Returns a string representation of this group, in the form
IcqGroup.GroupName[size]{ buddy1.toString(), buddy2.toString(), ...}.
|
(package private) void |
updateGroup(net.kano.joustsim.oscar.oscar.service.ssi.MutableGroup joustSimGroup,
java.util.List<? extends net.kano.joustsim.oscar.oscar.service.ssi.Buddy> serverBuddies,
java.util.List<Contact> newContacts,
java.util.List<ContactIcqImpl> removedContacts)
Sets this group and contacts corresponding to buddies in the
serverBuddies list as resolved.
|
ContactGroupIcqImpl(net.kano.joustsim.oscar.oscar.service.ssi.MutableGroup joustSimGroup, java.lang.Iterable<? extends net.kano.joustsim.oscar.oscar.service.ssi.Buddy> groupMembers, ServerStoredContactListIcqImpl ssclCallback, boolean isResolved, boolean isPersistent)
Note that we MUST NOT use the list of buddies obtained through the getBuddiesCopy() of the joustSimGroup arg as we'd later need to be able to directly compare ( == ) instances of buddies we've stored and others that are returned by the framework.
joustSimGroup
- the JoustSIM Group corresponding to the groupgroupMembers
- the group members that we should add to the group.ssclCallback
- a callback to the server stored contact list
we're creating.isResolved
- a boolean indicating whether or not the group has been
resolved against the server.public int countContacts()
public ContactGroup getParentContactGroup()
void addContact(ContactIcqImpl contact)
contact
- the new contact to add to this groupvoid removeContact(ContactIcqImpl contact)
contact
- the contact to remove.public java.util.Iterator<Contact> contacts()
public Contact getContact(java.lang.String id)
id
- the address or identifier of the Contact we are
looking for.public java.lang.String getGroupName()
public boolean canContainSubgroups()
public ContactGroup getGroup(int index)
index
- the index of the ContactGroup to retrieve.public ContactGroup getGroup(java.lang.String groupName)
groupName
- the name of the ContactGroup to retrieve.public java.util.Iterator<ContactGroup> subgroups()
public int countSubgroups()
public int hashCode()
hashCode
in class java.lang.Object
net.kano.joustsim.oscar.oscar.service.ssi.MutableGroup getJoustSimSourceGroup()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.public ProtocolProviderService getProtocolProvider()
public java.lang.String toString()
toString
in class java.lang.Object
ContactIcqImpl findContact(net.kano.joustsim.oscar.oscar.service.ssi.Buddy joustSimBuddy)
joustSimBuddy
- the buddy whose encapsulating contact we're looking
for.int findContactIndex(Contact contact)
contact
- the contact whose index we're looking for.ContactIcqImpl findContact(java.lang.String screenName)
screenName
- the screenName (or icq UIN) for the contact we're
looking for.void initNameCopy()
java.lang.String getNameCopy()
public boolean isPersistent()
public java.lang.String getPersistentData()
public boolean isResolved()
void setResolved(boolean resolved)
resolved
- true if this group hase been resolved against the server
and false otherwise.void updateGroup(net.kano.joustsim.oscar.oscar.service.ssi.MutableGroup joustSimGroup, java.util.List<? extends net.kano.joustsim.oscar.oscar.service.ssi.Buddy> serverBuddies, java.util.List<Contact> newContacts, java.util.List<ContactIcqImpl> removedContacts)
joustSimGroup
- the joustSimGroup sent by the server that we should
use to replace the volatile group with.serverBuddies
- a List of joust sim Buddy objects as they were
returned by the servernewContacts
- a list of ContactIcqImpl objects containing contacts
that were present as joust sim buddies in the serverBuddies
list but were not present in the group itself.removedContacts
- contacts assumed deleted because they were in the
local group but were not in the serverBuddies list.public java.lang.String getUID()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.