@@ -0,0 +1,2054 @@
+package org.wso2.carbon.identity.application.authenticator.samlsso.dao;%0A%0A%0Aimport org.wso2.carbon.identity.application.authenticator.samlsso.exception.SAMLSSOException;%0Aimport org.wso2.carbon.identity.core.util.IdentityDatabaseUtil;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.PreparedStatement;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0Aimport org.apache.commons.logging.Log;%0Aimport org.apache.commons.logging.LogFactory;%0A%0A%0A%0Apublic class SessionDetailsDAO %7B%0A%0A    private static final Log log = LogFactory.getLog(SessionDetailsDAO.class);%0A%0A    public SessionDetailsDAO() %7B%0A    %7D%0A%0A    // get session ID related to the SAML Index in SAML logout request%0A%0A    public String getSessionID(String sessionIndex) throws SAMLSSOException %7B%0A%0A        String sessionID = null;%0A        Connection connection = null;%0A        PreparedStatement preparedStatement = null;%0A        ResultSet resultSet = null;%0A        String query = %22SELECT SESSION_ID FROM IDN_FEDERATED_AUTH_USER_SESSION_MAPPING WHERE IDP_SESSION_ID =?%22;%0A%0A        try %7B%0A            connection = IdentityDatabaseUtil.getDBConnection();%0A            preparedStatement = connection.prepareStatement(query);%0A            preparedStatement.setString(1, sessionIndex);%0A            resultSet = preparedStatement.executeQuery();%0A            while (resultSet.next()) %7B%0A                sessionID = resultSet.getString(%22SESSION_ID%22);%0A            %7D%0A%0A            if (sessionID.isEmpty()) %7B%0A                if (log.isDebugEnabled()) %7B%0A                    log.debug(%22No Session ID relevant to the SAML Index: %22 + sessionIndex);%0A                %7D%0A                return null;%0A            %7D%0A        %7D catch (SQLException e) %7B%0A            log.error(%22Unable to read session id from the database with saml id: %22 + sessionIndex, e);%0A            throw new SAMLSSOException(%22Unable to read session id with saml id:%22 + sessionIndex + %22 on database %22, e);%0A%0A        %7D finally %7B%0A            IdentityDatabaseUtil.closeAllConnections(connection, resultSet, preparedStatement);%0A        %7D%0A        return sessionID;%0A%0A    %7D%0A%7D%0A

Add new DAO for session details