Search in sources :

Example 1 with RemoteUserDTO

use of io.hops.hopsworks.common.remote.RemoteUserDTO in project hopsworks by logicalclocks.

the class Register method createRemoteUser.

private void createRemoteUser(HttpServletRequest httpServletRequest) {
    try {
        RemoteUserDTO userDTO = ldapConfigHelper.getLdapHelper().getRemoteUserByUuid(this.uuid);
        if (email == null || email.isEmpty()) {
            // email is needed for audit
            email = userDTO.getEmail().isEmpty() ? null : userDTO.getEmail().get(0);
        }
        if (email == null || email.isEmpty()) {
            throw new GenericException(RESTCodes.GenericErrorCode.ILLEGAL_ARGUMENT, Level.FINE, "Email not provided.");
        }
        auditedUserAdministration.createRemoteUser(userDTO, email, firstName, lastName, UserAccountStatus.fromValue(status), RemoteUserType.fromValue(remoteUserType), httpServletRequest);
        restAll();
        MessagesController.addInfoMessage("Success", "User created.", "msg");
    } catch (UserException | GenericException e) {
        showErrorMsg("Create remote user failed.", e);
    }
}
Also used : UserException(io.hops.hopsworks.exceptions.UserException) RemoteUserDTO(io.hops.hopsworks.common.remote.RemoteUserDTO) GenericException(io.hops.hopsworks.exceptions.GenericException)

Aggregations

RemoteUserDTO (io.hops.hopsworks.common.remote.RemoteUserDTO)1 GenericException (io.hops.hopsworks.exceptions.GenericException)1 UserException (io.hops.hopsworks.exceptions.UserException)1