Examples of MapSession


Examples of org.codehaus.xfire.transport.MapSession

        super.tearDown();
    }

    protected void createSession()
    {
        session = new MapSession();
    }
View Full Code Here

Examples of org.codehaus.xfire.transport.MapSession

    public void resetSession()
    {
        if( maintainSession )
        {
            session = new MapSession();
        }
        else
        {
            session = null;
        }
View Full Code Here

Examples of org.springframework.session.MapSession

    private RedisSession getSession(String id, boolean allowExpired) {
        Map<Object, Object> entries = getSessionBoundHashOperations(id).entries();
        if(entries.isEmpty()) {
            return null;
        }
        MapSession loaded = new MapSession();
        loaded.setId(id);
        for(Map.Entry<Object,Object> entry : entries.entrySet()) {
            String key = (String) entry.getKey();
            if(CREATION_TIME_ATTR.equals(key)) {
                loaded.setCreationTime((Long) entry.getValue());
            } else if(MAX_INACTIVE_ATTR.equals(key)) {
                loaded.setMaxInactiveInterval((Integer) entry.getValue());
            } else if(LAST_ACCESSED_ATTR.equals(key)) {
                loaded.setLastAccessedTime((Long) entry.getValue());
            } else if(key.startsWith(SESSION_ATTR_PREFIX)) {
                loaded.setAttribute(key.substring(SESSION_ATTR_PREFIX.length()), entry.getValue());
            }
        }
        if(!allowExpired && loaded.isExpired()) {
            return null;
        }
        RedisSession result = new RedisSession(loaded);
        result.originalLastAccessTime = loaded.getLastAccessedTime() + TimeUnit.SECONDS.toMillis(loaded.getMaxInactiveInterval());
        result.setLastAccessedTime(System.currentTimeMillis());
        return result;
    }
View Full Code Here

Examples of org.springframework.session.MapSession

        /**
         * Creates a new instance ensuring to mark all of the new attributes to be persisted in the next save operation.
         */
        RedisSession() {
            this(new MapSession());
            delta.put(CREATION_TIME_ATTR, getCreationTime());
            delta.put(MAX_INACTIVE_ATTR, getMaxInactiveInterval());
            delta.put(LAST_ACCESSED_ATTR, getLastAccessedTime());
        }
View Full Code Here

Examples of org.springframework.session.MapSession

  private Session session;

  @Before
  public void setup() throws Exception {
    cookieName = "SESSION";
    session = new MapSession();
    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
    strategy = new CookieHttpSessionStrategy();
  }
View Full Code Here

Examples of org.springframework.session.MapSession

    private Session session;

    @Before
    public void setup() throws Exception {
        headerName = "x-auth-token";
        session = new MapSession();
        request = new MockHttpServletRequest();
        response = new MockHttpServletResponse();
        strategy = new HeaderHttpSessionStrategy();
    }
View Full Code Here

Examples of org.springframework.session.MapSession

    }

    @Test
    public void createSessionDefaultMaxInactiveInterval() throws Exception {
        ExpiringSession session = redisRepository.createSession();
        assertThat(session.getMaxInactiveInterval()).isEqualTo(new MapSession().getMaxInactiveInterval());
    }
View Full Code Here

Examples of org.springframework.session.MapSession

        assertThat(delta.get(LAST_ACCESSED_ATTR)).isEqualTo(creationTime);
    }

    @Test
    public void saveLastAccessChanged() {
        RedisSession session = redisRepository.new RedisSession(new MapSession());
        session.setLastAccessedTime(12345678L);
        when(redisOperations.boundHashOps(getKey(session.getId()))).thenReturn(boundHashOperations);
        when(expirationRedisOperations.boundSetOps(anyString())).thenReturn(boundSetOperations);

        redisRepository.save(session);
View Full Code Here

Examples of org.springframework.session.MapSession

    }

    @Test
    public void saveSetAttribute() {
        String attrName = "attrName";
        RedisSession session = redisRepository.new RedisSession(new MapSession());
        session.setAttribute(attrName, "attrValue");
        when(redisOperations.boundHashOps(getKey(session.getId()))).thenReturn(boundHashOperations);
        when(expirationRedisOperations.boundSetOps(anyString())).thenReturn(boundSetOperations);

        redisRepository.save(session);
View Full Code Here

Examples of org.springframework.session.MapSession

    }

    @Test
    public void saveRemoveAttribute() {
        String attrName = "attrName";
        RedisSession session = redisRepository.new RedisSession(new MapSession());
        session.removeAttribute(attrName);
        when(redisOperations.boundHashOps(getKey(session.getId()))).thenReturn(boundHashOperations);
        when(expirationRedisOperations.boundSetOps(anyString())).thenReturn(boundSetOperations);

        redisRepository.save(session);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.