use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class EmailSenderService method sendTerminationSuccessEmail.
@Async
public void sendTerminationSuccessEmail(String owner, String email, String ambariServer, String clusterName) {
IdentityUser user = userDetailsService.getDetails(owner, UserFilterField.USERID);
sendEmail(user, email, successClusterMailTemplatePath, "Your cluster has been terminated", getEmailModel(user.getGivenName(), ambariServer, State.TERMINATION_SUCCESS, clusterName));
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class EmailSenderService method sendUpscaleSuccessEmail.
public void sendUpscaleSuccessEmail(String owner, String email, String ambariServer, String clusterName) {
IdentityUser user = userDetailsService.getDetails(owner, UserFilterField.USERID);
sendEmail(user, email, successClusterMailTemplatePath, String.format(CLUSTER_READY_SUBJECT, clusterName), getEmailModel(user.getGivenName(), ambariServer, State.UPSCALE_SUCCESS, clusterName));
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class EmailSenderService method sendStartFailureEmail.
@Async
public void sendStartFailureEmail(String owner, String email, String ambariServer, String clusterName) {
IdentityUser user = userDetailsService.getDetails(owner, UserFilterField.USERID);
sendEmail(user, email, failedClusterMailTemplatePath, "Cluster start failed", getEmailModel(user.getGivenName(), ambariServer, State.START_FAILURE, clusterName));
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class EmailSenderService method sendStopFailureEmail.
@Async
public void sendStopFailureEmail(String owner, String email, String ambariServer, String clusterName) {
IdentityUser user = userDetailsService.getDetails(owner, UserFilterField.USERID);
sendEmail(user, email, failedClusterMailTemplatePath, "Cluster stop failed", getEmailModel(user.getGivenName(), ambariServer, State.STOP_FAILURE, clusterName));
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class AccountPreferencesValidator method validateUserTimeToLive.
public void validateUserTimeToLive(String owner, AccountPreferences preferences) throws AccountPreferencesValidationException {
Long userTimeToLive = preferences.getUserTimeToLive();
if (needToValidateField(userTimeToLive)) {
IdentityUser identityUser = userDetailsService.getDetails(owner, UserFilterField.USERID);
long now = Calendar.getInstance().getTimeInMillis();
long userActiveTime = now - identityUser.getCreated().getTime();
if (userActiveTime > userTimeToLive) {
throw new AccountPreferencesValidationException("The user demo time is expired!");
}
}
}
Aggregations