Search in sources :

Example 1 with LinkDTO

use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project carbon-identity-framework by wso2.

the class ConfigurationEndpointUtils method getResourceLinkList.

private static List<LinkDTO> getResourceLinkList(String resourceType, List<Resource> resources) {
    List<LinkDTO> linkDTOList = new ArrayList<>();
    for (Resource resource : resources) {
        LinkDTO linkDTO = new LinkDTO();
        linkDTO.setHref(getResourceURI(resourceType, resource));
        linkDTO.setRel("resource");
        linkDTOList.add(linkDTO);
    }
    return linkDTOList;
}
Also used : LinkDTO(org.wso2.carbon.identity.configuration.mgt.endpoint.dto.LinkDTO) ArrayList(java.util.ArrayList) Resource(org.wso2.carbon.identity.configuration.mgt.core.model.Resource)

Example 2 with LinkDTO

use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project carbon-identity-framework by wso2.

the class ConfigurationEndpointUtils method geFileLinkDTOList.

private static List<LinkDTO> geFileLinkDTOList(Resource resource) {
    LinkDTO linkDTO = new LinkDTO();
    List<LinkDTO> linkDTOList = new ArrayList<>();
    linkDTO.setRel(FILE);
    linkDTO.setHref(getFileURI(resource.getResourceName(), resource.getResourceType()));
    linkDTOList.add(linkDTO);
    return linkDTOList;
}
Also used : LinkDTO(org.wso2.carbon.identity.configuration.mgt.endpoint.dto.LinkDTO) ArrayList(java.util.ArrayList)

Example 3 with LinkDTO

use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project identity-api-server by wso2.

the class ServerClaimManagementService method getClaimDialectResDTO.

private ClaimDialectResDTO getClaimDialectResDTO(ClaimDialect claimDialect) {
    ClaimDialectResDTO claimDialectResDTO = new ClaimDialectResDTO();
    String dialectId;
    if (StringUtils.equals(claimDialect.getClaimDialectURI(), LOCAL_DIALECT)) {
        dialectId = LOCAL_DIALECT_PATH;
    } else {
        dialectId = base64EncodeId(claimDialect.getClaimDialectURI());
    }
    claimDialectResDTO.setId(dialectId);
    claimDialectResDTO.setDialectURI(claimDialect.getClaimDialectURI());
    LinkDTO linkDTO = new LinkDTO();
    linkDTO.setRel(REL_CLAIMS);
    linkDTO.setHref(buildURIForBody(String.format(V1_API_PATH_COMPONENT + CMT_PATH_COMPONENT + "/%s/claims", dialectId)).toString());
    claimDialectResDTO.setLink(linkDTO);
    return claimDialectResDTO;
}
Also used : LinkDTO(org.wso2.carbon.identity.rest.api.server.claim.management.v1.dto.LinkDTO) ClaimDialectResDTO(org.wso2.carbon.identity.rest.api.server.claim.management.v1.dto.ClaimDialectResDTO)

Example 4 with LinkDTO

use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project identity-governance by wso2-extensions.

the class RecoveryUtil method getInitiateQuestionResponseDTO.

public static InitiateAllQuestionResponseDTO getInitiateQuestionResponseDTO(ChallengeQuestionsResponse challengeQuestionsResponse) {
    InitiateAllQuestionResponseDTO initiateAllQuestionResponseDTO = new InitiateAllQuestionResponseDTO();
    List<QuestionDTO> questionDTOs = new ArrayList<>();
    for (ChallengeQuestion challengeQuestion : challengeQuestionsResponse.getQuestion()) {
        QuestionDTO questionDTO = new QuestionDTO();
        questionDTO.setQuestion(challengeQuestion.getQuestion());
        questionDTO.setQuestionSetId(challengeQuestion.getQuestionSetId());
        questionDTOs.add(questionDTO);
    }
    initiateAllQuestionResponseDTO.setQuestions(questionDTOs);
    initiateAllQuestionResponseDTO.setKey(challengeQuestionsResponse.getCode());
    LinkDTO linkDTO = new LinkDTO();
    linkDTO.setRel("validate-answer");
    linkDTO.setUri("/api/identity/recovery/v0.9");
    initiateAllQuestionResponseDTO.setLink(linkDTO);
    return initiateAllQuestionResponseDTO;
}
Also used : InitiateAllQuestionResponseDTO(org.wso2.carbon.identity.recovery.endpoint.dto.InitiateAllQuestionResponseDTO) LinkDTO(org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO) ArrayList(java.util.ArrayList) QuestionDTO(org.wso2.carbon.identity.recovery.endpoint.dto.QuestionDTO) ChallengeQuestion(org.wso2.carbon.identity.recovery.model.ChallengeQuestion)

Example 5 with LinkDTO

use of org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO in project identity-governance by wso2-extensions.

the class RecoveryUtil method getInitiateQuestionResponseDTO.

public static InitiateQuestionResponseDTO getInitiateQuestionResponseDTO(ChallengeQuestionResponse challengeQuestionResponse) {
    InitiateQuestionResponseDTO initiateQuestionResponseDTO = new InitiateQuestionResponseDTO();
    QuestionDTO questionDTO = new QuestionDTO();
    if (challengeQuestionResponse.getQuestion() != null) {
        questionDTO.setQuestion(challengeQuestionResponse.getQuestion().getQuestion());
        questionDTO.setQuestionSetId(challengeQuestionResponse.getQuestion().getQuestionSetId());
        initiateQuestionResponseDTO.setQuestion(questionDTO);
    }
    initiateQuestionResponseDTO.setKey(challengeQuestionResponse.getCode());
    LinkDTO linkDTO = new LinkDTO();
    if (IdentityRecoveryConstants.RECOVERY_STATUS_COMPLETE.equals(challengeQuestionResponse.getStatus())) {
        linkDTO.setRel("set-password");
        linkDTO.setUri("/api/identity/recovery/v0.9");
    } else {
        linkDTO.setRel("validate-answer");
        linkDTO.setUri("/api/identity/recovery/v0.9");
    }
    initiateQuestionResponseDTO.setLink(linkDTO);
    return initiateQuestionResponseDTO;
}
Also used : LinkDTO(org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO) QuestionDTO(org.wso2.carbon.identity.recovery.endpoint.dto.QuestionDTO) InitiateQuestionResponseDTO(org.wso2.carbon.identity.recovery.endpoint.dto.InitiateQuestionResponseDTO)

Aggregations

ArrayList (java.util.ArrayList)3 LinkDTO (org.wso2.carbon.identity.configuration.mgt.endpoint.dto.LinkDTO)2 LinkDTO (org.wso2.carbon.identity.recovery.endpoint.dto.LinkDTO)2 QuestionDTO (org.wso2.carbon.identity.recovery.endpoint.dto.QuestionDTO)2 Resource (org.wso2.carbon.identity.configuration.mgt.core.model.Resource)1 InitiateAllQuestionResponseDTO (org.wso2.carbon.identity.recovery.endpoint.dto.InitiateAllQuestionResponseDTO)1 InitiateQuestionResponseDTO (org.wso2.carbon.identity.recovery.endpoint.dto.InitiateQuestionResponseDTO)1 ChallengeQuestion (org.wso2.carbon.identity.recovery.model.ChallengeQuestion)1 ClaimDialectResDTO (org.wso2.carbon.identity.rest.api.server.claim.management.v1.dto.ClaimDialectResDTO)1 LinkDTO (org.wso2.carbon.identity.rest.api.server.claim.management.v1.dto.LinkDTO)1