use of org.apache.ignite.internal.websession.WebSessionAttributeProcessor in project ignite by apache.
the class WebSessionFilter method updateAttributesV2.
/**
* @param sesId Session ID.
* @param ses Web session.
*/
public void updateAttributesV2(final String sesId, final WebSessionV2 ses) throws IOException {
assert sesId != null;
assert ses != null;
final Map<String, byte[]> updatesMap = ses.binaryUpdatesMap();
if (log.isDebugEnabled())
log.debug("Session binary attributes updated [id=" + sesId + ", updates=" + updatesMap.keySet() + ']');
try {
for (int i = 0; i < retries; i++) {
try {
final IgniteCache<String, WebSessionEntity> cache0 = cacheWithExpiryPolicy(ses.getMaxInactiveInterval(), binaryCache);
cache0.invoke(sesId, new WebSessionAttributeProcessor(updatesMap.isEmpty() ? null : updatesMap, ses.getLastAccessedTime(), ses.getMaxInactiveInterval(), ses.isMaxInactiveIntervalChanged()));
break;
} catch (CacheException | IgniteException | IllegalStateException e) {
handleAttributeUpdateException(sesId, i, e);
}
}
} catch (Exception e) {
U.error(log, "Failed to update session V2 attributes [id=" + sesId + ']', e);
}
}
Aggregations