Examples of maxAge()


Examples of com.vtence.molecule.Session.maxAge()

    }

    private Session makeSession(String sid, Session data) {
        Session session = new Session(sid);
        session.merge(data);
        session.maxAge(data.maxAge());
        session.updatedAt(data.updatedAt());
        session.createdAt(data.createdAt());
        return session;
    }
View Full Code Here

Examples of com.vtence.molecule.Session.maxAge()

        }
    }

    private Session prepareSession(Request request) {
        Session session = acquireSession(request);
        session.maxAge(expireAfter);
        Session.set(request, session);
        return session;
    }

    private Session acquireSession(Request request) {
View Full Code Here

Examples of com.vtence.molecule.Session.maxAge()

    private Application expireSessionAfter(final int timeout) {
        return new Application() {
            public void handle(Request request, Response response) throws Exception {
                Session session = Session.get(request);
                session.put("written", true);
                session.maxAge(timeout);
            }
        };
    }

    private Application invalidateSession() {
View Full Code Here

Examples of com.vtence.molecule.Session.maxAge()

    savesSessionContentDefensively() {
        Session data = new Session();
        data.put("a", "Alice");
        data.put("b", "Bob");
        data.put("c", "Chris");
        data.maxAge(maxAge);

        Session saved = save(data);
        data.clear();

        assertThat("saved session", saved, not(Matchers.sameInstance(data)));
View Full Code Here

Examples of com.vtence.molecule.Session.maxAge()

        Session saved = save(data);
        data.clear();

        assertThat("saved session", saved, not(Matchers.sameInstance(data)));
        assertThat("saved session expiration time", saved.maxAge(), equalTo(maxAge));
        assertThat("saved session keys", saved.keys(), Matchers.<Object>contains("a", "b", "c"));
        assertThat("saved session values", saved.values(), Matchers.<Object>contains("Alice", "Bob", "Chris"));
    }

    @Test public void
View Full Code Here

Examples of com.vtence.molecule.Session.maxAge()

    }

    @Test public void
    discardsExpiredSessions() {
        Session data = new Session();
        data.maxAge(maxAge);
        String sid = pool.save(data);
        delorean.travelInTime(timeJump(maxAge));
        assertThat("expired session", pool.load(sid), nullValue());
    }
View Full Code Here

Examples of com.vtence.molecule.Session.maxAge()

    }

    private Collection<String> expire(Collection<String> sessions) {
        for (String sid : sessions) {
            Session session = pool.load(sid);
            session.maxAge(maxAge);
            pool.save(session);
        }
        return sessions;
    }
View Full Code Here

Examples of com.vtence.molecule.http.Cookie.maxAge()

    setsResponseCookies() throws IOException {
        server.run(new Application() {
            public void handle(Request request, Response response) throws Exception {
                Cookie cookie = new Cookie("cookie", "value");
                cookie.httpOnly(true);
                cookie.maxAge(1800);
                response.add(cookie);
            }
        });

        response = request.send();
View Full Code Here

Examples of io.netty.handler.codec.http.cors.CorsConfig.maxAge()

    }

    @Test
    public void maxAge() {
        final CorsConfig cors = withAnyOrigin().maxAge(3000).build();
        assertThat(cors.maxAge(), is(3000L));
    }

    @Test
    public void requestMethods() {
        final CorsConfig cors = withAnyOrigin().allowedRequestMethods(HttpMethod.POST, HttpMethod.GET).build();
View Full Code Here

Examples of org.oasisopen.sca.annotation.ConversationAttributes.maxAge()

            // implicitly assume conversation
            type.setJavaScope(org.apache.tuscany.sca.implementation.java.JavaScopeImpl.CONVERSATION);
        } else if (conversation != null) {
            long maxAge;
            long maxIdleTime;
            String maxAgeVal = conversation.maxAge();
            String maxIdleTimeVal = conversation.maxIdleTime();
            try {
                if (maxAgeVal.length() > 0) {
                    maxAge = convertTimeMillis(maxAgeVal);
                    type.setMaxAge(maxAge);
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.