Search in sources :

Example 1 with WebSessionAttributeProcessor

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);
    }
}
Also used : CacheException(javax.cache.CacheException) IgniteException(org.apache.ignite.IgniteException) WebSessionAttributeProcessor(org.apache.ignite.internal.websession.WebSessionAttributeProcessor) ServletException(javax.servlet.ServletException) ClusterTopologyException(org.apache.ignite.cluster.ClusterTopologyException) CacheException(javax.cache.CacheException) IgniteClientDisconnectedException(org.apache.ignite.IgniteClientDisconnectedException) IgniteException(org.apache.ignite.IgniteException) IOException(java.io.IOException) WebSessionEntity(org.apache.ignite.internal.websession.WebSessionEntity)

Aggregations

IOException (java.io.IOException)1 CacheException (javax.cache.CacheException)1 ServletException (javax.servlet.ServletException)1 IgniteClientDisconnectedException (org.apache.ignite.IgniteClientDisconnectedException)1 IgniteException (org.apache.ignite.IgniteException)1 ClusterTopologyException (org.apache.ignite.cluster.ClusterTopologyException)1 WebSessionAttributeProcessor (org.apache.ignite.internal.websession.WebSessionAttributeProcessor)1 WebSessionEntity (org.apache.ignite.internal.websession.WebSessionEntity)1