mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 01:29:38 +02:00
1. Clean up code
2. Refactoring work 3. Optimization work. SMACK-153 4. Fixed roster test cases. SMACK-154 4. Fixed vCard issue. SMACK-152 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@4538 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
14b50d790a
commit
f57ff10ad9
77 changed files with 995 additions and 932 deletions
|
@ -59,11 +59,11 @@ import java.util.*;
|
|||
*/
|
||||
public class SASLAuthentication implements UserAuthentication {
|
||||
|
||||
private static Map implementedMechanisms = new HashMap();
|
||||
private static List mechanismsPreferences = new ArrayList();
|
||||
private static Map<String, Class> implementedMechanisms = new HashMap<String, Class>();
|
||||
private static List<String> mechanismsPreferences = new ArrayList<String>();
|
||||
|
||||
private XMPPConnection connection;
|
||||
private Collection serverMechanisms = new ArrayList();
|
||||
private Collection<String> serverMechanisms = new ArrayList<String>();
|
||||
private SASLMechanism currentMechanism = null;
|
||||
/**
|
||||
* Boolean indicating if SASL negotiation has finished and was successful.
|
||||
|
@ -115,10 +115,10 @@ public class SASLAuthentication implements UserAuthentication {
|
|||
*
|
||||
* @return the registerd SASLMechanism classes sorted by the level of preference.
|
||||
*/
|
||||
public static List getRegisterSASLMechanisms() {
|
||||
List answer = new ArrayList();
|
||||
for (Iterator it = mechanismsPreferences.iterator(); it.hasNext();) {
|
||||
answer.add(implementedMechanisms.get(it.next()));
|
||||
public static List<Class> getRegisterSASLMechanisms() {
|
||||
List<Class> answer = new ArrayList<Class>();
|
||||
for (String mechanismsPreference : mechanismsPreferences) {
|
||||
answer.add(implementedMechanisms.get(mechanismsPreference));
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
@ -171,11 +171,10 @@ public class SASLAuthentication implements UserAuthentication {
|
|||
throws XMPPException {
|
||||
// Locate the SASLMechanism to use
|
||||
Class selected = null;
|
||||
for (Iterator it = mechanismsPreferences.iterator(); it.hasNext();) {
|
||||
String mechanism = (String) it.next();
|
||||
for (String mechanism : mechanismsPreferences) {
|
||||
if (implementedMechanisms.containsKey(mechanism) &&
|
||||
serverMechanisms.contains(mechanism)) {
|
||||
selected = (Class) implementedMechanisms.get(mechanism);
|
||||
selected = implementedMechanisms.get(mechanism);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -339,7 +338,7 @@ public class SASLAuthentication implements UserAuthentication {
|
|||
* @param mechanisms collection of strings with the available SASL mechanism reported
|
||||
* by the server.
|
||||
*/
|
||||
void setAvailableSASLMethods(Collection mechanisms) {
|
||||
void setAvailableSASLMethods(Collection<String> mechanisms) {
|
||||
this.serverMechanisms = mechanisms;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue