private OAuthConsumerAppDTO getApplicationById(String clientId) throws DCRMException { if (StringUtils.isEmpty(clientId)) { String errorMessage = "Invalid client_id"; throw DCRMUtils.generateClientException( DCRMConstants.ErrorMessages.BAD_REQUEST_INVALID_INPUT, errorMessage); } try { OAuthConsumerAppDTO dto = oAuthAdminService.getOAuthApplicationData(clientId); if (dto == null || StringUtils.isEmpty(dto.getApplicationName())) { throw DCRMUtils.generateClientException( DCRMConstants.ErrorMessages.NOT_FOUND_APPLICATION_WITH_ID, clientId); } else if (!isUserAuthorized(clientId)) { throw DCRMUtils.generateClientException( DCRMConstants.ErrorMessages.FORBIDDEN_UNAUTHORIZED_USER, clientId); } return dto; } catch (IdentityOAuthAdminException e) { if (e.getCause() instanceof InvalidOAuthClientException) { throw DCRMUtils.generateClientException(DCRMConstants.ErrorMessages.NOT_FOUND_APPLICATION_WITH_ID, clientId); } throw DCRMUtils.generateServerException( DCRMConstants.ErrorMessages.FAILED_TO_GET_APPLICATION_BY_ID, clientId, e); } }
OAuthConsumerAppDTO oAuthConsumerAppDTO = oAuthAdminService.getOAuthApplicationData(consumerKey); log.debug("Updated the OAuthApplication..."); oAuthConsumerAppDTO = oAuthAdminService.getOAuthApplicationData(consumerKey); OAuthApplicationInfo oAuthApplicationInfo = createOAuthAppInfoFromDTO(oAuthConsumerAppDTO); return oAuthApplicationInfo;
OAuthConsumerAppDTO oAuthConsumerAppDTO = oAuthAdminService.getOAuthApplicationData(consumerKey); if (oAuthConsumerAppDTO != null) { if (callbackUrl != null && !callbackUrl.isEmpty()) { oAuthConsumerAppDTO = oAuthAdminService.getOAuthApplicationData(consumerKey); OAuthApplicationInfo oAuthApplicationInfo = createOAuthAppInfoFromDTO(oAuthConsumerAppDTO); return oAuthApplicationInfo;
OAuthConsumerAppDTO oAuthConsumerApp = null; try { oAuthConsumerApp = oAuthAdminService.getOAuthApplicationData(consumerKey); } catch (Exception e) {
try { oAuthAdminService = new OAuthAdminService(); oAuthConsumerApp = oAuthAdminService.getOAuthApplicationData(consumerKey); } catch (Exception e) {