Minor refactoring related to wso2/product-iots#1035

revert-70aa11f8
Harshan Liyanage 7 years ago
parent a3aa259437
commit 5906546dfb

@ -167,9 +167,8 @@ public class UserManagementServiceImpl implements UserManagementService {
} }
userInfoWrapper.setBasicUserInfo(createdUserInfo); userInfoWrapper.setBasicUserInfo(createdUserInfo);
userInfoWrapper.setMessage(message); userInfoWrapper.setMessage(message);
return Response.created(new URI(API_BASE_PATH + "/" + URIEncoder.encode(userInfo.getUsername(), "UTF-8"))) return Response.created(new URI(API_BASE_PATH + "/" + URIEncoder.encode(userInfo.getUsername(),
.entity( "UTF-8"))).entity(userInfoWrapper).build();
userInfoWrapper).build();
} catch (UserStoreException e) { } catch (UserStoreException e) {
String msg = "Error occurred while trying to add user '" + userInfo.getUsername() + "' to the " + String msg = "Error occurred while trying to add user '" + userInfo.getUsername() + "' to the " +
"underlying user management system"; "underlying user management system";
@ -189,8 +188,7 @@ public class UserManagementServiceImpl implements UserManagementService {
return Response.serverError().entity( return Response.serverError().entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {
String msg = "Error occurred while sending registration email to the user " + String msg = "Error occurred while sending registration email to the user " + userInfo.getUsername();
userInfo.getUsername();
log.error(msg, e); log.error(msg, e);
return Response.serverError().entity( return Response.serverError().entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();

@ -62,8 +62,8 @@ public class EmailSenderServiceImpl implements EmailSenderService {
} }
private boolean isMailServerConfigured() { private boolean isMailServerConfigured() {
if(EmailSenderDataHolder.getInstance().getConfigurationContextService() if(EmailSenderDataHolder.getInstance().getConfigurationContextService().getServerConfigContext().
.getServerConfigContext().getAxisConfiguration().getTransportOut(TRANSPORT_SENDER_NAME) != null) { getAxisConfiguration().getTransportOut(TRANSPORT_SENDER_NAME) != null) {
return true; return true;
} else { } else {
return false; return false;
@ -141,7 +141,5 @@ public class EmailSenderServiceImpl implements EmailSenderService {
"'", e); "'", e);
} }
} }
} }
}
}
Loading…
Cancel
Save