Skip to content

Commit

Permalink
Issue #2198 - sort members
Browse files Browse the repository at this point in the history
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
  • Loading branch information
JohnTimm committed Apr 17, 2021
1 parent b8d04f5 commit 290fa13
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ public final class FHIRCacheManager {

private FHIRCacheManager() { }

private static TenantIdProvider getTenantIdProvider() {
for (TenantIdProvider provider : ServiceLoader.load(TenantIdProvider.class)) {
return provider;
}
return TenantIdProvider.DEFAULT;
public Set<String> getCacheNames() {
String tenantId = TENANT_ID_PROVIDER.getTenantId();
return TENANT_CACHE_MAPS.getOrDefault(tenantId, Collections.emptyMap()).keySet();
}

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -62,11 +60,6 @@ public static <K, V> Map<K, V> getCacheAsMap(String cacheName, Configuration con
return cache.asMap();
}

public Set<String> getCacheNames() {
String tenantId = TENANT_ID_PROVIDER.getTenantId();
return TENANT_CACHE_MAPS.getOrDefault(tenantId, Collections.emptyMap()).keySet();
}

public static CacheStats getCacheStats(String cacheName) {
Cache<?, ?> cache = getCache(cacheName);
return (cache != null) ? cache.stats() : null;
Expand Down Expand Up @@ -123,4 +116,11 @@ private static <K, V> Cache<K, V> createCache(Configuration configuration) {
.recordStats()
.build();
}

private static TenantIdProvider getTenantIdProvider() {
for (TenantIdProvider provider : ServiceLoader.load(TenantIdProvider.class)) {
return provider;
}
return TenantIdProvider.DEFAULT;
}
}

0 comments on commit 290fa13

Please sign in to comment.