sun.security.krb5.internal.KrbApErrException Java Examples

The following examples show how to use sun.security.krb5.internal.KrbApErrException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DflCache.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #2
Source File: DflCache.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #3
Source File: MemoryCache.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    AuthList rc = content.get(key);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    if (rc == null) {
        rc = new AuthList(lifespan);
        rc.put(time, currTime);
        if (!rc.isEmpty()) {
            content.put(key, rc);
        }
    } else {
        if (DEBUG) {
            System.out.println("MemoryCache: Existing AuthList:\n" + rc);
        }
        rc.put(time, currTime);
        if (rc.isEmpty()) {
            content.remove(key);
        }
    }
}
 
Example #4
Source File: MemoryCache.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    AuthList rc = content.get(key);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    if (rc == null) {
        rc = new AuthList(lifespan);
        rc.put(time, currTime);
        if (!rc.isEmpty()) {
            content.put(key, rc);
        }
    } else {
        if (DEBUG) {
            System.out.println("MemoryCache: Existing AuthList:\n" + rc);
        }
        rc.put(time, currTime);
        if (rc.isEmpty()) {
            content.remove(key);
        }
    }
}
 
Example #5
Source File: DflCache.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #6
Source File: DflCache.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #7
Source File: MemoryCache.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    AuthList rc = content.get(key);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    if (rc == null) {
        rc = new AuthList(lifespan);
        rc.put(time, currTime);
        if (!rc.isEmpty()) {
            content.put(key, rc);
        }
    } else {
        if (DEBUG) {
            System.out.println("MemoryCache: Existing AuthList:\n" + rc);
        }
        rc.put(time, currTime);
        if (rc.isEmpty()) {
            content.remove(key);
        }
    }
}
 
Example #8
Source File: MemoryCache.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    AuthList rc = content.get(key);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    if (rc == null) {
        rc = new AuthList(lifespan);
        rc.put(time, currTime);
        if (!rc.isEmpty()) {
            content.put(key, rc);
        }
    } else {
        if (DEBUG) {
            System.out.println("MemoryCache: Existing AuthList:\n" + rc);
        }
        rc.put(time, currTime);
        if (rc.isEmpty()) {
            content.remove(key);
        }
    }
}
 
Example #9
Source File: DflCache.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #10
Source File: MemoryCache.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    AuthList rc = content.get(key);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    if (rc == null) {
        rc = new AuthList(lifespan);
        rc.put(time, currTime);
        if (!rc.isEmpty()) {
            content.put(key, rc);
        }
    } else {
        if (DEBUG) {
            System.out.println("MemoryCache: Existing AuthList:\n" + rc);
        }
        rc.put(time, currTime);
        if (rc.isEmpty()) {
            content.remove(key);
        }
    }
}
 
Example #11
Source File: DflCache.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #12
Source File: DflCache.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #13
Source File: MemoryCache.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    AuthList rc = content.get(key);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    if (rc == null) {
        rc = new AuthList(lifespan);
        rc.put(time, currTime);
        if (!rc.isEmpty()) {
            content.put(key, rc);
        }
    } else {
        if (DEBUG) {
            System.out.println("MemoryCache: Existing AuthList:\n" + rc);
        }
        rc.put(time, currTime);
        if (rc.isEmpty()) {
            content.remove(key);
        }
    }
}
 
Example #14
Source File: DflCache.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #15
Source File: DflCache.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #16
Source File: MemoryCache.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    AuthList rc = content.get(key);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    if (rc == null) {
        rc = new AuthList(lifespan);
        rc.put(time, currTime);
        if (!rc.isEmpty()) {
            content.put(key, rc);
        }
    } else {
        if (DEBUG) {
            System.out.println("MemoryCache: Existing AuthList:\n" + rc);
        }
        rc.put(time, currTime);
        if (rc.isEmpty()) {
            content.remove(key);
        }
    }
}
 
