|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.contactlist.MclStorageManager
public class MclStorageManager
The class handles read / write operations over the file where a persistent copy of the meta contact list is stored.
The load / resolve strategy that we use when storing contact lists is roughly the following:
1) The MetaContactListService is started.
2) If no file exists for the meta contact list, create one. 3) We receive an
OSGI event telling us that a new ProtocolProviderService is registered or we
simply retrieve one that was already in the bundle 4) We look through the
contact list file and load groups and contacts belonging to this new
provider. Unresolved proto groups and contacts will be created for every one
of them.
| Nested Class Summary | |
|---|---|
(package private) static class |
MclStorageManager.StoredProtoContactDescriptor
Contains details parsed out of the contact list xml file, necessary for creating unresolved contacts. |
| Constructor Summary | |
|---|---|
MclStorageManager()
|
|
| Method Summary | |
|---|---|
void |
childContactsReordered(MetaContactGroupEvent evt)
We simply ignore - we're not interested in this kind of events. |
(package private) void |
extractContactsForAccount(String accountID)
Parses the contact list file and calls corresponding "add" methods belonging to mclServiceImpl for every meta contact and meta contact group stored in the (contactlist.xml) file that correspond to a provider caring the specified accountID. |
(package private) boolean |
isStarted()
Determines whether the storage manager has been properly started or in other words that it has successfully found and read the xml contact list file. |
void |
metaContactAdded(MetaContactEvent evt)
Indicates that a MetaContact has been successfully added to the MetaContact list. |
void |
metaContactAvatarUpdated(MetaContactAvatarUpdateEvent evt)
Indicates that a new avatar is available for a MetaContact. |
void |
metaContactGroupAdded(MetaContactGroupEvent evt)
Creates XML nodes for the source metacontact group, its child meta contacts and associated protogroups and adds them to the xml contact list. |
void |
metaContactGroupModified(MetaContactGroupEvent evt)
Determines the exact type of the change and acts accordingly by either updating group name or . |
void |
metaContactGroupRemoved(MetaContactGroupEvent evt)
Removes the corresponding node from the xml document. |
void |
metaContactModified(MetaContactModifiedEvent evt)
Indicates that a MetaContact has been modified. |
void |
metaContactMoved(MetaContactMovedEvent evt)
Moves the corresponding node from its old parent to the node corresponding to the new parent meta group. |
void |
metaContactRemoved(MetaContactEvent evt)
Removes the corresponding node from the xml document. |
void |
metaContactRenamed(MetaContactRenamedEvent evt)
Changes the display name attribute of the specified meta contact node. |
void |
protoContactAdded(ProtoContactEvent evt)
Indicates that a protocol specific Contact instance has been added to the list of protocol specific buddies in this MetaContact |
void |
protoContactModified(ProtoContactEvent evt)
Updates the data stored for the contact that caused this event. |
void |
protoContactMoved(ProtoContactEvent evt)
Indicates that a protocol specific Contact instance has been moved from within one MetaContact to another. |
void |
protoContactRemoved(ProtoContactEvent evt)
Removes the corresponding node from the xml contact list. |
(package private) void |
removeContactListFile()
Removes the file where we store contact lists. |
(package private) void |
start(org.osgi.framework.BundleContext bc,
MetaContactListServiceImpl mclServImpl)
Initializes the storage manager and makes it do initial load and parsing of the contact list file. |
void |
stop()
Prepares the storage manager for shutdown. |
void |
storeContactListAndStopStorageManager()
Stops the storage manager and performs a final write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MclStorageManager()
| Method Detail |
|---|
boolean isStarted()
public void stop()
void start(org.osgi.framework.BundleContext bc,
MetaContactListServiceImpl mclServImpl)
throws IOException,
XMLException
bc - a reference to the currently valid OSGI BundleContextmclServImpl - a reference to the currently valid instance of the
MetaContactListServiceImpl that we could use to pass
parsed contacts and contact groups.
IOException - if the contact list file specified file does not
exist and could not be created.
XMLException - if there is a problem with the file syntax.public void storeContactListAndStopStorageManager()
void extractContactsForAccount(String accountID)
throws XMLException
accountID - the identifier of the account whose contacts we're
interested in.
XMLException - if a problem occurs while parsing contact list
contents.public void metaContactAdded(MetaContactEvent evt)
metaContactAdded in interface MetaContactListListenerevt - the MetaContactListEvent containing the corresponding contactpublic void metaContactGroupAdded(MetaContactGroupEvent evt)
metaContactGroupAdded in interface MetaContactListListenerevt - the MetaContactListEvent containing the corresponding contactpublic void metaContactGroupRemoved(MetaContactGroupEvent evt)
metaContactGroupRemoved in interface MetaContactListListenerevt - the MetaContactGroupEvent containing the corresponding contactpublic void metaContactMoved(MetaContactMovedEvent evt)
metaContactMoved in interface MetaContactListListenerevt - the MetaContactListEvent containing the corresponding contactpublic void metaContactRemoved(MetaContactEvent evt)
metaContactRemoved in interface MetaContactListListenerevt - the MetaContactListEvent containing the corresponding contactpublic void metaContactRenamed(MetaContactRenamedEvent evt)
metaContactRenamed in interface MetaContactListListenerevt - the MetaContactListEvent containing the corresponding contactpublic void protoContactModified(ProtoContactEvent evt)
protoContactModified in interface MetaContactListListenerevt - the MetaContactListEvent containing the corresponding contactpublic void metaContactModified(MetaContactModifiedEvent evt)
metaContactModified in interface MetaContactListListenerevt - the MetaContactModifiedEvent containing the corresponding
contactpublic void protoContactRemoved(ProtoContactEvent evt)
protoContactRemoved in interface MetaContactListListenerevt - a reference to the corresponding ProtoContactEventpublic void childContactsReordered(MetaContactGroupEvent evt)
childContactsReordered in interface MetaContactListListenerevt - the MetaContactGroupEvent containing details of this
event.public void metaContactGroupModified(MetaContactGroupEvent evt)
metaContactGroupModified in interface MetaContactListListenerevt - the MetaContactListEvent containing the corresponding contactpublic void protoContactAdded(ProtoContactEvent evt)
protoContactAdded in interface MetaContactListListenerevt - a reference to the corresponding ProtoContactEventpublic void protoContactMoved(ProtoContactEvent evt)
protoContactMoved in interface MetaContactListListenerevt - a reference to the ProtoContactMovedEvent instance.void removeContactListFile()
public void metaContactAvatarUpdated(MetaContactAvatarUpdateEvent evt)
metaContactAvatarUpdated in interface MetaContactListListenerevt - the MetaContactAvatarUpdateEvent containing details
of this event
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||