aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-12-09 20:45:16 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-12-09 20:45:16 +0000
commit331d75a93a6f83444b5d295c1697d6e707c19d46 (patch)
treecaee2201bed2c1c616acc70e0b52f5b52a68d23b
parent690b5fa412f7e98f5e5e342d5879aaf4fda02922 (diff)
downloadjitsi-331d75a93a6f83444b5d295c1697d6e707c19d46.zip
jitsi-331d75a93a6f83444b5d295c1697d6e707c19d46.tar.gz
jitsi-331d75a93a6f83444b5d295c1697d6e707c19d46.tar.bz2
Eliminates duplication of ProtocolProviderService.getOperationSet() and .getSupportedOperationSets() for all protocol implementations by moving the implementations into AbstractProtocolProviderService. Uses .getOperationSet() instead of .getSupportedOperationSets() where appropriate in order to produce less garbage (due to Hashtable cloning).
-rw-r--r--src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java15
-rw-r--r--src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java69
-rw-r--r--src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationServiceImpl.java14
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/ContactRightButtonMenu.java22
-rw-r--r--src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java29
-rw-r--r--src/net/java/sip/communicator/impl/protocol/dict/ProtocolProviderServiceDictImpl.java36
-rw-r--r--src/net/java/sip/communicator/impl/protocol/gibberish/ProtocolProviderServiceGibberishImpl.java36
-rw-r--r--src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java6
-rw-r--r--src/net/java/sip/communicator/impl/protocol/icq/OperationSetMultiUserChatIcqImpl.java7
-rw-r--r--src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java5
-rw-r--r--src/net/java/sip/communicator/impl/protocol/icq/OperationSetTypingNotificationsIcqImpl.java7
-rw-r--r--src/net/java/sip/communicator/impl/protocol/icq/ProtocolProviderServiceIcqImpl.java32
-rw-r--r--src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java36
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java6
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java6
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java36
-rw-r--r--src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java7
-rw-r--r--src/net/java/sip/communicator/impl/protocol/msn/OperationSetBasicInstantMessagingMsnImpl.java6
-rw-r--r--src/net/java/sip/communicator/impl/protocol/msn/OperationSetMultiUserChatMsnImpl.java10
-rw-r--r--src/net/java/sip/communicator/impl/protocol/msn/OperationSetTypingNotificationsMsnImpl.java6
-rw-r--r--src/net/java/sip/communicator/impl/protocol/msn/ProtocolProviderServiceMsnImpl.java32
-rw-r--r--src/net/java/sip/communicator/impl/protocol/rss/ProtocolProviderServiceRssImpl.java40
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicInstantMessagingSipImpl.java6
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/OperationSetTypingNotificationsSipImpl.java9
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java68
-rw-r--r--src/net/java/sip/communicator/impl/protocol/ssh/ProtocolProviderServiceSSHImpl.java45
-rw-r--r--src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetBasicInstantMessagingYahooImpl.java6
-rw-r--r--src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetMultiUserChatYahooImpl.java8
-rw-r--r--src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetTypingNotificationsYahooImpl.java6
-rw-r--r--src/net/java/sip/communicator/impl/protocol/yahoo/ProtocolProviderServiceYahooImpl.java33
-rw-r--r--src/net/java/sip/communicator/impl/protocol/zeroconf/BonjourService.java6
-rw-r--r--src/net/java/sip/communicator/impl/protocol/zeroconf/ClientThread.java16
-rw-r--r--src/net/java/sip/communicator/impl/protocol/zeroconf/ProtocolProviderServiceZeroconfImpl.java36
-rw-r--r--src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java35
-rw-r--r--src/net/java/sip/communicator/plugin/mailbox/Mailbox.java14
-rw-r--r--src/net/java/sip/communicator/service/protocol/AbstractProtocolProviderService.java45
-rw-r--r--src/net/java/sip/communicator/service/protocol/ProtocolProviderService.java7
-rw-r--r--test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java7
-rw-r--r--test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java14
-rw-r--r--test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java14
-rw-r--r--test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java7
-rw-r--r--test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java48
-rw-r--r--test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java2
-rw-r--r--test/net/java/sip/communicator/slick/protocol/gibberish/GibberishSlickFixture.java6
-rw-r--r--test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java5
-rw-r--r--test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPersistentPresence.java7
-rw-r--r--test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPresence.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetTypingNotifications.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/gibberish/TestProtocolProviderServiceGibberishImpl.java21
-rw-r--r--test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java2
-rw-r--r--test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java2
-rw-r--r--test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java2
-rw-r--r--test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetServerStoredInfo.java2
-rw-r--r--test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetTypingNotifications.java2
-rw-r--r--test/net/java/sip/communicator/slick/protocol/icq/TestProtocolProviderServiceIcqImpl.java28
-rw-r--r--test/net/java/sip/communicator/slick/protocol/jabber/JabberSlickFixture.java7
-rw-r--r--test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicInstantMessaging.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPersistentPresence.java6
-rw-r--r--test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPresence.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetTypingNotifications.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/jabber/TestProtocolProviderServiceJabberImpl.java21
-rw-r--r--test/net/java/sip/communicator/slick/protocol/msn/MsnSlickFixture.java8
-rw-r--r--test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetBasicInstantMessaging.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPersistentPresence.java6
-rw-r--r--test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetTypingNotifications.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/msn/TestProtocolProviderServiceMsnImpl.java22
-rwxr-xr-xtest/net/java/sip/communicator/slick/protocol/rss/TestProtocolProviderServiceRssImpl.java29
-rw-r--r--test/net/java/sip/communicator/slick/protocol/sip/SipSlickFixture.java6
-rw-r--r--test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicInstantMessaging.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPersistentPresence.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPresence.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/sip/TestProtocolProviderServiceSipImpl.java21
-rw-r--r--test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPersistentPresence.java6
-rw-r--r--test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetTypingNotifications.java4
-rw-r--r--test/net/java/sip/communicator/slick/protocol/yahoo/TestProtocolProviderServiceYahooImpl.java21
-rw-r--r--test/net/java/sip/communicator/slick/protocol/yahoo/YahooSlickFixture.java8
80 files changed, 407 insertions, 786 deletions
diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java
index 7573305..25df181 100644
--- a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java
@@ -10,6 +10,7 @@ import java.io.*;
import java.util.*;
import org.osgi.framework.*;
+
import net.java.sip.communicator.service.callhistory.*;
import net.java.sip.communicator.service.callhistory.event.*;
import net.java.sip.communicator.service.contactlist.*;
@@ -678,10 +679,9 @@ public class CallHistoryServiceImpl
logger.debug("Adding protocol provider " + provider.getProtocolName());
// check whether the provider has a basic telephony operation set
- OperationSetBasicTelephony opSetTelephony
- = (OperationSetBasicTelephony) provider
- .getSupportedOperationSets().get(
- OperationSetBasicTelephony.class.getName());
+ OperationSetBasicTelephony opSetTelephony =
+ (OperationSetBasicTelephony) provider
+ .getOperationSet(OperationSetBasicTelephony.class);
if (opSetTelephony != null)
{
@@ -701,10 +701,9 @@ public class CallHistoryServiceImpl
*/
private void handleProviderRemoved(ProtocolProviderService provider)
{
- OperationSetBasicTelephony opSetTelephony
- = (OperationSetBasicTelephony) provider
- .getSupportedOperationSets().get(
- OperationSetBasicTelephony.class.getName());
+ OperationSetBasicTelephony opSetTelephony =
+ (OperationSetBasicTelephony) provider
+ .getOperationSet(OperationSetBasicTelephony.class);
if (opSetTelephony != null)
{
diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java
index ed15778..60260b6 100644
--- a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java
@@ -9,6 +9,7 @@ package net.java.sip.communicator.impl.contactlist;
import java.util.*;
import org.osgi.framework.*;
+
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.contactlist.event.*;
import net.java.sip.communicator.service.protocol.*;
@@ -356,10 +357,9 @@ public class MetaContactListServiceImpl
boolean fireEvent)
throws MetaContactListException
{
- OperationSetPersistentPresence opSetPersPresence
- = (OperationSetPersistentPresence) provider
- .getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName());
+ OperationSetPersistentPresence opSetPersPresence =
+ (OperationSetPersistentPresence) provider
+ .getOperationSet(OperationSetPersistentPresence.class);
if (opSetPersPresence == null)
{
/** @todo handle non-persistent presence operation sets as well */
@@ -507,10 +507,9 @@ public class MetaContactListServiceImpl
throw new NullPointerException("Internal Error. Orphan group.");
}
- OperationSetPersistentPresence opSetPersPresence
- = (OperationSetPersistentPresence) protoProvider
- .getSupportedOperationSets().get(OperationSetPersistentPresence
- .class.getName());
+ OperationSetPersistentPresence opSetPersPresence =
+ (OperationSetPersistentPresence) protoProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
//if persistent presence is not supported - just bail
//we should have verified this earlier anyway
@@ -889,10 +888,9 @@ public class MetaContactListServiceImpl
currentParentMetaContact.removeProtoContact(contact);
//get a persistent presence operation set
- OperationSetPersistentPresence opSetPresence
- = (OperationSetPersistentPresence) contact
- .getProtocolProvider().getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ OperationSetPersistentPresence opSetPresence =
+ (OperationSetPersistentPresence) contact.getProtocolProvider()
+ .getOperationSet(OperationSetPersistentPresence.class);
if (opSetPresence == null)
{
@@ -991,10 +989,10 @@ public class MetaContactListServiceImpl
.getProtocolProvider(), (MetaContactGroupImpl) newMetaGroup);
//get a persistent or non persistent presence operation set
- OperationSetPersistentPresence opSetPresence
- = (OperationSetPersistentPresence) protoContact
- .getProtocolProvider().getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ OperationSetPersistentPresence opSetPresence =
+ (OperationSetPersistentPresence) protoContact
+ .getProtocolProvider().getOperationSet(
+ OperationSetPersistentPresence.class);
if (opSetPresence == null)
{
@@ -1040,15 +1038,14 @@ public class MetaContactListServiceImpl
//provider
OperationSetPresence opSetPresence =
(OperationSetPresence) contact.getProtocolProvider()
- .getSupportedOperationSets().get(OperationSetPresence.class
- .getName());
+ .getOperationSet(OperationSetPresence.class);
- //in case the provider only hase a persistent operation set:
+ //in case the provider only has a persistent operation set:
if (opSetPresence == null)
{
- opSetPresence = (OperationSetPresence) contact.getProtocolProvider()
- .getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName());
+ opSetPresence =
+ (OperationSetPresence) contact.getProtocolProvider()
+ .getOperationSet(OperationSetPersistentPresence.class);
if (opSetPresence == null)
{
@@ -1145,10 +1142,10 @@ public class MetaContactListServiceImpl
{
ContactGroup protoGroup = protoGroups.next();
- OperationSetPersistentPresence opSetPersPresence
- = (OperationSetPersistentPresence) protoGroup
- .getProtocolProvider().getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName());
+ OperationSetPersistentPresence opSetPersPresence =
+ (OperationSetPersistentPresence) protoGroup
+ .getProtocolProvider().getOperationSet(
+ OperationSetPersistentPresence.class);
if (opSetPersPresence == null)
{
@@ -1405,7 +1402,7 @@ public class MetaContactListServiceImpl
public Iterator<MetaContact> findAllMetaContactsForProvider(
ProtocolProviderService protocolProvider)
{
- ArrayList<MetaContact> resultList = new ArrayList();
+ List<MetaContact> resultList = new ArrayList<MetaContact>();
this.findAllMetaContactsForProvider(protocolProvider,
rootMetaGroup,
@@ -1619,11 +1616,9 @@ public class MetaContactListServiceImpl
+ provider.getProtocolName());
// check whether the provider has a persistent presence op set
- OperationSetPersistentPresence opSetPersPresence
- = (OperationSetPersistentPresence) provider
- .getSupportedOperationSets().get(
- OperationSetPersistentPresence.class
- .getName());
+ OperationSetPersistentPresence opSetPersPresence =
+ (OperationSetPersistentPresence) provider
+ .getOperationSet(OperationSetPersistentPresence.class);
this.currentlyInstalledProviders.put(
provider.getAccountID().getAccountUniqueID(),
@@ -2760,9 +2755,8 @@ public class MetaContactListServiceImpl
ProtocolProviderService sourceProvider = (ProtocolProviderService)
currentlyInstalledProviders.get(accountID);
OperationSetPersistentPresence presenceOpSet =
- (OperationSetPersistentPresence)sourceProvider
- .getSupportedOperationSets().get(OperationSetPersistentPresence
- .class.getName());
+ (OperationSetPersistentPresence) sourceProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
ContactGroup newProtoGroup = presenceOpSet.createUnresolvedContactGroup(
contactGroupUID, persistentData,
@@ -2812,9 +2806,8 @@ public class MetaContactListServiceImpl
ProtocolProviderService sourceProvider = (ProtocolProviderService)
currentlyInstalledProviders.get(accountID);
OperationSetPersistentPresence presenceOpSet =
- (OperationSetPersistentPresence)sourceProvider
- .getSupportedOperationSets().get(OperationSetPersistentPresence
- .class.getName());
+ (OperationSetPersistentPresence) sourceProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
Iterator<MclStorageManager.StoredProtoContactDescriptor> contactsIter
= protoContacts.iterator();
diff --git a/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationServiceImpl.java b/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationServiceImpl.java
index f673374..1c12ca4 100644
--- a/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/growlnotification/GrowlNotificationServiceImpl.java
@@ -300,10 +300,9 @@ public class GrowlNotificationServiceImpl
logger.debug("Adding protocol provider " + provider.getProtocolName());
// check whether the provider has a basic im operation set
- OperationSetBasicInstantMessaging opSetIm
- = (OperationSetBasicInstantMessaging) provider
- .getSupportedOperationSets().get(
- OperationSetBasicInstantMessaging.class.getName());
+ OperationSetBasicInstantMessaging opSetIm =
+ (OperationSetBasicInstantMessaging) provider
+ .getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
{
@@ -334,10 +333,9 @@ public class GrowlNotificationServiceImpl
*/
private void handleProviderRemoved(ProtocolProviderService provider)
{
- OperationSetBasicInstantMessaging opSetIm
- = (OperationSetBasicInstantMessaging) provider
- .getSupportedOperationSets().get(
- OperationSetBasicInstantMessaging.class.getName());
+ OperationSetBasicInstantMessaging opSetIm =
+ (OperationSetBasicInstantMessaging) provider
+ .getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
{
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactRightButtonMenu.java
index a50f32b..0f9b502 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactRightButtonMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactRightButtonMenu.java
@@ -293,8 +293,8 @@ public class ContactRightButtonMenu
this.moveSubcontactMenu.add(contactItem1);
// add all the contacts that support telephony to the call menu
- if (contact.getProtocolProvider().getSupportedOperationSets()
- .get(OperationSetBasicTelephony.class.getName()) != null)
+ if (contact.getProtocolProvider().getOperationSet(
+ OperationSetBasicTelephony.class) != null)
{
JMenuItem callContactItem = new JMenuItem(contactDisplayName);
callContactItem.setIcon(protocolIcon);
@@ -304,9 +304,8 @@ public class ContactRightButtonMenu
this.callContactMenu.add(callContactItem);
}
- OperationSetWebContactInfo wContactInfo
- = (OperationSetWebContactInfo) protocolProvider
- .getOperationSet(OperationSetWebContactInfo.class);
+ // TODO Why is OperationSetWebContactInfo requested and not used?
+ protocolProvider.getOperationSet(OperationSetWebContactInfo.class);
}
this.add(sendMessageItem);
@@ -641,16 +640,17 @@ public class ContactRightButtonMenu
*/
private Contact getContactFromMetaContact(String itemID)
{
- Iterator i = contactItem.getContacts();
+ Iterator<Contact> i = contactItem.getContacts();
- while(i.hasNext())
+ while (i.hasNext())
{
- Contact contact = (Contact)i.next();
+ Contact contact = i.next();
- String id = contact.getAddress()
- + contact.getProtocolProvider().getProtocolName();
+ String id =
+ contact.getAddress()
+ + contact.getProtocolProvider().getProtocolName();
- if(itemID.equals(id))
+ if (itemID.equals(id))
{
return contact;
}
diff --git a/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java
index e4739fd..0f7d7ee 100644
--- a/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java
@@ -24,7 +24,6 @@ import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
-
/**
* The Message History Service stores messages exchanged through the various protocols
* Logs messages for all protocol providers that support basic instant messaging
@@ -929,10 +928,9 @@ public class MessageHistoryServiceImpl
+ provider.getProtocolDisplayName());
// check whether the provider has a basic im operation set
- OperationSetBasicInstantMessaging opSetIm
- = (OperationSetBasicInstantMessaging) provider
- .getSupportedOperationSets().get(
- OperationSetBasicInstantMessaging.class.getName());
+ OperationSetBasicInstantMessaging opSetIm =
+ (OperationSetBasicInstantMessaging) provider
+ .getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
{
@@ -943,10 +941,9 @@ public class MessageHistoryServiceImpl
logger.trace("Service did not have a im op. set.");
}
- OperationSetMultiUserChat opSetMultiUChat
- = (OperationSetMultiUserChat) provider
- .getSupportedOperationSets().get(
- OperationSetMultiUserChat.class.getName());
+ OperationSetMultiUserChat opSetMultiUChat =
+ (OperationSetMultiUserChat) provider
+ .getOperationSet(OperationSetMultiUserChat.class);
if (opSetMultiUChat != null)
{
@@ -975,20 +972,18 @@ public class MessageHistoryServiceImpl
*/
private void handleProviderRemoved(ProtocolProviderService provider)
{
- OperationSetBasicInstantMessaging opSetIm
- = (OperationSetBasicInstantMessaging) provider
- .getSupportedOperationSets().get(
- OperationSetBasicInstantMessaging.class.getName());
+ OperationSetBasicInstantMessaging opSetIm =
+ (OperationSetBasicInstantMessaging) provider
+ .getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
{
opSetIm.removeMessageListener(this);
}
- OperationSetMultiUserChat opSetMultiUChat
- = (OperationSetMultiUserChat) provider
- .getSupportedOperationSets().get(
- OperationSetMultiUserChat.class.getName());
+ OperationSetMultiUserChat opSetMultiUChat =
+ (OperationSetMultiUserChat) provider
+ .getOperationSet(OperationSetMultiUserChat.class);
if (opSetMultiUChat != null)
{
diff --git a/src/net/java/sip/communicator/impl/protocol/dict/ProtocolProviderServiceDictImpl.java b/src/net/java/sip/communicator/impl/protocol/dict/ProtocolProviderServiceDictImpl.java
index b803c6c..426f13f 100644
--- a/src/net/java/sip/communicator/impl/protocol/dict/ProtocolProviderServiceDictImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/dict/ProtocolProviderServiceDictImpl.java
@@ -6,8 +6,6 @@
*/
package net.java.sip.communicator.impl.protocol.dict;
-import java.util.*;
-
import net.java.dict4j.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
@@ -44,11 +42,6 @@ public class ProtocolProviderServiceDictImpl
private Object initializationLock = new Object();
/**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable supportedOperationSets = new Hashtable();
-
- /**
* Indicates whether or not the provider is initialized and ready for use.
*/
private boolean isInitialized = false;
@@ -163,21 +156,6 @@ public class ProtocolProviderServiceDictImpl
}
/**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if
- * the undelying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet) getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
- /**
* Returns the short name of the protocol that the implementation of this
* provider is based upon (like SIP, Jabber, ICQ/AIM, or others for
* example).
@@ -212,20 +190,6 @@ public class ProtocolProviderServiceDictImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return a java.util.Map containing instance of all supported
- * operation sets mapped against their class names (e.g.
- * OperationSetPresence.class.getName()) .
- */
- public Map getSupportedOperationSets()
- {
- //Copy the map so that the caller is not able to modify it.
- return (Map)supportedOperationSets.clone();
- }
-
- /**
* Starts the registration process.
*
* @param authority the security authority that will be used for
diff --git a/src/net/java/sip/communicator/impl/protocol/gibberish/ProtocolProviderServiceGibberishImpl.java b/src/net/java/sip/communicator/impl/protocol/gibberish/ProtocolProviderServiceGibberishImpl.java
index 714d5e5..6a64b1a 100644
--- a/src/net/java/sip/communicator/impl/protocol/gibberish/ProtocolProviderServiceGibberishImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/gibberish/ProtocolProviderServiceGibberishImpl.java
@@ -6,8 +6,6 @@
*/
package net.java.sip.communicator.impl.protocol.gibberish;
-import java.util.*;
-
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
@@ -39,11 +37,6 @@ public class ProtocolProviderServiceGibberishImpl
private Object initializationLock = new Object();
/**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable supportedOperationSets = new Hashtable();
-
- /**
* Indicates whether or not the provider is initialized and ready for use.
*/
private boolean isInitialized = false;
@@ -141,21 +134,6 @@ public class ProtocolProviderServiceGibberishImpl
}
/**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if
- * the undelying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet) getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
- /**
* Returns the short name of the protocol that the implementation of this
* provider is based upon (like SIP, Jabber, ICQ/AIM, or others for
* example).
@@ -181,20 +159,6 @@ public class ProtocolProviderServiceGibberishImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return a java.util.Map containing instance of all supported
- * operation sets mapped against their class names (e.g.
- * OperationSetPresence.class.getName()) .
- */
- public Map getSupportedOperationSets()
- {
- //Copy the map so that the caller is not able to modify it.
- return (Map)supportedOperationSets.clone();
- }
-
- /**
* Starts the registration process.
*
* @param authority the security authority that will be used for
diff --git a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java
index 2f5a989..b0827cf 100644
--- a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java
@@ -366,9 +366,9 @@ public class OperationSetBasicInstantMessagingIcqImpl
icqProvider.getAimConnection().getIcbmService()
.addIcbmListener(joustSimIcbmListener);
- opSetPersPresence = (OperationSetPersistentPresenceIcqImpl)
- icqProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceIcqImpl) icqProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
}
else if (evt.getNewState() == RegistrationState.REGISTERED)
{
diff --git a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetMultiUserChatIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetMultiUserChatIcqImpl.java
index ff59214..ba77f3e 100644
--- a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetMultiUserChatIcqImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetMultiUserChatIcqImpl.java
@@ -502,10 +502,9 @@ public class OperationSetMultiUserChatIcqImpl
.getProperty("icq.custom.message.charset")) != null)
OscarTools.setDefaultCharset(customMessageEncoding);
- opSetPersPresence
- = (OperationSetPersistentPresenceIcqImpl) icqProvider
- .getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceIcqImpl) icqProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
//add ChatRoomMangagerListener
icqProvider.getAimConnection().getChatRoomManager()
diff --git a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java
index 433130e..87d0942 100644
--- a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java
@@ -1243,9 +1243,8 @@ public class OperationSetPersistentPresenceIcqImpl
if(parentProvider.USING_ICQ)
{
opSetExtendedAuthorizations =
- (OperationSetExtendedAuthorizationsIcqImpl)
- parentProvider.getSupportedOperationSets()
- .get(OperationSetExtendedAuthorizations.class.getName());
+ (OperationSetExtendedAuthorizationsIcqImpl) parentProvider
+ .getOperationSet(OperationSetExtendedAuthorizations.class);
if(presenceQueryTimer == null)
presenceQueryTimer = new Timer();
diff --git a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetTypingNotificationsIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetTypingNotificationsIcqImpl.java
index e2849e3..7d23ed0 100644
--- a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetTypingNotificationsIcqImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetTypingNotificationsIcqImpl.java
@@ -246,10 +246,9 @@ public class OperationSetTypingNotificationsIcqImpl
icqProvider.getAimConnection().getIcbmService()
.addIcbmListener(joustSimIcbmListener);
- opSetPersPresence = (OperationSetPersistentPresenceIcqImpl)
- icqProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
-
+ opSetPersPresence =
+ (OperationSetPersistentPresenceIcqImpl) icqProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
}
}
}
diff --git a/src/net/java/sip/communicator/impl/protocol/icq/ProtocolProviderServiceIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/ProtocolProviderServiceIcqImpl.java
index 5c4a0aa..77de1a9 100644
--- a/src/net/java/sip/communicator/impl/protocol/icq/ProtocolProviderServiceIcqImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/icq/ProtocolProviderServiceIcqImpl.java
@@ -33,11 +33,6 @@ public class ProtocolProviderServiceIcqImpl
private static final Logger logger =
Logger.getLogger(ProtocolProviderServiceIcqImpl.class);
- /**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable supportedOperationSets = new Hashtable();
-
private DefaultAppSession session = null;
private AimSession aimSession = null;
@@ -438,33 +433,6 @@ public class ProtocolProviderServiceIcqImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return an array of OperationSet-s supported by this protocol
- * provider implementation.
- */
- public Map getSupportedOperationSets()
- {
- return supportedOperationSets;
- }
-
- /**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if the
- * undelying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet)getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
- /**
* Initialized the service implementation, and puts it in a sate where it
* could interoperate with other services. It is strongly recomended that
* properties in this Map be mapped to property names as specified by
diff --git a/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java b/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
index f0a6cf0..22bccff 100644
--- a/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
@@ -37,12 +37,7 @@ public class ProtocolProviderServiceIrcImpl
/**
* We use this to lock access to initialization.
*/
- private Object initializationLock = new Object();
-
- /**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable supportedOperationSets = new Hashtable();
+ private final Object initializationLock = new Object();
/**
* The operation set managing multi user chat.
@@ -120,21 +115,6 @@ public class ProtocolProviderServiceIrcImpl
}
/**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if
- * the underlying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet) getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
- /**
* Returns the short name of the protocol that the implementation of this
* provider is based upon (like SIP, Jabber, ICQ/AIM, or others for
* example).
@@ -160,20 +140,6 @@ public class ProtocolProviderServiceIrcImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return a java.util.Map containing instance of all supported
- * operation sets mapped against their class names (e.g.
- * OperationSetPresence.class.getName()) .
- */
- public Map getSupportedOperationSets()
- {
- //Copy the map so that the caller is not able to modify it.
- return (Map) supportedOperationSets.clone();
- }
-
- /**
* Starts the registration process.
*
* @param authority the security authority that will be used for
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java
index 9cca898..d5fbb9a 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java
@@ -271,9 +271,9 @@ public class OperationSetBasicInstantMessagingJabberImpl
if (evt.getNewState() == RegistrationState.REGISTERED)
{
- opSetPersPresence = (OperationSetPersistentPresenceJabberImpl)
- jabberProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceJabberImpl) jabberProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
jabberProvider.getConnection().addPacketListener(
new SmackMessageListener(),
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java
index aecd937..6182741 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java
@@ -286,9 +286,9 @@ public class OperationSetTypingNotificationsJabberImpl
+ " to: " + evt.getNewState());
if (evt.getNewState() == RegistrationState.REGISTERED)
{
- opSetPersPresence = (OperationSetPersistentPresenceJabberImpl)
- jabberProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceJabberImpl) jabberProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
messageEventManager =
new MessageEventManager(jabberProvider.getConnection());
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java
index 728c98b..d7459cc 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java
@@ -36,11 +36,6 @@ public class ProtocolProviderServiceJabberImpl
Logger.getLogger(ProtocolProviderServiceJabberImpl.class);
/**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable supportedOperationSets = new Hashtable();
-
- /**
* Used to connect to a XMPP server.
*/
private XMPPConnection connection = null;
@@ -452,33 +447,6 @@ public class ProtocolProviderServiceJabberImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return an array of OperationSet-s supported by this protocol
- * provider implementation.
- */
- public Map getSupportedOperationSets()
- {
- return supportedOperationSets;
- }
-
- /**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if the
- * underlying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet)getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
- /**
* Initialized the service implementation, and puts it in a sate where it
* could interoperate with other services. It is strongly recommended that
* properties in this Map be mapped to property names as specified by
@@ -708,9 +676,7 @@ public class ProtocolProviderServiceJabberImpl
public void connectionClosed()
{
OperationSetPersistentPresenceJabberImpl opSetPersPresence =
- (OperationSetPersistentPresenceJabberImpl)
- getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ (OperationSetPersistentPresenceJabberImpl) getOperationSet(OperationSetPersistentPresence.class);
opSetPersPresence.fireProviderPresenceStatusChangeEvent(
opSetPersPresence.getPresenceStatus(), getJabberStatusEnum()
diff --git a/src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java b/src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java
index 97003a9..cbdb3cf 100644
--- a/src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java
+++ b/src/net/java/sip/communicator/impl/protocol/mock/MockProvider.java
@@ -28,7 +28,8 @@ public class MockProvider
/**
* The operation sets that our mock provider supports.
*/
- private Hashtable supportedOperationSets = new Hashtable();
+ private final Map<String, OperationSet> supportedOperationSets =
+ new Hashtable<String, OperationSet>();
/**
* The presence operation set supported by the mock provider.
@@ -127,7 +128,7 @@ public class MockProvider
* operation sets mapped against their class names (e.g.
* OperationSetPresence.class.getName()) .
*/
- public Map getSupportedOperationSets()
+ public Map<String, OperationSet> getSupportedOperationSets()
{
return this.supportedOperationSets;
}
@@ -141,7 +142,7 @@ public class MockProvider
* @return returns an OperationSet of the specified <tt>Class</tt> if the
* undelying implementation supports it or null otherwise.
*/
- public OperationSet getOperationSet(Class opsetClass)
+ public OperationSet getOperationSet(Class<? extends OperationSet> opsetClass)
{
return (OperationSet) getSupportedOperationSets()
.get(opsetClass.getName());
diff --git a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetBasicInstantMessagingMsnImpl.java b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetBasicInstantMessagingMsnImpl.java
index f27f947..49b0e6f 100644
--- a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetBasicInstantMessagingMsnImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetBasicInstantMessagingMsnImpl.java
@@ -168,9 +168,9 @@ public class OperationSetBasicInstantMessagingMsnImpl
if (evt.getNewState() == RegistrationState.REGISTERED)
{
- opSetPersPresence = (OperationSetPersistentPresenceMsnImpl)
- msnProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceMsnImpl) msnProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
msnProvider.getMessenger().
addMessageListener(new MsnMessageListener());
diff --git a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetMultiUserChatMsnImpl.java b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetMultiUserChatMsnImpl.java
index a773a23..f2b49fd 100644
--- a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetMultiUserChatMsnImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetMultiUserChatMsnImpl.java
@@ -1,3 +1,9 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
package net.java.sip.communicator.impl.protocol.msn;
import java.util.*;
@@ -558,11 +564,9 @@ public class OperationSetMultiUserChatMsnImpl
{
if (evt.getNewState() == RegistrationState.REGISTERED)
{
-
opSetPersPresence =
(OperationSetPersistentPresenceMsnImpl) msnProvider
- .getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName());
+ .getOperationSet(OperationSetPersistentPresence.class);
msnProvider.getMessenger().addSwitchboardListener(
new MsnSwitchboardListener());
diff --git a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetTypingNotificationsMsnImpl.java b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetTypingNotificationsMsnImpl.java
index 68e2d32..a792d6f 100644
--- a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetTypingNotificationsMsnImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetTypingNotificationsMsnImpl.java
@@ -233,9 +233,9 @@ public class OperationSetTypingNotificationsMsnImpl
+ " to: " + evt.getNewState());
if (evt.getNewState() == RegistrationState.REGISTERED)
{
- opSetPersPresence = (OperationSetPersistentPresenceMsnImpl)
- msnProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceMsnImpl) msnProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
}
}
}
diff --git a/src/net/java/sip/communicator/impl/protocol/msn/ProtocolProviderServiceMsnImpl.java b/src/net/java/sip/communicator/impl/protocol/msn/ProtocolProviderServiceMsnImpl.java
index 56e93fc..21f11da 100644
--- a/src/net/java/sip/communicator/impl/protocol/msn/ProtocolProviderServiceMsnImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/msn/ProtocolProviderServiceMsnImpl.java
@@ -29,11 +29,6 @@ public class ProtocolProviderServiceMsnImpl
private static final Logger logger =
Logger.getLogger(ProtocolProviderServiceMsnImpl.class);
- /**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable supportedOperationSets = new Hashtable();
-
private MsnMessenger messenger = null;
/**
@@ -248,33 +243,6 @@ public class ProtocolProviderServiceMsnImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return an array of OperationSet-s supported by this protocol
- * provider implementation.
- */
- public Map getSupportedOperationSets()
- {
- return supportedOperationSets;
- }
-
- /**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if the
- * undelying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet)getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
- /**
* Initialized the service implementation, and puts it in a sate where it
* could interoperate with other services. It is strongly recomended that
* properties in this Map be mapped to property names as specified by
diff --git a/src/net/java/sip/communicator/impl/protocol/rss/ProtocolProviderServiceRssImpl.java b/src/net/java/sip/communicator/impl/protocol/rss/ProtocolProviderServiceRssImpl.java
index 3c7b48e..f0b61d3 100644
--- a/src/net/java/sip/communicator/impl/protocol/rss/ProtocolProviderServiceRssImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/rss/ProtocolProviderServiceRssImpl.java
@@ -6,8 +6,6 @@
*/
package net.java.sip.communicator.impl.protocol.rss;
-import java.util.*;
-
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
@@ -37,12 +35,7 @@ public class ProtocolProviderServiceRssImpl
/**
* We use this to lock access to initialization.
*/
- private Object initializationLock = new Object();
-
- /**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable supportedOperationSets = new Hashtable();
+ private final Object initializationLock = new Object();
/**
* Indicates whether or not the provider is initialized and ready for use.
@@ -60,8 +53,6 @@ public class ProtocolProviderServiceRssImpl
*/
private OperationSetBasicInstantMessagingRssImpl basicInstantMessaging;
- private boolean start = false;
-
/**
* The registration state that we are currently in. Note that in a real
* world protocol implementation this field won't exist and the registration
@@ -141,21 +132,6 @@ public class ProtocolProviderServiceRssImpl
}
/**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if
- * the undelying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet) getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
- /**
* Returns the short name of the protocol that the implementation of this
* provider is based upon (like SIP, Jabber, ICQ/AIM, or others for
* example).
@@ -181,20 +157,6 @@ public class ProtocolProviderServiceRssImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return a java.util.Map containing instance of all supported
- * operation sets mapped against their class names (e.g.
- * OperationSetPresence.class.getName()) .
- */
- public Map getSupportedOperationSets()
- {
- //Copy the map so that the caller is not able to modify it.
- return (Map)supportedOperationSets.clone();
- }
-
- /**
* Starts the registration process.
*
* @param authority the security authority that will be used for
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicInstantMessagingSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicInstantMessagingSipImpl.java
index a8fef38..3760867 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicInstantMessagingSipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicInstantMessagingSipImpl.java
@@ -548,9 +548,9 @@ public class OperationSetBasicInstantMessagingSipImpl
if (evt.getNewState() == RegistrationState.REGISTERED)
{
- opSetPersPresence = (OperationSetPresenceSipImpl)
- sipProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPresenceSipImpl) sipProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
}
}
}
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetTypingNotificationsSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetTypingNotificationsSipImpl.java
index 9ea9428..0ae15cd 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetTypingNotificationsSipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetTypingNotificationsSipImpl.java
@@ -8,6 +8,7 @@ package net.java.sip.communicator.impl.protocol.sip;
import java.text.*;
import java.util.*;
+
import javax.sip.*;
import javax.sip.header.*;
import javax.sip.message.*;
@@ -15,10 +16,10 @@ import javax.sip.message.*;
import org.w3c.dom.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.service.protocol.Message;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.xml.*;
-import net.java.sip.communicator.service.protocol.Message;
/**
* A implementation of the typing notification operation
@@ -133,9 +134,9 @@ public class OperationSetTypingNotificationsSipImpl
if (evt.getNewState() == RegistrationState.REGISTERED)
{
- opSetPersPresence = (OperationSetPresenceSipImpl)
- sipProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPresenceSipImpl) sipProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
}
}
}
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
index 5bd3c68..cc99d26 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
@@ -9,6 +9,7 @@ package net.java.sip.communicator.impl.protocol.sip;
import java.net.*;
import java.text.*;
import java.util.*;
+
import javax.sip.*;
import javax.sip.address.*;
import javax.sip.header.*;
@@ -16,6 +17,7 @@ import javax.sip.message.*;
import org.osgi.framework.*;
+import net.java.sip.communicator.impl.protocol.sip.security.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
@@ -23,12 +25,10 @@ import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.service.version.Version;
import net.java.sip.communicator.util.*;
-import gov.nist.javax.sip.*;
+
import gov.nist.javax.sip.header.*;
import gov.nist.javax.sip.address.*;
import gov.nist.javax.sip.message.*;
-import gov.nist.javax.sip.stack.*;
-import net.java.sip.communicator.impl.protocol.sip.security.*;
/**
* A SIP implementation of the Protocol Provider Service.
@@ -45,12 +45,6 @@ public class ProtocolProviderServiceSipImpl
Logger.getLogger(ProtocolProviderServiceSipImpl.class);
/**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable<String, OperationSet> supportedOperationSets
- = new Hashtable<String, OperationSet>();
-
- /**
* The identifier of the account that this provider represents.
*/
private AccountID accountID = null;
@@ -71,12 +65,6 @@ public class ProtocolProviderServiceSipImpl
private List<String> registeredEvents = new ArrayList<String>();
/**
- * The SipFactory instance used to create the SipStack and the Address
- * Message and Header Factories.
- */
- private SipFactory sipFactory;
-
- /**
* The AddressFactory used to create URLs ans Address objects.
*/
private AddressFactory addressFactory;
@@ -160,11 +148,6 @@ public class ProtocolProviderServiceSipImpl
private MaxForwardsHeader maxForwardsHeader = null;
/**
- * The contact header we use in non REGISTER requests.
- */
- private ContactHeader genericContactHeader = null;
-
- /**
* The header that we use to identify ourselves.
*/
private UserAgentHeader userAgentHeader = null;
@@ -278,40 +261,6 @@ public class ProtocolProviderServiceSipImpl
}
/**
- * Returns an array containing all operation sets supported by the current
- * implementation. When querying this method users must be prepared to
- * receive any sybset of the OperationSet-s defined by this service. They
- * MUST ignore any OperationSet-s that they are not aware of and that may be
- * defined by future version of this service. Such "unknown" OperationSet-s
- * though not encouraged, may also be defined by service implementors.
- *
- * @return a java.util.Map containing instance of all supported operation
- * sets mapped against their class names (e.g.
- * OperationSetPresence.class.getName()) .
- */
- public Map<String, OperationSet> getSupportedOperationSets()
- {
- return supportedOperationSets;
- }
-
- /**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if the
- * undelying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet)getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
-
-
- /**
* Starts the registration process. Connection details such as
* registration server, user name/number are provided through the
* configuration service through implementation specific properties.
@@ -569,7 +518,7 @@ public class ProtocolProviderServiceSipImpl
OperationSetDTMF.class.getName(), opSetDTMF);
//initialize our OPTIONS handler
- ClientCapabilities capabilities = new ClientCapabilities(this);
+ new ClientCapabilities(this);
//initialize our display name
ourDisplayName = (String)accountID.getAccountProperties()
@@ -923,7 +872,6 @@ public class ProtocolProviderServiceSipImpl
headerFactory = null;
messageFactory = null;
addressFactory = null;
- sipFactory = null;
sipSecurityManager = null;
methodProcessors.clear();
@@ -1522,9 +1470,6 @@ public class ProtocolProviderServiceSipImpl
private void initRegistrarlessConnection(SipAccountID accountID)
throws IllegalArgumentException
{
- String userID = (String) accountID.getAccountProperties()
- .get(ProtocolProviderFactory.USER_ID);
-
//registrar transport
String registrarTransport = (String) accountID.getAccountProperties()
.get(ProtocolProviderFactory.PREFERRED_TRANSPORT);
@@ -1836,7 +1781,8 @@ public class ProtocolProviderServiceSipImpl
}
else
{
- Class methodProcessorClass = methodProcessor.getClass();
+ Class<? extends MethodProcessor> methodProcessorClass =
+ methodProcessor.getClass();
for (Iterator<MethodProcessor> processorIter =
processors.iterator(); processorIter.hasNext();)
{
@@ -1967,7 +1913,7 @@ public class ProtocolProviderServiceSipImpl
{
try
{
- List userAgentTokens = new LinkedList();
+ List<String> userAgentTokens = new LinkedList<String>();
Version ver =
SipActivator.getVersionService().getCurrentVersion();
diff --git a/src/net/java/sip/communicator/impl/protocol/ssh/ProtocolProviderServiceSSHImpl.java b/src/net/java/sip/communicator/impl/protocol/ssh/ProtocolProviderServiceSSHImpl.java
index 08eb57b..3230cfc 100644
--- a/src/net/java/sip/communicator/impl/protocol/ssh/ProtocolProviderServiceSSHImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/ssh/ProtocolProviderServiceSSHImpl.java
@@ -9,20 +9,21 @@
* SSH Suport in SIP Communicator - GSoC' 07 Project
*
*/
-
package net.java.sip.communicator.impl.protocol.ssh;
import java.io.*;
-import java.util.*;
-import com.jcraft.jsch.*;
+
import javax.swing.*;
-import org.osgi.framework.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.Logger;
import net.java.sip.communicator.service.gui.*;
+import org.osgi.framework.*;
+
+import com.jcraft.jsch.*;
+
/**
* A SSH implementation of the ProtocolProviderService.
*
@@ -75,12 +76,7 @@ public class ProtocolProviderServiceSSHImpl
/**
* We use this to lock access to initialization.
*/
- private Object initializationLock = new Object();
-
- /**
- * The hashtable with the operation sets that we support locally.
- */
- private final Hashtable supportedOperationSets = new Hashtable();
+ private final Object initializationLock = new Object();
private OperationSetBasicInstantMessagingSSHImpl basicInstantMessaging;
@@ -515,21 +511,6 @@ public class ProtocolProviderServiceSSHImpl
}
/**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if
- * the undelying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet) getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
- /**
* Returns the short name of the protocol that the implementation of this
* provider is based upon (like SIP, Jabber, ICQ/AIM, or others for
* example).
@@ -555,20 +536,6 @@ public class ProtocolProviderServiceSSHImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return a java.util.Map containing instance of all supported
- * operation sets mapped against their class names (e.g.
- * OperationSetPresence.class.getName()) .
- */
- public Map getSupportedOperationSets()
- {
- //Copy the map so that the caller is not able to modify it.
- return (Map)supportedOperationSets.clone();
- }
-
- /**
* Starts the registration process.
*
* @param authority the security authority that will be used for
diff --git a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetBasicInstantMessagingYahooImpl.java b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetBasicInstantMessagingYahooImpl.java
index bfa1460..ca145cc 100644
--- a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetBasicInstantMessagingYahooImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetBasicInstantMessagingYahooImpl.java
@@ -233,9 +233,9 @@ public class OperationSetBasicInstantMessagingYahooImpl
if (evt.getNewState() == RegistrationState.REGISTERED)
{
- opSetPersPresence = (OperationSetPersistentPresenceYahooImpl)
- yahooProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceYahooImpl) yahooProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
yahooProvider.getYahooSession().
addSessionListener(new YahooMessageListener());
diff --git a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetMultiUserChatYahooImpl.java b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetMultiUserChatYahooImpl.java
index fad58da..e049e4f 100644
--- a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetMultiUserChatYahooImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetMultiUserChatYahooImpl.java
@@ -582,11 +582,9 @@ public class OperationSetMultiUserChatYahooImpl
{
if (evt.getNewState() == RegistrationState.REGISTERED)
{
-
- opSetPersPresence
- = (OperationSetPersistentPresenceYahooImpl) yahooProvider
- .getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceYahooImpl) yahooProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
yahooProvider.getYahooSession().addSessionListener(
new YahooMessageListener());
diff --git a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetTypingNotificationsYahooImpl.java b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetTypingNotificationsYahooImpl.java
index 587f2b6..65827e8 100644
--- a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetTypingNotificationsYahooImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetTypingNotificationsYahooImpl.java
@@ -219,9 +219,9 @@ public class OperationSetTypingNotificationsYahooImpl
+ " to: " + evt.getNewState());
if (evt.getNewState() == RegistrationState.REGISTERED)
{
- opSetPersPresence = (OperationSetPersistentPresenceYahooImpl)
- yahooProvider.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceYahooImpl) yahooProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
yahooProvider.getYahooSession().addSessionListener(new TypingListener());
}
diff --git a/src/net/java/sip/communicator/impl/protocol/yahoo/ProtocolProviderServiceYahooImpl.java b/src/net/java/sip/communicator/impl/protocol/yahoo/ProtocolProviderServiceYahooImpl.java
index fc74051..97f3b77 100644
--- a/src/net/java/sip/communicator/impl/protocol/yahoo/ProtocolProviderServiceYahooImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/yahoo/ProtocolProviderServiceYahooImpl.java
@@ -7,7 +7,6 @@
package net.java.sip.communicator.impl.protocol.yahoo;
import java.io.*;
-import java.util.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
@@ -29,11 +28,6 @@ public class ProtocolProviderServiceYahooImpl
private static final Logger logger =
Logger.getLogger(ProtocolProviderServiceYahooImpl.class);
- /**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable supportedOperationSets = new Hashtable();
-
private YahooSession yahooSession = null;
/**
@@ -279,33 +273,6 @@ public class ProtocolProviderServiceYahooImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return an array of OperationSet-s supported by this protocol
- * provider implementation.
- */
- public Map getSupportedOperationSets()
- {
- return supportedOperationSets;
- }
-
- /**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if the
- * undelying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet)getSupportedOperationSets()
- .get(opsetClass.getName());
- }
-
- /**
* Initialized the service implementation, and puts it in a sate where it
* could interoperate with other services. It is strongly recomended that
* properties in this Map be mapped to property names as specified by
diff --git a/src/net/java/sip/communicator/impl/protocol/zeroconf/BonjourService.java b/src/net/java/sip/communicator/impl/protocol/zeroconf/BonjourService.java
index 8942303..2139e7e 100644
--- a/src/net/java/sip/communicator/impl/protocol/zeroconf/BonjourService.java
+++ b/src/net/java/sip/communicator/impl/protocol/zeroconf/BonjourService.java
@@ -75,9 +75,9 @@ public class BonjourService extends Thread
this.id = acc.getUserID();
this.pps = pps;
- opSetPersPresence = (OperationSetPersistentPresenceZeroconfImpl)
- pps.getSupportedOperationSets()
- .get(OperationSetPersistentPresence.class.getName());
+ opSetPersPresence =
+ (OperationSetPersistentPresenceZeroconfImpl) pps
+ .getOperationSet(OperationSetPersistentPresence.class);
props = new Hashtable();
diff --git a/src/net/java/sip/communicator/impl/protocol/zeroconf/ClientThread.java b/src/net/java/sip/communicator/impl/protocol/zeroconf/ClientThread.java
index 135f45f..35da61a 100644
--- a/src/net/java/sip/communicator/impl/protocol/zeroconf/ClientThread.java
+++ b/src/net/java/sip/communicator/impl/protocol/zeroconf/ClientThread.java
@@ -81,13 +81,15 @@ public class ClientThread
this.sock = sock;
this.remoteIPAddress = sock.getInetAddress();
this.bonjourService = bonjourService;
- this.opSetBasicIM = (OperationSetBasicInstantMessagingZeroconfImpl)
- bonjourService.getPPS().getSupportedOperationSets()
- .get(OperationSetBasicInstantMessaging.class.getName());
-
- this.opSetTyping = (OperationSetTypingNotificationsZeroconfImpl)
- bonjourService.getPPS().getSupportedOperationSets()
- .get(OperationSetTypingNotifications.class.getName());
+ this.opSetBasicIM =
+ (OperationSetBasicInstantMessagingZeroconfImpl) bonjourService
+ .getPPS().getOperationSet(
+ OperationSetBasicInstantMessaging.class);
+
+ this.opSetTyping =
+ (OperationSetTypingNotificationsZeroconfImpl) bonjourService
+ .getPPS()
+ .getOperationSet(OperationSetTypingNotifications.class);
this.setDaemon(true);
try
diff --git a/src/net/java/sip/communicator/impl/protocol/zeroconf/ProtocolProviderServiceZeroconfImpl.java b/src/net/java/sip/communicator/impl/protocol/zeroconf/ProtocolProviderServiceZeroconfImpl.java
index 9b479aa..ef76386 100644
--- a/src/net/java/sip/communicator/impl/protocol/zeroconf/ProtocolProviderServiceZeroconfImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/zeroconf/ProtocolProviderServiceZeroconfImpl.java
@@ -6,8 +6,6 @@
*/
package net.java.sip.communicator.impl.protocol.zeroconf;
-import java.util.*;
-
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
@@ -23,11 +21,6 @@ public class ProtocolProviderServiceZeroconfImpl
{
private static final Logger logger =
Logger.getLogger(ProtocolProviderServiceZeroconfImpl.class);
-
- /**
- * The hashtable with the operation sets that we support locally.
- */
- private Hashtable supportedOperationSets = new Hashtable();
/**
* We use this to lock access to initialization.
@@ -152,21 +145,6 @@ public class ProtocolProviderServiceZeroconfImpl
}
}
-
- /**
- * Returns the operation set corresponding to the specified class or null
- * if this operation set is not supported by the provider implementation.
- *
- * @param opsetClass the <tt>Class</tt> of the operation set that we're
- * looking for.
- * @return returns an OperationSet of the specified <tt>Class</tt> if
- * the undelying implementation supports it or null otherwise.
- */
- public OperationSet getOperationSet(Class opsetClass)
- {
- return (OperationSet) getSupportedOperationSets()
- .get(opsetClass.getName());
- }
/**
* Returns the short name of the protocol that the implementation of this
@@ -194,20 +172,6 @@ public class ProtocolProviderServiceZeroconfImpl
}
/**
- * Returns an array containing all operation sets supported by the
- * current implementation.
- *
- * @return a java.util.Map containing instance of all supported
- * operation sets mapped against their class names (e.g.
- * OperationSetPresence.class.getName()) .
- */
- public Map getSupportedOperationSets()
- {
- //Copy the map so that the caller is not able to modify it.
- return (Map)supportedOperationSets.clone();
- }
-
- /**
* Starts the registration process.
*
* @param authority the security authority that will be used for
diff --git a/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java b/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java
index efdbad7..c370410 100644
--- a/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java
+++ b/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java
@@ -155,10 +155,9 @@ public class ChatAlerterActivator
logger.debug("Adding protocol provider " + provider.getProtocolName());
// check whether the provider has a basic im operation set
- OperationSetBasicInstantMessaging opSetIm
- = (OperationSetBasicInstantMessaging) provider
- .getSupportedOperationSets().get(
- OperationSetBasicInstantMessaging.class.getName());
+ OperationSetBasicInstantMessaging opSetIm =
+ (OperationSetBasicInstantMessaging) provider
+ .getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
{
@@ -170,10 +169,9 @@ public class ChatAlerterActivator
}
// check whether the provider has a sms operation set
- OperationSetSmsMessaging opSetSms
- = (OperationSetSmsMessaging) provider
- .getSupportedOperationSets().get(
- OperationSetSmsMessaging.class.getName());
+ OperationSetSmsMessaging opSetSms =
+ (OperationSetSmsMessaging) provider
+ .getOperationSet(OperationSetSmsMessaging.class);
if (opSetSms != null)
{
@@ -184,10 +182,9 @@ public class ChatAlerterActivator
logger.trace("Service did not have a sms op. set.");
}
- OperationSetMultiUserChat opSetMultiUChat
- = (OperationSetMultiUserChat) provider
- .getSupportedOperationSets().get(
- OperationSetMultiUserChat.class.getName());
+ OperationSetMultiUserChat opSetMultiUChat =
+ (OperationSetMultiUserChat) provider
+ .getOperationSet(OperationSetMultiUserChat.class);
if (opSetMultiUChat != null)
{
@@ -216,20 +213,18 @@ public class ChatAlerterActivator
*/
private void handleProviderRemoved(ProtocolProviderService provider)
{
- OperationSetBasicInstantMessaging opSetIm
- = (OperationSetBasicInstantMessaging) provider
- .getSupportedOperationSets().get(
- OperationSetBasicInstantMessaging.class.getName());
+ OperationSetBasicInstantMessaging opSetIm =
+ (OperationSetBasicInstantMessaging) provider
+ .getOperationSet(OperationSetBasicInstantMessaging.class);
if (opSetIm != null)
{
opSetIm.removeMessageListener(this);
}
- OperationSetMultiUserChat opSetMultiUChat
- = (OperationSetMultiUserChat) provider
- .getSupportedOperationSets().get(
- OperationSetMultiUserChat.class.getName());
+ OperationSetMultiUserChat opSetMultiUChat =
+ (OperationSetMultiUserChat) provider
+ .getOperationSet(OperationSetMultiUserChat.class);
if (opSetMultiUChat != null)
{
diff --git a/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java b/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java
index 14ad84f..234d434 100644
--- a/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java
+++ b/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java
@@ -348,10 +348,9 @@ public class Mailbox
logger.debug("Adding protocol provider " + provider.getProtocolName());
// check whether the provider has a basic telephony operation set
- OperationSetBasicTelephony opSetTelephony
- = (OperationSetBasicTelephony) provider
- .getSupportedOperationSets().get(
- OperationSetBasicTelephony.class.getName());
+ OperationSetBasicTelephony opSetTelephony =
+ (OperationSetBasicTelephony) provider
+ .getOperationSet(OperationSetBasicTelephony.class);
if (opSetTelephony != null)
{
@@ -372,10 +371,9 @@ public class Mailbox
*/
private void handleProviderRemoved(ProtocolProviderService provider)
{
- OperationSetBasicTelephony opSetTelephony
- = (OperationSetBasicTelephony) provider
- .getSupportedOperationSets().get(
- OperationSetBasicTelephony.class.getName());
+ OperationSetBasicTelephony opSetTelephony =
+ (OperationSetBasicTelephony) provider
+ .getOperationSet(OperationSetBasicTelephony.class);
if (opSetTelephony != null)
{
diff --git a/src/net/java/sip/communicator/service/protocol/AbstractProtocolProviderService.java b/src/net/java/sip/communicator/service/protocol/AbstractProtocolProviderService.java
index 5d1b414..1898ac0 100644
--- a/src/net/java/sip/communicator/service/protocol/AbstractProtocolProviderService.java
+++ b/src/net/java/sip/communicator/service/protocol/AbstractProtocolProviderService.java
@@ -33,6 +33,12 @@ public abstract class AbstractProtocolProviderService
new ArrayList<RegistrationStateChangeListener>();
/**
+ * The hashtable with the operation sets that we support locally.
+ */
+ protected final Map<String, OperationSet> supportedOperationSets
+ = new Hashtable<String, OperationSet>();
+
+ /**
* Registers the specified listener with this provider so that it would
* receive notifications on changes of its state or other properties such
* as its local address and display name.
@@ -93,6 +99,20 @@ public abstract class AbstractProtocolProviderService
}
/**
+ * Returns the operation set corresponding to the specified class or null if
+ * this operation set is not supported by the provider implementation.
+ *
+ * @param opsetClass the <tt>Class</tt> of the operation set that we're
+ * looking for.
+ * @return returns an OperationSet of the specified <tt>Class</tt> if the
+ * undelying implementation supports it or null otherwise.
+ */
+ public OperationSet getOperationSet(Class<? extends OperationSet> opsetClass)
+ {
+ return doGetSupportedOperationSets().get(opsetClass.getName());
+ }
+
+ /**
* Returns the protocol display name. This is the name that would be used
* by the GUI to display the protocol name.
*
@@ -107,6 +127,31 @@ public abstract class AbstractProtocolProviderService
}
/**
+ * Returns an array containing all operation sets supported by the current
+ * implementation. When querying this method users must be prepared to
+ * receive any subset of the OperationSet-s defined by this service. They
+ * MUST ignore any OperationSet-s that they are not aware of and that may be
+ * defined by future version of this service. Such "unknown" OperationSet-s
+ * though not encouraged, may also be defined by service implementors.
+ *
+ * @return a java.util.Map containing instance of all supported operation
+ * sets mapped against their class names (e.g.
+ * OperationSetPresence.class.getName()) .
+ */
+ public Map<String, OperationSet> getSupportedOperationSets()
+ {
+ Map<String, OperationSet> supportedOperationSets =
+ doGetSupportedOperationSets();
+
+ return new Hashtable<String, OperationSet>(supportedOperationSets);
+ }
+
+ protected Map<String, OperationSet> doGetSupportedOperationSets()
+ {
+ return supportedOperationSets;
+ }
+
+ /**
* Indicates whether or not this provider is registered
*
* @return true if the provider is currently registered and false
diff --git a/src/net/java/sip/communicator/service/protocol/ProtocolProviderService.java b/src/net/java/sip/communicator/service/protocol/ProtocolProviderService.java
index 0d52127..59227f0 100644
--- a/src/net/java/sip/communicator/service/protocol/ProtocolProviderService.java
+++ b/src/net/java/sip/communicator/service/protocol/ProtocolProviderService.java
@@ -10,7 +10,6 @@ import java.util.*;
import net.java.sip.communicator.service.protocol.event.*;
-
/**
* The ProtocolProvider interface should be implemented by bundles that wrap
* Instant Messaging and telephony protocol stacks. It gives the user interface
@@ -134,7 +133,7 @@ public interface ProtocolProviderService
/**
* Returns an array containing all operation sets supported by the current
* implementation. When querying this method users must be prepared to
- * receive any sybset of the OperationSet-s defined by this service. They
+ * receive any subset of the OperationSet-s defined by this service. They
* MUST ignore any OperationSet-s that they are not aware of and that may be
* defined by future version of this service. Such "unknown" OperationSet-s
* though not encouraged, may also be defined by service implementors.
@@ -143,7 +142,7 @@ public interface ProtocolProviderService
* sets mapped against their class names (e.g.
* OperationSetPresence.class.getName()) .
*/
- public Map getSupportedOperationSets();
+ public Map<String, OperationSet> getSupportedOperationSets();
/**
* Returns the operation set corresponding to the specified class or null
@@ -154,7 +153,7 @@ public interface ProtocolProviderService
* @return returns an OperationSet of the specified <tt>Class</tt> if the
* undelying implementation supports it or null otherwise.
*/
- public OperationSet getOperationSet(Class opsetClass);
+ public OperationSet getOperationSet(Class<? extends OperationSet> opsetClass);
/**
* Makes the service implementation close all open sockets and release
diff --git a/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java b/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java
index 0485448..2f28d79 100644
--- a/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java
+++ b/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java
@@ -91,12 +91,9 @@ public class TestCallHistoryService
mockProvider = new MockProvider("CallHistoryMockUser");
//store thre presence op set of the new provider into the fixture
- Map supportedOperationSets =
- mockProvider.getSupportedOperationSets();
-
mockBTelphonyOpSet =
- (MockOperationSetBasicTelephony) supportedOperationSets.get(
- OperationSetBasicTelephony.class.getName());
+ (MockOperationSetBasicTelephony) mockProvider
+ .getOperationSet(OperationSetBasicTelephony.class);
System.setProperty(MetaContactListService.PROVIDER_MASK_PROPERTY, "1");
diff --git a/test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java b/test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java
index 451cc35..a92df3d 100644
--- a/test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java
+++ b/test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java
@@ -118,22 +118,20 @@ public class MclSlickFixture
mockP1Grp1.addContact(emilP1);
mockP1Grp1.addSubgroup(subMockP1Grp);
- mockPresOpSetP1 = (MockPersistentPresenceOperationSet) mockP1
- .getSupportedOperationSets().get(
- OperationSetPresence.class.getName());
+ mockPresOpSetP1 =
+ (MockPersistentPresenceOperationSet) mockP1
+ .getOperationSet(OperationSetPresence.class);
mockPresOpSetP1.addMockGroup(mockP1Grp1);
//init mock provider 2
mockP2Grp1.addContact(emilP2);
- mockPresOpSetP2 = (MockPersistentPresenceOperationSet) mockP2
- .getSupportedOperationSets().get(
- OperationSetPresence.class.getName());
+ mockPresOpSetP2 =
+ (MockPersistentPresenceOperationSet) mockP2
+ .getOperationSet(OperationSetPresence.class);
mockPresOpSetP2.addMockGroup(mockP2Grp1);
}
-
-
public MclSlickFixture(Object obj)
{
}
diff --git a/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java b/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java
index 7c8b5bd..af21999 100644
--- a/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java
+++ b/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java
@@ -78,14 +78,11 @@ public class MetaContactListServiceLick
MclSlickFixture.mockProvider = provider;
//store thre presence op set of the new provider into the fixture
- Map supportedOperationSets =
- MclSlickFixture.mockProvider.getSupportedOperationSets();
//get the operation set presence here.
MclSlickFixture.mockPresOpSet =
- (MockPersistentPresenceOperationSet)supportedOperationSets.get(
- OperationSetPersistentPresence.class.getName());
-
+ (MockPersistentPresenceOperationSet) MclSlickFixture.mockProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
//add the meta contact list tests.
addTestSuite(TestMetaContactList.class);
@@ -175,10 +172,9 @@ public class MetaContactListServiceLick
*/
private void fillMockContactList(MockProvider provider)
{
- MockPersistentPresenceOperationSet mockOpSet
- = (MockPersistentPresenceOperationSet)provider.
- getSupportedOperationSets().get( OperationSetPersistentPresence.
- class.getName());
+ MockPersistentPresenceOperationSet mockOpSet =
+ (MockPersistentPresenceOperationSet) provider
+ .getOperationSet(OperationSetPersistentPresence.class);
MockContactGroup root =
(MockContactGroup)mockOpSet.getServerStoredContactListRoot();
root.addContact( new MockContact("Ivan Ivanov", provider) );
diff --git a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java
index 29fbbd2..0d6a863 100644
--- a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java
+++ b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java
@@ -45,10 +45,9 @@ public class TestMetaContactGroup extends TestCase
super.setUp();
fixture.setUp();
- OperationSetPersistentPresence opSetPresence
- = (OperationSetPersistentPresence)fixture.mockProvider
- .getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName());
+ OperationSetPersistentPresence opSetPresence =
+ (OperationSetPersistentPresence) fixture.mockProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
mockGroup = (MockContactGroup)opSetPresence
.getServerStoredContactListRoot();
diff --git a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java
index a3b75d7..6011b14 100644
--- a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java
+++ b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java
@@ -189,10 +189,10 @@ public class TestMetaContactListPersistence extends TestCase
{
//verify that contents of the meta contact list matches contents of
//the mock provider we removed.
- ContactGroup oldProtoRoot = ((OperationSetPersistentPresence)fixture
- .mockProvider.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup oldProtoRoot =
+ ((OperationSetPersistentPresence) fixture.mockProvider
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
fixture.assertGroupEquals(
(MockContactGroup)oldProtoRoot
@@ -202,10 +202,10 @@ public class TestMetaContactListPersistence extends TestCase
//verify that the new mock provider has created unresolved contacts
//for all contacts in the meta cl.
- ContactGroup newProtoRoot = ((OperationSetPersistentPresence)fixture
- .replacementMockPr.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup newProtoRoot =
+ ((OperationSetPersistentPresence) fixture.replacementMockPr
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
assertEquals("Newly loaded provider does not match the old one."
, oldProtoRoot
@@ -239,32 +239,32 @@ public class TestMetaContactListPersistence extends TestCase
.registerMockProviderService(fixture.replacementMockP2);
//Get references to the root groups of the 2 providers we removed
- ContactGroup oldProtoMockP1Root = ((OperationSetPersistentPresence)
- fixture.mockP1.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup oldProtoMockP1Root =
+ ((OperationSetPersistentPresence) fixture.mockP1
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
- ContactGroup oldProtoMockP2Root = ( (OperationSetPersistentPresence)
- fixture.mockP2.getSupportedOperationSets().
- get(OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup oldProtoMockP2Root =
+ ((OperationSetPersistentPresence) fixture.mockP2
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
//verify that contacts tnat unresolved contacts that have been created
//inside that the replacement mock providers match those in the
//providers we removed.
- ContactGroup newProtoMockP1Root = ((OperationSetPersistentPresence)fixture
- .replacementMockP1.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup newProtoMockP1Root =
+ ((OperationSetPersistentPresence) fixture.replacementMockP1
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
assertEquals("Newly loaded provider does not match the old one."
, oldProtoMockP1Root
, newProtoMockP1Root);
- ContactGroup newProtoMockP2Root = ((OperationSetPersistentPresence)fixture
- .replacementMockP2.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup newProtoMockP2Root =
+ ((OperationSetPersistentPresence) fixture.replacementMockP2
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
assertEquals("Newly loaded provider does not match the old one."
, oldProtoMockP2Root
diff --git a/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java b/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java
index 3c989a5..0a8f461 100644
--- a/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java
+++ b/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java
@@ -111,7 +111,7 @@ public class TestMsgHistoryService
mockProvider = new MockProvider("MessageHistoryMockUser");
//store thre presence op set of the new provider into the fixture
- Map supportedOperationSets =
+ Map<String, OperationSet> supportedOperationSets =
mockProvider.getSupportedOperationSets();
//get the operation set presence here.
diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/GibberishSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/gibberish/GibberishSlickFixture.java
index 4e35011..fc970b5 100644
--- a/test/net/java/sip/communicator/slick/protocol/gibberish/GibberishSlickFixture.java
+++ b/test/net/java/sip/communicator/slick/protocol/gibberish/GibberishSlickFixture.java
@@ -216,7 +216,8 @@ public class GibberishSlickFixture
public void clearProvidersLists()
throws Exception
{
- Map supportedOperationSets1 = provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets1 =
+ provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
|| supportedOperationSets1.size() < 1)
@@ -238,7 +239,8 @@ public class GibberishSlickFixture
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 = provider2.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets2 =
+ provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
|| supportedOperationSets2.size() < 1)
diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java
index ebf7cf6..2b45377 100644
--- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java
+++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java
@@ -10,6 +10,7 @@ import java.io.*;
import java.util.*;
import junit.framework.*;
+
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
@@ -49,7 +50,7 @@ public class TestOperationSetBasicInstantMessaging
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -82,7 +83,7 @@ public class TestOperationSetBasicInstantMessaging
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPersistentPresence.java
index e97f4ab..cf1009f 100644
--- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPersistentPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPersistentPresence.java
@@ -9,6 +9,7 @@ package net.java.sip.communicator.slick.protocol.gibberish;
import java.util.*;
import junit.framework.*;
+
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
@@ -73,7 +74,7 @@ public class TestOperationSetPersistentPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -96,8 +97,8 @@ public class TestOperationSetPersistentPresence
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 =
- fixture.provider2.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets2 =
+ fixture.provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
|| supportedOperationSets2.size() < 1)
diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPresence.java
index a57ddc1..51a5884 100644
--- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPresence.java
@@ -51,7 +51,7 @@ public class TestOperationSetPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -76,7 +76,7 @@ public class TestOperationSetPresence
}
// do it once again for the second provider
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetTypingNotifications.java
index 86fb2f6..f3db890 100644
--- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetTypingNotifications.java
+++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetTypingNotifications.java
@@ -44,7 +44,7 @@ public class TestOperationSetTypingNotifications
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -90,7 +90,7 @@ public class TestOperationSetTypingNotifications
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestProtocolProviderServiceGibberishImpl.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestProtocolProviderServiceGibberishImpl.java
index bc04f2f..6c6b6b8 100644
--- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestProtocolProviderServiceGibberishImpl.java
+++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestProtocolProviderServiceGibberishImpl.java
@@ -145,20 +145,19 @@ public class TestProtocolProviderServiceGibberishImpl
*/
public void testOperationSetTypes() throws Exception
{
- Map supportedOperationSets
- = fixture.provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets =
+ fixture.provider1.getSupportedOperationSets();
- //make sure that keys (which are supposed to be class names) correspond
- //what the class of the values recorded against them.
- Iterator setNames = supportedOperationSets.keySet().iterator();
- while (setNames.hasNext())
+ // make sure that keys (which are supposed to be class names) correspond
+ // what the class of the values recorded against them.
+ for (Map.Entry<String, OperationSet> entry : supportedOperationSets
+ .entrySet())
{
- String setName = (String) setNames.next();
- Object opSet = supportedOperationSets.get(setName);
+ String setName = entry.getKey();
+ Object opSet = entry.getValue();
- assertTrue(opSet + " was not an instance of "
- + setName + " as declared"
- , Class.forName(setName).isInstance(opSet));
+ assertTrue(opSet + " was not an instance of " + setName
+ + " as declared", Class.forName(setName).isInstance(opSet));
}
}
diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java
index 1f171c7..9d5232e 100644
--- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java
+++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java
@@ -48,7 +48,7 @@ public class TestOperationSetBasicInstantMessaging
super.setUp();
fixture.setUp();
- Map supportedOperationSets =
+ Map<String, OperationSet> supportedOperationSets =
fixture.provider.getSupportedOperationSets();
if ( supportedOperationSets == null
diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java
index 33082c0..12d465e 100644
--- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java
@@ -75,7 +75,7 @@ public class TestOperationSetPersistentPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets =
+ Map<String, OperationSet> supportedOperationSets =
fixture.provider.getSupportedOperationSets();
if ( supportedOperationSets == null
diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java
index 8551173..b6b2124 100644
--- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java
@@ -53,7 +53,7 @@ public class TestOperationSetPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets =
+ Map<String, OperationSet> supportedOperationSets =
fixture.provider.getSupportedOperationSets();
if ( supportedOperationSets == null
diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetServerStoredInfo.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetServerStoredInfo.java
index 47cdb60..d65f588 100644
--- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetServerStoredInfo.java
+++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetServerStoredInfo.java
@@ -47,7 +47,7 @@ public class TestOperationSetServerStoredInfo
super.setUp();
fixture.setUp();
- Map supportedOperationSets =
+ Map<String, OperationSet> supportedOperationSets =
fixture.provider.getSupportedOperationSets();
if ( supportedOperationSets == null
diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetTypingNotifications.java
index 7b386c4..2ad71d3 100644
--- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetTypingNotifications.java
+++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetTypingNotifications.java
@@ -42,7 +42,7 @@ public class TestOperationSetTypingNotifications
super.setUp();
fixture.setUp();
- Map supportedOperationSets =
+ Map<String, OperationSet> supportedOperationSets =
fixture.provider.getSupportedOperationSets();
if ( supportedOperationSets == null
diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestProtocolProviderServiceIcqImpl.java b/test/net/java/sip/communicator/slick/protocol/icq/TestProtocolProviderServiceIcqImpl.java
index dadcdc4..e56f2d7 100644
--- a/test/net/java/sip/communicator/slick/protocol/icq/TestProtocolProviderServiceIcqImpl.java
+++ b/test/net/java/sip/communicator/slick/protocol/icq/TestProtocolProviderServiceIcqImpl.java
@@ -146,11 +146,9 @@ public class TestProtocolProviderServiceIcqImpl extends TestCase
// Here is registered the listener which will receive the first message
// This message is supposed to be offline message and as one is tested
// in TestOperationSetBasicInstantMessaging.testReceiveOfflineMessages()
- Map supportedOperationSets =
- fixture.provider.getSupportedOperationSets();
OperationSetBasicInstantMessaging opSetBasicIM =
- (OperationSetBasicInstantMessaging)supportedOperationSets.get(
- OperationSetBasicInstantMessaging.class.getName());
+ (OperationSetBasicInstantMessaging) fixture.provider
+ .getOperationSet(OperationSetBasicInstantMessaging.class);
fixture.offlineMsgCollector.register(opSetBasicIM);
//give time for the AIM server to notify everyone of our arrival
@@ -236,24 +234,22 @@ public class TestProtocolProviderServiceIcqImpl extends TestCase
*/
public void testOperationSetTypes() throws Exception
{
- Map supportedOperationSets
- = fixture.provider.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets =
+ fixture.provider.getSupportedOperationSets();
- //make sure that keys (which are supposed to be class names) correspond
- //what the class of the values recorded against them.
- Iterator setNames = supportedOperationSets.keySet().iterator();
- while (setNames.hasNext())
+ // make sure that keys (which are supposed to be class names) correspond
+ // what the class of the values recorded against them.
+ for (Map.Entry<String, OperationSet> entry : supportedOperationSets
+ .entrySet())
{
- String setName = (String) setNames.next();
- Object opSet = supportedOperationSets.get(setName);
+ String setName = entry.getKey();
+ Object opSet = entry.getValue();
- assertTrue(opSet + " was not an instance of "
- + setName + " as declared"
- , Class.forName(setName).isInstance(opSet));
+ assertTrue(opSet + " was not an instance of " + setName
+ + " as declared", Class.forName(setName).isInstance(opSet));
}
}
-
/**
* A class that would plugin as a registration listener to a protocol
* provider and simply record all events that it sees and notify the
diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/JabberSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/jabber/JabberSlickFixture.java
index 86f78e9..ce63093 100644
--- a/test/net/java/sip/communicator/slick/protocol/jabber/JabberSlickFixture.java
+++ b/test/net/java/sip/communicator/slick/protocol/jabber/JabberSlickFixture.java
@@ -7,7 +7,6 @@
package net.java.sip.communicator.slick.protocol.jabber;
import java.util.*;
-import java.util.Map;
import org.osgi.framework.*;
@@ -229,7 +228,8 @@ public class JabberSlickFixture
public void clearProvidersLists()
throws Exception
{
- Map supportedOperationSets1 = provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets1 =
+ provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
|| supportedOperationSets1.size() < 1)
@@ -251,7 +251,8 @@ public class JabberSlickFixture
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 = provider2.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets2 =
+ provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
|| supportedOperationSets2.size() < 1)
diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicInstantMessaging.java
index 5dee6bb..9885443 100644
--- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicInstantMessaging.java
+++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicInstantMessaging.java
@@ -49,7 +49,7 @@ public class TestOperationSetBasicInstantMessaging
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -82,7 +82,7 @@ public class TestOperationSetBasicInstantMessaging
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java
index 4b0f7e2..cb7d7f3 100644
--- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java
+++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java
@@ -96,7 +96,7 @@ public class TestOperationSetMultiUserChat
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -129,7 +129,7 @@ public class TestOperationSetMultiUserChat
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPersistentPresence.java
index ad9e4c7..b11d3c9 100644
--- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPersistentPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPersistentPresence.java
@@ -70,7 +70,7 @@ public class TestOperationSetPersistentPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -93,8 +93,8 @@ public class TestOperationSetPersistentPresence
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 =
- fixture.provider2.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets2 =
+ fixture.provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
|| supportedOperationSets2.size() < 1)
diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPresence.java
index 9e956be..1ad8f03 100644
--- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPresence.java
@@ -55,7 +55,7 @@ public class TestOperationSetPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -80,7 +80,7 @@ public class TestOperationSetPresence
}
// do it once again for the second provider
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetTypingNotifications.java
index 5fcb502..c938cce 100644
--- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetTypingNotifications.java
+++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetTypingNotifications.java
@@ -44,7 +44,7 @@ public class TestOperationSetTypingNotifications
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -90,7 +90,7 @@ public class TestOperationSetTypingNotifications
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestProtocolProviderServiceJabberImpl.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestProtocolProviderServiceJabberImpl.java
index 4181b3e..a8b7e4b 100644
--- a/test/net/java/sip/communicator/slick/protocol/jabber/TestProtocolProviderServiceJabberImpl.java
+++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestProtocolProviderServiceJabberImpl.java
@@ -145,20 +145,19 @@ public class TestProtocolProviderServiceJabberImpl
*/
public void testOperationSetTypes() throws Exception
{
- Map supportedOperationSets
- = fixture.provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets =
+ fixture.provider1.getSupportedOperationSets();
- //make sure that keys (which are supposed to be class names) correspond
- //what the class of the values recorded against them.
- Iterator setNames = supportedOperationSets.keySet().iterator();
- while (setNames.hasNext())
+ // make sure that keys (which are supposed to be class names) correspond
+ // what the class of the values recorded against them.
+ for (Map.Entry<String, OperationSet> entry : supportedOperationSets
+ .entrySet())
{
- String setName = (String) setNames.next();
- Object opSet = supportedOperationSets.get(setName);
+ String setName = entry.getKey();
+ Object opSet = entry.getValue();
- assertTrue(opSet + " was not an instance of "
- + setName + " as declared"
- , Class.forName(setName).isInstance(opSet));
+ assertTrue(opSet + " was not an instance of " + setName
+ + " as declared", Class.forName(setName).isInstance(opSet));
}
}
diff --git a/test/net/java/sip/communicator/slick/protocol/msn/MsnSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/msn/MsnSlickFixture.java
index 330c1e2..fd00ebc 100644
--- a/test/net/java/sip/communicator/slick/protocol/msn/MsnSlickFixture.java
+++ b/test/net/java/sip/communicator/slick/protocol/msn/MsnSlickFixture.java
@@ -9,7 +9,7 @@ package net.java.sip.communicator.slick.protocol.msn;
import org.osgi.framework.*;
import junit.framework.*;
import net.java.sip.communicator.service.protocol.*;
-import java.util.Map;
+
import java.util.*;
/**
@@ -214,7 +214,8 @@ public class MsnSlickFixture
public void clearProvidersLists()
throws Exception
{
- Map supportedOperationSets1 = provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets1 =
+ provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
|| supportedOperationSets1.size() < 1)
@@ -236,7 +237,8 @@ public class MsnSlickFixture
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 = provider2.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets2 =
+ provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
|| supportedOperationSets2.size() < 1)
diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetBasicInstantMessaging.java
index b229d83..329badb 100644
--- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetBasicInstantMessaging.java
+++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetBasicInstantMessaging.java
@@ -49,7 +49,7 @@ public class TestOperationSetBasicInstantMessaging
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -82,7 +82,7 @@ public class TestOperationSetBasicInstantMessaging
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPersistentPresence.java
index 2e98202..18d26d7 100644
--- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPersistentPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPersistentPresence.java
@@ -70,7 +70,7 @@ public class TestOperationSetPersistentPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -93,8 +93,8 @@ public class TestOperationSetPersistentPresence
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 =
- fixture.provider2.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets2 =
+ fixture.provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
|| supportedOperationSets2.size() < 1)
diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java
index 7029857..00c5df9 100644
--- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java
@@ -49,7 +49,7 @@ public class TestOperationSetPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -74,7 +74,7 @@ public class TestOperationSetPresence
}
// do it once again for the second provider
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetTypingNotifications.java
index 27cde0d..4eb90e4 100644
--- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetTypingNotifications.java
+++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetTypingNotifications.java
@@ -44,7 +44,7 @@ public class TestOperationSetTypingNotifications
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -90,7 +90,7 @@ public class TestOperationSetTypingNotifications
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestProtocolProviderServiceMsnImpl.java b/test/net/java/sip/communicator/slick/protocol/msn/TestProtocolProviderServiceMsnImpl.java
index a4f0c0b..7eb3604 100644
--- a/test/net/java/sip/communicator/slick/protocol/msn/TestProtocolProviderServiceMsnImpl.java
+++ b/test/net/java/sip/communicator/slick/protocol/msn/TestProtocolProviderServiceMsnImpl.java
@@ -9,6 +9,7 @@ package net.java.sip.communicator.slick.protocol.msn;
import java.util.*;
import junit.framework.*;
+
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
@@ -145,20 +146,19 @@ public class TestProtocolProviderServiceMsnImpl
*/
public void testOperationSetTypes() throws Exception
{
- Map supportedOperationSets
- = fixture.provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets =
+ fixture.provider1.getSupportedOperationSets();
- //make sure that keys (which are supposed to be class names) correspond
- //what the class of the values recorded against them.
- Iterator setNames = supportedOperationSets.keySet().iterator();
- while (setNames.hasNext())
+ // make sure that keys (which are supposed to be class names) correspond
+ // what the class of the values recorded against them.
+ for (Map.Entry<String, OperationSet> entry : supportedOperationSets
+ .entrySet())
{
- String setName = (String) setNames.next();
- Object opSet = supportedOperationSets.get(setName);
+ String setName = entry.getKey();
+ Object opSet = entry.getValue();
- assertTrue(opSet + " was not an instance of "
- + setName + " as declared"
- , Class.forName(setName).isInstance(opSet));
+ assertTrue(opSet + " was not an instance of " + setName
+ + " as declared", Class.forName(setName).isInstance(opSet));
}
}
diff --git a/test/net/java/sip/communicator/slick/protocol/rss/TestProtocolProviderServiceRssImpl.java b/test/net/java/sip/communicator/slick/protocol/rss/TestProtocolProviderServiceRssImpl.java
index 503746f..2c97bdf 100755
--- a/test/net/java/sip/communicator/slick/protocol/rss/TestProtocolProviderServiceRssImpl.java
+++ b/test/net/java/sip/communicator/slick/protocol/rss/TestProtocolProviderServiceRssImpl.java
@@ -116,20 +116,21 @@ public class TestProtocolProviderServiceRssImpl
*/
public void testOperationsSets() throws ClassNotFoundException
{
- Map supportedOperationSets =
- fixture.provider.getSupportedOperationSets();
-
- //get the keys for the supported operation set. The keys are strings
- //corresponding to class names.
- Iterator setNames = supportedOperationSets.keySet().iterator();
- while (setNames.hasNext())
- {
- String key = (String) setNames.next();
- Object opSet = supportedOperationSets.get(key);
-
- assertTrue(opSet + " was not an instance of " + key +"as declared",
- Class.forName(key).isInstance(opSet));
- }
+ Map<String, OperationSet> supportedOperationSets =
+ fixture.provider.getSupportedOperationSets();
+
+ // get the keys for the supported operation set. The keys are strings
+ // corresponding to class names.
+ for (Map.Entry<String, OperationSet> entry : supportedOperationSets
+ .entrySet())
+ {
+ String key = entry.getKey();
+ Object opSet = entry.getValue();
+
+ assertTrue(
+ opSet + " was not an instance of " + key + "as declared", Class
+ .forName(key).isInstance(opSet));
+ }
}
/**
diff --git a/test/net/java/sip/communicator/slick/protocol/sip/SipSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/sip/SipSlickFixture.java
index 557e23e..bb3e692 100644
--- a/test/net/java/sip/communicator/slick/protocol/sip/SipSlickFixture.java
+++ b/test/net/java/sip/communicator/slick/protocol/sip/SipSlickFixture.java
@@ -218,7 +218,8 @@ public class SipSlickFixture
public void clearProvidersLists()
throws Exception
{
- Map supportedOperationSets1 = provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets1 =
+ provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
|| supportedOperationSets1.size() < 1)
@@ -240,7 +241,8 @@ public class SipSlickFixture
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 = provider2.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets2 =
+ provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
|| supportedOperationSets2.size() < 1)
diff --git a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicInstantMessaging.java
index eccdef5..5e93db1 100644
--- a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicInstantMessaging.java
+++ b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicInstantMessaging.java
@@ -49,7 +49,7 @@ public class TestOperationSetBasicInstantMessaging
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -82,7 +82,7 @@ public class TestOperationSetBasicInstantMessaging
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPersistentPresence.java
index 2dab9a7..eaae996 100644
--- a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPersistentPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPersistentPresence.java
@@ -73,7 +73,7 @@ public class TestOperationSetPersistentPresence
super.setUp();
this.fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
this.fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -96,7 +96,7 @@ public class TestOperationSetPersistentPresence
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
this.fixture.provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPresence.java
index 54216f3..bfd51c2 100644
--- a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPresence.java
@@ -49,7 +49,7 @@ public class TestOperationSetPresence
super.setUp();
this.fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
this.fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -74,7 +74,7 @@ public class TestOperationSetPresence
}
// do it once again for the second provider
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
this.fixture.provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/sip/TestProtocolProviderServiceSipImpl.java b/test/net/java/sip/communicator/slick/protocol/sip/TestProtocolProviderServiceSipImpl.java
index 044387a..091a484 100644
--- a/test/net/java/sip/communicator/slick/protocol/sip/TestProtocolProviderServiceSipImpl.java
+++ b/test/net/java/sip/communicator/slick/protocol/sip/TestProtocolProviderServiceSipImpl.java
@@ -145,20 +145,19 @@ public class TestProtocolProviderServiceSipImpl
*/
public void testOperationSetTypes() throws Exception
{
- Map supportedOperationSets
- = fixture.provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets =
+ fixture.provider1.getSupportedOperationSets();
- //make sure that keys (which are supposed to be class names) correspond
- //what the class of the values recorded against them.
- Iterator setNames = supportedOperationSets.keySet().iterator();
- while (setNames.hasNext())
+ // make sure that keys (which are supposed to be class names) correspond
+ // what the class of the values recorded against them.
+ for (Map.Entry<String, OperationSet> entry : supportedOperationSets
+ .entrySet())
{
- String setName = (String) setNames.next();
- Object opSet = supportedOperationSets.get(setName);
+ String setName = entry.getKey();
+ Object opSet = entry.getValue();
- assertTrue(opSet + " was not an instance of "
- + setName + " as declared"
- , Class.forName(setName).isInstance(opSet));
+ assertTrue(opSet + " was not an instance of " + setName
+ + " as declared", Class.forName(setName).isInstance(opSet));
}
}
diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java
index 3ab7398..cc25a0b 100644
--- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java
+++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java
@@ -49,7 +49,7 @@ public class TestOperationSetBasicInstantMessaging
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -82,7 +82,7 @@ public class TestOperationSetBasicInstantMessaging
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPersistentPresence.java
index 163272b..7fdf536 100644
--- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPersistentPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPersistentPresence.java
@@ -70,7 +70,7 @@ public class TestOperationSetPersistentPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -93,8 +93,8 @@ public class TestOperationSetPersistentPresence
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 =
- fixture.provider2.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets2 =
+ fixture.provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
|| supportedOperationSets2.size() < 1)
diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java
index c58b23e..14d3ecf 100644
--- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java
@@ -51,7 +51,7 @@ public class TestOperationSetPresence
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -76,7 +76,7 @@ public class TestOperationSetPresence
}
// do it once again for the second provider
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetTypingNotifications.java
index 790a253..b3116a4 100644
--- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetTypingNotifications.java
+++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetTypingNotifications.java
@@ -44,7 +44,7 @@ public class TestOperationSetTypingNotifications
super.setUp();
fixture.setUp();
- Map supportedOperationSets1 =
+ Map<String, OperationSet> supportedOperationSets1 =
fixture.provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
@@ -90,7 +90,7 @@ public class TestOperationSetTypingNotifications
+ "implementation of at least one of the PresenceOperationSets");
}
- Map supportedOperationSets2 =
+ Map<String, OperationSet> supportedOperationSets2 =
fixture.provider2.getSupportedOperationSets();
if ( supportedOperationSets2 == null
diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestProtocolProviderServiceYahooImpl.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestProtocolProviderServiceYahooImpl.java
index cc4daa3..e32f9cf 100644
--- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestProtocolProviderServiceYahooImpl.java
+++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestProtocolProviderServiceYahooImpl.java
@@ -145,20 +145,19 @@ public class TestProtocolProviderServiceYahooImpl
*/
public void testOperationSetTypes() throws Exception
{
- Map supportedOperationSets
- = fixture.provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets =
+ fixture.provider1.getSupportedOperationSets();
- //make sure that keys (which are supposed to be class names) correspond
- //what the class of the values recorded against them.
- Iterator setNames = supportedOperationSets.keySet().iterator();
- while (setNames.hasNext())
+ // make sure that keys (which are supposed to be class names) correspond
+ // what the class of the values recorded against them.
+ for (Map.Entry<String, OperationSet> entry : supportedOperationSets
+ .entrySet())
{
- String setName = (String) setNames.next();
- Object opSet = supportedOperationSets.get(setName);
+ String setName = entry.getKey();
+ Object opSet = entry.getValue();
- assertTrue(opSet + " was not an instance of "
- + setName + " as declared"
- , Class.forName(setName).isInstance(opSet));
+ assertTrue(opSet + " was not an instance of " + setName
+ + " as declared", Class.forName(setName).isInstance(opSet));
}
}
diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/YahooSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/yahoo/YahooSlickFixture.java
index 75d9e0c..33371ed 100644
--- a/test/net/java/sip/communicator/slick/protocol/yahoo/YahooSlickFixture.java
+++ b/test/net/java/sip/communicator/slick/protocol/yahoo/YahooSlickFixture.java
@@ -9,7 +9,7 @@ package net.java.sip.communicator.slick.protocol.yahoo;
import org.osgi.framework.*;
import junit.framework.*;
import net.java.sip.communicator.service.protocol.*;
-import java.util.Map;
+
import java.util.*;
/**
@@ -214,7 +214,8 @@ public class YahooSlickFixture
public void clearProvidersLists()
throws Exception
{
- Map supportedOperationSets1 = provider1.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets1 =
+ provider1.getSupportedOperationSets();
if ( supportedOperationSets1 == null
|| supportedOperationSets1.size() < 1)
@@ -236,7 +237,8 @@ public class YahooSlickFixture
+ "Operation Sets");
// lets do it once again for the second provider
- Map supportedOperationSets2 = provider2.getSupportedOperationSets();
+ Map<String, OperationSet> supportedOperationSets2 =
+ provider2.getSupportedOperationSets();
if (supportedOperationSets2 == null
|| supportedOperationSets2.size() < 1)