use of org.wso2.carbon.identity.application.authentication.framework.dao.impl.UserSessionDAOImpl in project carbon-identity-framework by wso2.
the class UserSessionManagementServiceImpl method getActiveSessionList.
/**
* Returns the active sessions from given list of session IDs.
*
* @param sessionIdList list of sessionIds
* @return list of user sessions
* @throws SessionManagementServerException if an error occurs when retrieving the UserSessions.
*/
private List<UserSession> getActiveSessionList(List<String> sessionIdList) throws SessionManagementServerException {
List<UserSession> sessionsList = new ArrayList<>();
for (String sessionId : sessionIdList) {
if (sessionId != null) {
SessionContext sessionContext = FrameworkUtils.getSessionContextFromCache(sessionId, FrameworkUtils.getLoginTenantDomainFromContext());
if (sessionContext != null) {
UserSessionDAO userSessionDTO = new UserSessionDAOImpl();
UserSession userSession = userSessionDTO.getSession(sessionId);
if (userSession != null) {
sessionsList.add(userSession);
}
}
}
}
return sessionsList;
}
Aggregations