]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.core/src/org/argeo/jackrabbit/client/NonSerialBasicAuthCache.java
Merge remote-tracking branch 'origin/master' into v2.x
[lgpl/argeo-commons.git] / org.argeo.core / src / org / argeo / jackrabbit / client / NonSerialBasicAuthCache.java
1 package org.argeo.jackrabbit.client;
2
3 import java.util.Map;
4 import java.util.concurrent.ConcurrentHashMap;
5
6 import org.apache.http.HttpHost;
7 import org.apache.http.auth.AuthScheme;
8 import org.apache.http.client.AuthCache;
9
10 /**
11 * Implementation of {@link AuthCache} which doesn't use serialization, as it is
12 * not supported by GraalVM at this stage.
13 */
14 public class NonSerialBasicAuthCache implements AuthCache {
15 private final Map<HttpHost, AuthScheme> cache;
16
17 public NonSerialBasicAuthCache() {
18 cache = new ConcurrentHashMap<HttpHost, AuthScheme>();
19 }
20
21 @Override
22 public void put(HttpHost host, AuthScheme authScheme) {
23 cache.put(host, authScheme);
24 }
25
26 @Override
27 public AuthScheme get(HttpHost host) {
28 return cache.get(host);
29 }
30
31 @Override
32 public void remove(HttpHost host) {
33 cache.remove(host);
34 }
35
36 @Override
37 public void clear() {
38 cache.clear();
39 }
40
41 }