use of org.wso2.carbon.identity.user.endpoint.dto.SuccessfulUserCreationDTO in project identity-governance by wso2-extensions.
the class LiteApiServiceImpl method buildSuccessResponseForInternalChannels.
/**
* Build the successResponseDTO for successful user identification and channel retrieve when the notifications
* are managed internally.
*
* @param notificationResponseBean NotificationResponseBean
* @return SuccessfulUserCreationDTO
*/
private SuccessfulUserCreationDTO buildSuccessResponseForInternalChannels(NotificationResponseBean notificationResponseBean) {
SuccessfulUserCreationDTO successDTO = new SuccessfulUserCreationDTO();
successDTO.setCode(notificationResponseBean.getCode());
successDTO.setMessage(notificationResponseBean.getMessage());
successDTO.setNotificationChannel(notificationResponseBean.getNotificationChannel());
return successDTO;
}
use of org.wso2.carbon.identity.user.endpoint.dto.SuccessfulUserCreationDTO in project identity-governance by wso2-extensions.
the class LiteApiServiceImpl method buildSuccessfulAPIResponse.
/**
* Build response for a successful user self registration.
*
* @param notificationResponseBean NotificationResponseBean {@link NotificationResponseBean}
* @return Response
*/
private Response buildSuccessfulAPIResponse(NotificationResponseBean notificationResponseBean) {
// Check whether detailed api responses are enabled.
if (isDetailedResponseBodyEnabled()) {
String notificationChannel = notificationResponseBean.getNotificationChannel();
if (NotificationChannels.EXTERNAL_CHANNEL.getChannelType().equals(notificationChannel)) {
// Handle response when the notifications are externally managed.
SuccessfulUserCreationExternalResponseDTO successfulUserCreationDTO = buildSuccessResponseForExternalChannel(notificationResponseBean);
return Response.status(Response.Status.CREATED).entity(successfulUserCreationDTO).build();
}
SuccessfulUserCreationDTO successfulUserCreationDTO = buildSuccessResponseForInternalChannels(notificationResponseBean);
return Response.status(Response.Status.CREATED).entity(successfulUserCreationDTO).build();
} else {
if (notificationResponseBean != null) {
String notificationChannel = notificationResponseBean.getNotificationChannel();
/*If the notifications are required in the form of legacy response, and notifications are externally
managed, the recoveryId should be in the response as text*/
if (NotificationChannels.EXTERNAL_CHANNEL.getChannelType().equals(notificationChannel)) {
return Response.status(Response.Status.CREATED).entity(notificationResponseBean.getRecoveryId()).build();
}
}
return Response.status(Response.Status.CREATED).build();
}
}
use of org.wso2.carbon.identity.user.endpoint.dto.SuccessfulUserCreationDTO in project identity-governance by wso2-extensions.
the class MeApiServiceImpl method buildSuccessResponseForInternalChannels.
/**
* Build the successResponseDTO for successful user identification and channel retrieve when the notifications
* are managed internally.
*
* @param notificationResponseBean NotificationResponseBean
* @return SuccessfulUserCreationDTO
*/
private SuccessfulUserCreationDTO buildSuccessResponseForInternalChannels(NotificationResponseBean notificationResponseBean) {
SuccessfulUserCreationDTO successDTO = new SuccessfulUserCreationDTO();
successDTO.setCode(notificationResponseBean.getCode());
successDTO.setMessage(notificationResponseBean.getMessage());
successDTO.setNotificationChannel(notificationResponseBean.getNotificationChannel());
return successDTO;
}
use of org.wso2.carbon.identity.user.endpoint.dto.SuccessfulUserCreationDTO in project identity-governance by wso2-extensions.
the class MeApiServiceImpl method buildSuccessfulAPIResponse.
/**
* Build response for a successful user self registration.
*
* @param notificationResponseBean NotificationResponseBean {@link NotificationResponseBean}
* @return Response
*/
private Response buildSuccessfulAPIResponse(NotificationResponseBean notificationResponseBean) {
// Check whether detailed api responses are enabled.
if (isDetailedResponseBodyEnabled()) {
String notificationChannel = notificationResponseBean.getNotificationChannel();
if (NotificationChannels.EXTERNAL_CHANNEL.getChannelType().equals(notificationChannel)) {
// Handle response when the notifications are externally managed.
SuccessfulUserCreationExternalResponseDTO successfulUserCreationDTO = buildSuccessResponseForExternalChannel(notificationResponseBean);
return Response.status(Response.Status.CREATED).entity(successfulUserCreationDTO).build();
}
SuccessfulUserCreationDTO successfulUserCreationDTO = buildSuccessResponseForInternalChannels(notificationResponseBean);
return Response.status(Response.Status.CREATED).entity(successfulUserCreationDTO).build();
} else {
if (notificationResponseBean != null) {
String notificationChannel = notificationResponseBean.getNotificationChannel();
/*If the notifications are required in the form of legacy response, and notifications are externally
managed, the recoveryId should be in the response as text*/
if (NotificationChannels.EXTERNAL_CHANNEL.getChannelType().equals(notificationChannel)) {
return Response.status(Response.Status.CREATED).entity(notificationResponseBean.getRecoveryId()).build();
}
}
return Response.status(Response.Status.CREATED).build();
}
}
Aggregations