1 package org.apache.turbine.services.session; 2 3 18 19 import java.util.Collection ; 20 import javax.servlet.http.HttpSession ; 21 22 import org.apache.turbine.om.security.User; 23 import org.apache.turbine.services.TurbineServices; 24 25 34 public abstract class TurbineSession 35 { 36 41 public static Collection getActiveSessions() 42 { 43 return getService().getActiveSessions(); 44 } 45 46 52 public static void addSession(HttpSession session) 53 { 54 getService().addSession(session); 55 } 56 57 63 public static void removeSession(HttpSession session) 64 { 65 getService().removeSession(session); 66 } 67 68 79 public static boolean isUserLoggedIn(User user) 80 { 81 return getService().isUserLoggedIn(user); 82 } 83 84 91 public static Collection getActiveUsers() 92 { 93 return getService().getActiveUsers(); 94 } 95 96 102 private static SessionService getService() 103 { 104 return (SessionService) TurbineServices 105 .getInstance().getService(SessionService.SERVICE_NAME); 106 } 107 108 114 public static User getUserFromSession(HttpSession session) 115 { 116 return getService().getUserFromSession(session); 117 } 118 119 125 public static HttpSession getSession(String sessionId) 126 { 127 return getService().getSession(sessionId); 128 } 129 130 137 public static Collection getSessionsForUser(User user) 138 { 139 return getService().getSessionsForUser(user); 140 } 141 } 142 | Popular Tags |