/jboss-as-7.1.1.Final/web/src/main/java/org/jboss/as/web/session/SessionManager.java
Java | 78 lines | 14 code | 10 blank | 54 comment | 0 complexity | 5d94005f100491798184012965f31ac9 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
1/*
2 * JBoss, Home of Professional Open Source.
3 * Copyright 2008, Red Hat Middleware LLC, and individual contributors
4 * as indicated by the @author tags. See the copyright.txt file in the
5 * distribution for a full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */
22package org.jboss.as.web.session;
23
24import java.util.Map;
25
26import javax.servlet.http.HttpServletResponse;
27
28import org.apache.catalina.Manager;
29import org.apache.catalina.Session;
30
31/**
32 * Common interface for the http session replication managers.
33 *
34 * @author Scott.Stark@jboss.org
35 * @version $Revision: 108925 $
36 */
37public interface SessionManager extends Manager {
38 /**
39 * Retrieve the JvmRoute for the enclosing Engine.
40 *
41 * @return the JvmRoute or null.
42 */
43 String getJvmRoute();
44
45 /**
46 * Locate the most appropriate jvm route for the specified sessionId
47 *
48 * @param sessionId a session identifier
49 * @return a jvm route
50 */
51 String locate(String sessionId);
52
53 /**
54 * Sets a new cookie for the given session id and response
55 *
56 * @param sessionId The session id
57 */
58 void setNewSessionCookie(String sessionId, HttpServletResponse response);
59
60 /**
61 * Remove the active session locally from the manager without replicating to the cluster. This can be useful when the
62 * session is expired, for example, where there is not need to propagate the expiration.
63 *
64 * @param session
65 */
66 void removeLocal(Session session);
67
68 /**
69 * Store the modified session.
70 *
71 * @param session
72 */
73 boolean storeSession(Session session);
74
75 Map.Entry<String, String> parse(String sessionId);
76
77 String createSessionId(String realId, String jvmRoute);
78}