Package org.wildfly.clustering.web.session

Examples of org.wildfly.clustering.web.session.ImmutableSessionMetaData


    }

    @Override
    public ImmutableSession createImmutableSession(String id, CoarseSessionEntry<L> entry) {
        CoarseSessionCacheEntry<L> cacheEntry = entry.getCacheEntry();
        ImmutableSessionMetaData metaData = cacheEntry.getMetaData();
        MarshalledValue<Map<String, Object>, MarshallingContext> value = entry.getAttributes();
        ImmutableSessionAttributes attributes = new CoarseImmutableSessionAttributes(value, this.marshaller);
        return new InfinispanImmutableSession(id, metaData, attributes, this.context);
    }
View Full Code Here


        this.id = session.getId();
        ImmutableSessionAttributes attributes = session.getAttributes();
        for (String name: attributes.getAttributeNames()) {
            this.attributes.put(name, attributes.getAttribute(name));
        }
        ImmutableSessionMetaData metaData = session.getMetaData();
        this.creationTime = metaData.getCreationTime().getTime();
        this.lastAccessedTime = metaData.getLastAccessedTime().getTime();
        this.maxInactiveInterval = (int) metaData.getMaxInactiveInterval(TimeUnit.SECONDS);
    }
View Full Code Here

    public void getSessionByIdentifier() {
        Batcher<Batch> batcher = mock(Batcher.class);
        Batch batch = mock(Batch.class);
        ImmutableSession session = mock(ImmutableSession.class);
        ImmutableSessionAttributes attributes = mock(ImmutableSessionAttributes.class);
        ImmutableSessionMetaData metaData = mock(ImmutableSessionMetaData.class);
        String id = "session";
        String name = "name";
        Object value = new Object();
        Set<String> names = Collections.singleton(name);
        Date creationTime = new Date();
        Date lastAccessedTime = new Date();
        long maxInactiveInterval = 30;

        when(this.manager.getBatcher()).thenReturn(batcher);
        when(this.manager.viewSession(id)).thenReturn(session);
        when(session.getId()).thenReturn(id);
        when(session.getAttributes()).thenReturn(attributes);
        when(attributes.getAttributeNames()).thenReturn(names);
        when(attributes.getAttribute(name)).thenReturn(value);
        when(session.getMetaData()).thenReturn(metaData);
        when(metaData.getCreationTime()).thenReturn(creationTime);
        when(metaData.getLastAccessedTime()).thenReturn(lastAccessedTime);
        when(metaData.getMaxInactiveInterval(TimeUnit.SECONDS)).thenReturn(maxInactiveInterval);
        when(batcher.createBatch()).thenReturn(batch);
       
        io.undertow.server.session.Session result = this.adapter.getSession(id);
       
        assertSame(this.adapter, result.getSessionManager());
View Full Code Here

TOP

Related Classes of org.wildfly.clustering.web.session.ImmutableSessionMetaData

Copyright © 2018 www.massapicom. 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.