Search in sources :

Example 11 with InternalServerErrorException

use of org.wso2.carbon.identity.user.endpoint.exceptions.InternalServerErrorException in project identity-governance by wso2-extensions.

the class Utils method getUserRecoveryData.

/**
 * Gets user recovery data for a specific user.
 *
 * @param resendCodeRequestDTO resendCodeRequestDTO.
 * @return User recovery data.
 */
public static UserRecoveryData getUserRecoveryData(ResendCodeRequestDTO resendCodeRequestDTO) {
    UserRecoveryDataStore userRecoveryDataStore = JDBCRecoveryDataStore.getInstance();
    UserRecoveryData userRecoveryData = null;
    try {
        userRecoveryData = userRecoveryDataStore.loadWithoutCodeExpiryValidation(Utils.getUser(resendCodeRequestDTO.getUser()));
    } catch (IdentityRecoveryException e) {
        throw new InternalServerErrorException("Error in loading user recovery data for " + Utils.getUser(resendCodeRequestDTO.getUser()), e);
    }
    return userRecoveryData;
}
Also used : UserRecoveryData(org.wso2.carbon.identity.recovery.model.UserRecoveryData) UserRecoveryDataStore(org.wso2.carbon.identity.recovery.store.UserRecoveryDataStore) InternalServerErrorException(org.wso2.carbon.identity.user.endpoint.exceptions.InternalServerErrorException) IdentityRecoveryException(org.wso2.carbon.identity.recovery.IdentityRecoveryException)

Aggregations

InternalServerErrorException (org.wso2.carbon.apimgt.rest.api.util.exception.InternalServerErrorException)3 InternalServerErrorException (org.wso2.carbon.identity.user.endpoint.exceptions.InternalServerErrorException)3 IdentityRecoveryException (org.wso2.carbon.identity.recovery.IdentityRecoveryException)2 UserRecoveryData (org.wso2.carbon.identity.recovery.model.UserRecoveryData)2 UserRecoveryDataStore (org.wso2.carbon.identity.recovery.store.UserRecoveryDataStore)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)1 UnrecognizedPropertyException (com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException)1 EOFException (java.io.EOFException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ClientErrorException (javax.ws.rs.ClientErrorException)1 AuthenticationException (org.apache.cxf.interceptor.security.AuthenticationException)1 JSONObject (org.json.simple.JSONObject)1 JSONParser (org.json.simple.parser.JSONParser)1 ParseException (org.json.simple.parser.ParseException)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1 Test (org.testng.annotations.Test)1 APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)1