geronimo-mail_2.1/geronimo-mail_2.1_provider/src/main/java/org/apache/geronimo/mail/authentication/SASLAuthenticator.java [125:171]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void handle(Callback[] callBacks) {
        for (int i = 0; i < callBacks.length; i++) {
            Callback callBack = callBacks[i]; 
            // requesting the user name 
            if (callBack instanceof NameCallback) {
                ((NameCallback)callBack).setName(username); 
            }
            // need the password 
            else if (callBack instanceof PasswordCallback) {
                ((PasswordCallback)callBack).setPassword(password.toCharArray()); 
            }
            // direct request for the realm information 
            else if (callBack instanceof RealmCallback) {
                RealmCallback realmCallback = (RealmCallback)callBack; 
                // we might not have a realm, so use the default from the 
                // callback item 
                if (realm == null) {
                    realmCallback.setText(realmCallback.getDefaultText()); 
                }
                else { 
                    realmCallback.setText(realm); 
                }
            }
            // asked to select the realm information from a list 
            else if (callBack instanceof RealmChoiceCallback) {
                RealmChoiceCallback realmCallback = (RealmChoiceCallback)callBack; 
                // if we don't have a realm, just tell it to use the default 
                if (realm == null) {
                    realmCallback.setSelectedIndex(realmCallback.getDefaultChoice()); 
                }
                else {
                    // locate our configured one in the list 
                    String[] choices = realmCallback.getChoices(); 

                    for (int j = 0; j < choices.length; j++) {
                        // set the index to any match and get out of here. 
                        if (choices[j].equals(realm)) {
                            realmCallback.setSelectedIndex(j); 
                            break; 
                        }
                    }
                    // NB:  If there was no match, we don't set anything.  
                    // this should cause an authentication failure. 
                }
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/authentication/SASLAuthenticator.java [126:172]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void handle(Callback[] callBacks) {
        for (int i = 0; i < callBacks.length; i++) {
            Callback callBack = callBacks[i]; 
            // requesting the user name 
            if (callBack instanceof NameCallback) {
                ((NameCallback)callBack).setName(username); 
            }
            // need the password 
            else if (callBack instanceof PasswordCallback) {
                ((PasswordCallback)callBack).setPassword(password.toCharArray()); 
            }
            // direct request for the realm information 
            else if (callBack instanceof RealmCallback) {
                RealmCallback realmCallback = (RealmCallback)callBack; 
                // we might not have a realm, so use the default from the 
                // callback item 
                if (realm == null) {
                    realmCallback.setText(realmCallback.getDefaultText()); 
                }
                else { 
                    realmCallback.setText(realm); 
                }
            }
            // asked to select the realm information from a list 
            else if (callBack instanceof RealmChoiceCallback) {
                RealmChoiceCallback realmCallback = (RealmChoiceCallback)callBack; 
                // if we don't have a realm, just tell it to use the default 
                if (realm == null) {
                    realmCallback.setSelectedIndex(realmCallback.getDefaultChoice()); 
                }
                else {
                    // locate our configured one in the list 
                    String[] choices = realmCallback.getChoices(); 

                    for (int j = 0; j < choices.length; j++) {
                        // set the index to any match and get out of here. 
                        if (choices[j].equals(realm)) {
                            realmCallback.setSelectedIndex(j); 
                            break; 
                        }
                    }
                    // NB:  If there was no match, we don't set anything.  
                    // this should cause an authentication failure. 
                }
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.5/geronimo-javamail_1.5_provider/src/main/java/org/apache/geronimo/javamail/authentication/SASLAuthenticator.java [126:172]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void handle(Callback[] callBacks) {
        for (int i = 0; i < callBacks.length; i++) {
            Callback callBack = callBacks[i]; 
            // requesting the user name 
            if (callBack instanceof NameCallback) {
                ((NameCallback)callBack).setName(username); 
            }
            // need the password 
            else if (callBack instanceof PasswordCallback) {
                ((PasswordCallback)callBack).setPassword(password.toCharArray()); 
            }
            // direct request for the realm information 
            else if (callBack instanceof RealmCallback) {
                RealmCallback realmCallback = (RealmCallback)callBack; 
                // we might not have a realm, so use the default from the 
                // callback item 
                if (realm == null) {
                    realmCallback.setText(realmCallback.getDefaultText()); 
                }
                else { 
                    realmCallback.setText(realm); 
                }
            }
            // asked to select the realm information from a list 
            else if (callBack instanceof RealmChoiceCallback) {
                RealmChoiceCallback realmCallback = (RealmChoiceCallback)callBack; 
                // if we don't have a realm, just tell it to use the default 
                if (realm == null) {
                    realmCallback.setSelectedIndex(realmCallback.getDefaultChoice()); 
                }
                else {
                    // locate our configured one in the list 
                    String[] choices = realmCallback.getChoices(); 

                    for (int j = 0; j < choices.length; j++) {
                        // set the index to any match and get out of here. 
                        if (choices[j].equals(realm)) {
                            realmCallback.setSelectedIndex(j); 
                            break; 
                        }
                    }
                    // NB:  If there was no match, we don't set anything.  
                    // this should cause an authentication failure. 
                }
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.6/geronimo-javamail_1.6_provider/src/main/java/org/apache/geronimo/javamail/authentication/SASLAuthenticator.java [126:172]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void handle(Callback[] callBacks) {
        for (int i = 0; i < callBacks.length; i++) {
            Callback callBack = callBacks[i]; 
            // requesting the user name 
            if (callBack instanceof NameCallback) {
                ((NameCallback)callBack).setName(username); 
            }
            // need the password 
            else if (callBack instanceof PasswordCallback) {
                ((PasswordCallback)callBack).setPassword(password.toCharArray()); 
            }
            // direct request for the realm information 
            else if (callBack instanceof RealmCallback) {
                RealmCallback realmCallback = (RealmCallback)callBack; 
                // we might not have a realm, so use the default from the 
                // callback item 
                if (realm == null) {
                    realmCallback.setText(realmCallback.getDefaultText()); 
                }
                else { 
                    realmCallback.setText(realm); 
                }
            }
            // asked to select the realm information from a list 
            else if (callBack instanceof RealmChoiceCallback) {
                RealmChoiceCallback realmCallback = (RealmChoiceCallback)callBack; 
                // if we don't have a realm, just tell it to use the default 
                if (realm == null) {
                    realmCallback.setSelectedIndex(realmCallback.getDefaultChoice()); 
                }
                else {
                    // locate our configured one in the list 
                    String[] choices = realmCallback.getChoices(); 

                    for (int j = 0; j < choices.length; j++) {
                        // set the index to any match and get out of here. 
                        if (choices[j].equals(realm)) {
                            realmCallback.setSelectedIndex(j); 
                            break; 
                        }
                    }
                    // NB:  If there was no match, we don't set anything.  
                    // this should cause an authentication failure. 
                }
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