Example #17
Source File: DflCache.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #18
Source File: DflCache.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #19
Source File: MemoryCache.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    AuthList rc = content.get(key);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    if (rc == null) {
        rc = new AuthList(lifespan);
        rc.put(time, currTime);
        if (!rc.isEmpty()) {
            content.put(key, rc);
        }
    } else {
        if (DEBUG) {
            System.out.println("MemoryCache: Existing AuthList:\n" + rc);
        }
        rc.put(time, currTime);
        if (rc.isEmpty()) {
            content.remove(key);
        }
    }
}
 
Example #20
Source File: DflCache.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #21
Source File: MemoryCache.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    AuthList rc = content.get(key);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    if (rc == null) {
        rc = new AuthList(lifespan);
        rc.put(time, currTime);
        if (!rc.isEmpty()) {
            content.put(key, rc);
        }
    } else {
        if (DEBUG) {
            System.out.println("MemoryCache: Existing AuthList:\n" + rc);
        }
        rc.put(time, currTime);
        if (rc.isEmpty()) {
            content.remove(key);
        }
    }
}
 
Example #22
Source File: DflCache.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        throws IOException, KrbApErrException {
    Path p = getFileName(source, time.server);
    int missed = 0;
    try (Storage s = new Storage()) {
        try {
            missed = s.loadAndCheck(p, time, currTime);
        } catch (IOException ioe) {
            // Non-existing or invalid file
            Storage.create(p);
            missed = s.loadAndCheck(p, time, currTime);
        }
        s.append(time);
    }
    if (missed > EXCESSREPS) {
        Storage.expunge(p, currTime);
    }
}
 
Example #23
Source File: MemoryCache.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    content.computeIfAbsent(key, k -> new AuthList(lifespan))
            .put(time, currTime);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    // TODO: clean up AuthList entries with only expired AuthTimeWithHash objects.
}
 
Example #24
Source File: DflCache.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    try {
        checkAndStore0(currTime, time);
    } catch (IOException ioe) {
        KrbApErrException ke = new KrbApErrException(Krb5.KRB_ERR_GENERIC);
        ke.initCause(ioe);
        throw ke;
    }
}
 
Example #25
Source File: DflCache.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    try {
        checkAndStore0(currTime, time);
    } catch (IOException ioe) {
        KrbApErrException ke = new KrbApErrException(Krb5.KRB_ERR_GENERIC);
        ke.initCause(ioe);
        throw ke;
    }
}
 
Example #26
Source File: DflCache.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    try {
        checkAndStore0(currTime, time);
    } catch (IOException ioe) {
        KrbApErrException ke = new KrbApErrException(Krb5.KRB_ERR_GENERIC);
        ke.initCause(ioe);
        throw ke;
    }
}
 
Example #27
Source File: DflCache.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    try {
        checkAndStore0(currTime, time);
    } catch (IOException ioe) {
        KrbApErrException ke = new KrbApErrException(Krb5.KRB_ERR_GENERIC);
        ke.initCause(ioe);
        throw ke;
    }
}
 
Example #28
Source File: DflCache.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    try {
        checkAndStore0(currTime, time);
    } catch (IOException ioe) {
        KrbApErrException ke = new KrbApErrException(Krb5.KRB_ERR_GENERIC);
        ke.initCause(ioe);
        throw ke;
    }
}
 
Example #29
Source File: DflCache.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    try {
        checkAndStore0(currTime, time);
    } catch (IOException ioe) {
        KrbApErrException ke = new KrbApErrException(Krb5.KRB_ERR_GENERIC);
        ke.initCause(ioe);
        throw ke;
    }
}
 
Example #30
Source File: MemoryCache.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException {
    String key = time.client + "|" + time.server;
    content.computeIfAbsent(key, k -> new AuthList(lifespan))
            .put(time, currTime);
    if (DEBUG) {
        System.out.println("MemoryCache: add " + time + " to " + key);
    }
    // TODO: clean up AuthList entries with only expired AuthTimeWithHash objects.
}