use of org.wso2.carbon.identity.recovery.stub.model.ChallengeQuestion in project identity-api-server by wso2.
the class ServerChallengeService method deleteQuestion.
/**
* Delete specific challenge question of a given set.
*
* @param challengeSetId challenge question set id
* @param questionId challenge question to delete
* @param locale
* @return
*/
public boolean deleteQuestion(String challengeSetId, String questionId, String locale) {
if (StringUtils.isEmpty(locale)) {
locale = StringUtils.EMPTY;
}
try {
if (isChallengeSetExists(challengeSetId, ContextLoader.getTenantDomainFromContext())) {
ChallengeQuestion[] toDelete = { new ChallengeQuestion(challengeSetId, questionId, StringUtils.EMPTY, locale) };
getChallengeQuestionManager().deleteChallengeQuestions(toDelete, ContextLoader.getTenantDomainFromContext());
}
} catch (IdentityRecoveryException e) {
throw handleIdentityRecoveryException(e, ChallengeConstant.ErrorMessage.ERROR_CODE_ERROR_DELETING_CHALLENGE);
}
return true;
}
Aggregations