View | Details | Raw Unified | Return to bug 61313
Collapse All | Expand All

(-)a/java/org/apache/catalina/realm/JNDIRealm.java (-1 / +38 lines)
Lines 425-430 public class JNDIRealm extends RealmBase { Link Here
425
    protected String connectionTimeout = "5000";
425
    protected String connectionTimeout = "5000";
426
426
427
    /**
427
    /**
428
     * The timeout, in milliseconds, to use when trying to read from a connection
429
     * to the directory. The default is 5000 (5 seconds).
430
     */
431
    protected String readTimeout = "5000";
432
433
    /**
428
     * The sizeLimit (also known as the countLimit) to use when the realm is
434
     * The sizeLimit (also known as the countLimit) to use when the realm is
429
     * configured with {@link #userSearch}. Zero for no limit.
435
     * configured with {@link #userSearch}. Zero for no limit.
430
     */
436
     */
Lines 1045-1050 public class JNDIRealm extends RealmBase { Link Here
1045
1051
1046
    }
1052
    }
1047
1053
1054
    /**
1055
     * @return the read timeout.
1056
     */
1057
    public String getReadTimeout() {
1058
1059
        return readTimeout;
1060
1061
    }
1062
1063
1064
    /**
1065
     * Set the read timeout.
1066
     *
1067
     * @param timeout The new read timeout
1068
     */
1069
    public void setReadTimeout(String timeout) {
1070
1071
        this.readTimeout = timeout;
1072
1073
    }
1074
1048
1075
1049
    public long getSizeLimit() {
1076
    public long getSizeLimit() {
1050
        return sizeLimit;
1077
        return sizeLimit;
Lines 1347-1353 public class JNDIRealm extends RealmBase { Link Here
1347
                 curUserPattern < userPatternFormatArray.length;
1374
                 curUserPattern < userPatternFormatArray.length;
1348
                 curUserPattern++) {
1375
                 curUserPattern++) {
1349
                // Retrieve user information
1376
                // Retrieve user information
1350
                User user = getUser(context, username, credentials, curUserPattern);
1377
                User user;
1378
                try { // TODO: pm: test code here
1379
                    user = getUser(context, username, credentials, curUserPattern);
1380
                } catch(NamingException e) {
1381
                    containerLog.error(sm.getString("jndiRealm.exception"), e);
1382
                    close(context);
1383
                    context = open();
1384
                    user = getUser(context, username, credentials, curUserPattern);
1385
                }
1351
                if (user != null) {
1386
                if (user != null) {
1352
                    try {
1387
                    try {
1353
                        // Check the user's credentials
1388
                        // Check the user's credentials
Lines 2526-2531 public class JNDIRealm extends RealmBase { Link Here
2526
            env.put(JNDIRealm.DEREF_ALIASES, derefAliases);
2561
            env.put(JNDIRealm.DEREF_ALIASES, derefAliases);
2527
        if (connectionTimeout != null)
2562
        if (connectionTimeout != null)
2528
            env.put("com.sun.jndi.ldap.connect.timeout", connectionTimeout);
2563
            env.put("com.sun.jndi.ldap.connect.timeout", connectionTimeout);
2564
        if (readTimeout != null)
2565
            env.put("com.sun.jndi.ldap.read.timeout", readTimeout);
2529
2566
2530
        return env;
2567
        return env;
2531
2568

Return to bug 61313