@Override public Session createEmptySession() { return new RedissonSession(this, readMode, updateMode); }
@Override public void access() { super.access(); if (map != null) { Map<String, Object> newMap = new HashMap<String, Object>(2); newMap.put(LAST_ACCESSED_TIME_ATTR, lastAccessedTime); newMap.put(THIS_ACCESSED_TIME_ATTR, thisAccessedTime); map.putAll(newMap); if (readMode == ReadMode.MEMORY) { topic.publish(createPutAllMessage(newMap)); } expireSession(); } }
@Override public void remove(Session session) { super.remove(session); if (session.getIdInternal() != null) { ((RedissonSession)session).delete(); } }
@Override public void setMaxInactiveInterval(int interval) { super.setMaxInactiveInterval(interval); if (map != null) { fastPut(MAX_INACTIVE_INTERVAL_ATTR, maxInactiveInterval); expireSession(); } }
session.setId(id); session.setManager(this); session.load(attrs); session.access(); session.endAccess(); return session;
protected AttributesPutAllMessage createPutAllMessage(Map<String, Object> newMap) { Map<String, Object> map = new HashMap<String, Object>(); for (Entry<String, Object> entry : newMap.entrySet()) { map.put(entry.getKey(), entry.getValue()); } try { return new AttributesPutAllMessage(redissonManager.getNodeId(), getId(), map); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public void setNew(boolean isNew) { super.setNew(isNew); if (map != null) { fastPut(IS_NEW_ATTR, isNew); } }
@Override public String[] getValueNames() { if (readMode == ReadMode.REDIS) { if (!isValidInternal()) { throw new IllegalStateException (sm.getString("standardSession.getAttributeNames.ise")); } Set<String> keys = map.readAllKeySet(); return keys.toArray(new String[keys.size()]); } return super.getValueNames(); }
@Override public void setCreationTime(long time) { super.setCreationTime(time); if (map != null) { Map<String, Object> newMap = new HashMap<String, Object>(3); newMap.put(CREATION_TIME_ATTR, creationTime); newMap.put(LAST_ACCESSED_TIME_ATTR, lastAccessedTime); newMap.put(THIS_ACCESSED_TIME_ATTR, thisAccessedTime); map.putAll(newMap); if (readMode == ReadMode.MEMORY) { topic.publish(createPutAllMessage(newMap)); } } }
session.setId(id); session.setManager(this); session.load(attrs); session.access(); session.endAccess(); return session;
@Override public void setMaxInactiveInterval(int interval) { super.setMaxInactiveInterval(interval); if (map != null) { fastPut(MAX_INACTIVE_INTERVAL_ATTR, maxInactiveInterval); expireSession(); } }
protected AttributesPutAllMessage createPutAllMessage(Map<String, Object> newMap) { Map<String, Object> map = new HashMap<String, Object>(); for (Entry<String, Object> entry : newMap.entrySet()) { map.put(entry.getKey(), entry.getValue()); } try { return new AttributesPutAllMessage(redissonManager.getNodeId(), getId(), map); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public void endAccess() { boolean oldValue = isNew; super.endAccess(); if (isNew != oldValue && map != null) { fastPut(IS_NEW_ATTR, isNew); } }
@Override public String[] getValueNames() { if (readMode == ReadMode.REDIS) { if (!isValidInternal()) { throw new IllegalStateException (sm.getString("standardSession.getAttributeNames.ise")); } Set<String> keys = map.readAllKeySet(); return keys.toArray(new String[keys.size()]); } return super.getValueNames(); }
@Override public void setCreationTime(long time) { super.setCreationTime(time); if (map != null) { Map<String, Object> newMap = new HashMap<String, Object>(3); newMap.put(CREATION_TIME_ATTR, creationTime); newMap.put(LAST_ACCESSED_TIME_ATTR, lastAccessedTime); newMap.put(THIS_ACCESSED_TIME_ATTR, thisAccessedTime); map.putAll(newMap); if (readMode == ReadMode.MEMORY) { topic.publish(createPutAllMessage(newMap)); } } }
session.setId(id); session.setManager(this); session.load(attrs); session.access(); session.endAccess(); return session;
@Override public void access() { super.access(); if (map != null) { Map<String, Object> newMap = new HashMap<String, Object>(2); newMap.put(LAST_ACCESSED_TIME_ATTR, lastAccessedTime); newMap.put(THIS_ACCESSED_TIME_ATTR, thisAccessedTime); map.putAll(newMap); if (readMode == ReadMode.MEMORY) { topic.publish(createPutAllMessage(newMap)); } expireSession(); } }
@Override public void setMaxInactiveInterval(int interval) { super.setMaxInactiveInterval(interval); if (map != null) { fastPut(MAX_INACTIVE_INTERVAL_ATTR, maxInactiveInterval); expireSession(); } }
protected AttributesPutAllMessage createPutAllMessage(Map<String, Object> newMap) { Map<String, Object> map = new HashMap<String, Object>(); for (Entry<String, Object> entry : newMap.entrySet()) { map.put(entry.getKey(), entry.getValue()); } try { return new AttributesPutAllMessage(redissonManager.getNodeId(), getId(), map); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public void setNew(boolean isNew) { super.setNew(isNew); if (map != null) { fastPut(IS_NEW_ATTR, isNew); } }