use of org.wildfly.clustering.web.cache.sso.coarse.SessionFilter in project wildfly by wildfly.
the class CoarseSessionsFactory method findEntryContaining.
@Override
public Map.Entry<String, Map<D, S>> findEntryContaining(S session) {
SessionFilter<CoarseSessionsKey, D, S> filter = new SessionFilter<>(session);
// Erase type to handle compilation issues with generics
// Our filter will handle type safety and casting
@SuppressWarnings("rawtypes") Cache cache = this.cache;
try (Stream<Map.Entry<?, ?>> stream = cache.entrySet().stream()) {
Map.Entry<CoarseSessionsKey, Map<D, S>> entry = stream.filter(this.filter).map(this.filter).filter(filter).findAny().orElse(null);
return (entry != null) ? new AbstractMap.SimpleImmutableEntry<>(entry.getKey().getId(), entry.getValue()) : null;
}
}
use of org.wildfly.clustering.web.cache.sso.coarse.SessionFilter in project wildfly by wildfly.
the class CoarseSessionsFactory method findEntryContaining.
@Override
public Map.Entry<String, Map<D, S>> findEntryContaining(S session) {
SessionFilter<CoarseSessionsKey, D, S> filter = new SessionFilter<>(session);
// Erase type to handle compilation issues with generics
// Our filter will handle type safety and casting
@SuppressWarnings("rawtypes") RemoteCache cache = this.cache;
try (Stream<Map.Entry<?, ?>> stream = cache.entrySet().stream()) {
Map.Entry<CoarseSessionsKey, Map<D, S>> entry = stream.filter(this.filter).map(this.filter).filter(filter).findAny().orElse(null);
return (entry != null) ? new AbstractMap.SimpleImmutableEntry<>(entry.getKey().getId(), entry.getValue()) : null;
}
}
Aggregations