From 9ebcbf51af6dd6eb49dea2dd7fc08ce4c9df5f9b Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Thu, 1 Jun 2006 16:56:46 +0000 Subject: [PATCH] An xml exception needs to be caught when parsing contact list. --- .../MetaContactListServiceImpl.java | 55 ++++++++++++++++++- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java index e3512e382..574d1f0da 100644 --- a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java +++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java @@ -14,6 +14,7 @@ import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.xml.*; /** * An implementation of the MetaContactListService that would connect to @@ -133,7 +134,7 @@ public void start(BundleContext bc) } catch (Exception exc) { - logger.error("Failed loading the stored contact list."); + logger.error("Failed loading the stored contact list.", exc); } // start listening for newly register or removed protocol providers @@ -1257,8 +1258,16 @@ private void handleProviderAdded( { //load contacts, stored in the local contact list and corresponding to //this provider. - storageManager.extractContactsForAccount( - provider.getAccountID().getAccountUID()); + try + { + storageManager.extractContactsForAccount( + provider.getAccountID().getAccountUID()); + } + catch (XMLException exc) + { + logger.error("Failed to load contacts for account " + + provider.getAccountID().getAccountUID(), exc); + } synchronizeOpSetWithLocalContactList(opSetPersPresence); @@ -1653,6 +1662,16 @@ public void subscriptionFailed(SubscriptionEvent evt) logger.trace("Subscription failed: " + evt); } + /** + * Events delivered through this method are ignored as they are of no + * interest to this implementation of the meta contact list service. + * @param evt the SubscriptionEvent containing the source contact + */ + public void subscriptionResolved(SubscriptionEvent evt) + { + //who cares? + } + /** * Locates the MetaContact corresponding to the contact * that has been removed and updates it. If the removed proto contact @@ -1753,6 +1772,11 @@ private MetaContactGroup handleGroupCreatedEvent( return newMetaGroup; } + /** + * Adds the source group and its child contacts to the meta contact + * list. + * @param evt the ServerStoredGroupEvent containing the source group. + */ public void groupCreated(ServerStoredGroupEvent evt) { @@ -1785,6 +1809,16 @@ public void groupCreated(ServerStoredGroupEvent evt) , MetaContactGroupEvent.META_CONTACT_GROUP_ADDED); } + /** + * Dummy implementation. + *

+ * @param evt a ServerStoredGroupEvent containing the source group. + */ + public void groupResolved(ServerStoredGroupEvent evt) + { + //we couldn't care less :) + } + /** * Updates the local contact list by removing the meta contact group * corresponding to the group indicated by the delivered evt @@ -2267,6 +2301,13 @@ public void groupRemoved(ServerStoredGroupEvent evt) public void groupNameChanged(ServerStoredGroupEvent evt) {} + /** + * Evens delivered through this method are ignored + * @param evt param ignored + */ + public void groupResolved(ServerStoredGroupEvent evt) + {} + /** * Block the execution of the current thread until either a group * created event is received or milis miliseconds pass. @@ -2357,6 +2398,14 @@ public void subscriptionFailed(SubscriptionEvent evt) public void subscriptionMoved(SubscriptionMovedEvent evt) {} + /** + * Events delivered through this method are ignored + * @param evt param ignored + */ + public void subscriptionResolved(SubscriptionEvent evt) + {} + + /** * Block the execution of the current thread until either a contact * created event is received or milis miliseconds pass.