protected Response constructSuccessMessage(Notification... notifications) { return statusMessage(new SuccessMessage(notifications)); }
@Path("/logout") @GET @GsonWithIds @Override public Response doLogout() { Subject subject = SecurityUtils.getSubject(); subject.logout(); return ok(new SuccessMessage(NotificationType.LOGOUT_SUCCESS.uiNotification())); }
public static SuccessMessage success(String message) { return new SuccessMessage(new Notification(message, "")); }
private Message skippedSuccessMessage() { List<Notification> notifications = collectNotifications(); notifications.add(new Notification("Already exists", "This element is already in your list of elements, skipped.")); return new SuccessMessage(elementDescription.getName(), notifications); }
private Message skippedSuccessMessage() { List<Notification> notifications = collectNotifications(); notifications.add(new Notification("Already exists", "This element is already in your list of elements, skipped.")); return new SuccessMessage(elementDescription.getName(), notifications); }
private Message successMessage() { List<Notification> notifications = collectNotifications(); notifications.add(NotificationType.STORAGE_SUCCESS.uiNotification()); return new SuccessMessage(elementDescription.getName(), notifications); }
private Message addedToUserSuccessMessage() { List<Notification> notifications = collectNotifications(); notifications.add(new Notification("Already stored", "Element description already stored, added element to user")); return new SuccessMessage(elementDescription.getName(), notifications); }
private Message successMessage() { List<Notification> notifications = collectNotifications(); notifications.add(NotificationType.STORAGE_SUCCESS.uiNotification()); return new SuccessMessage(elementDescription.getName(), notifications); }
private Message addedToUserSuccessMessage() { List<Notification> notifications = collectNotifications(); notifications.add(new Notification("Already stored", "Element description already stored, added element to user")); return new SuccessMessage(elementDescription.getName(), notifications); }
@Path("/register") @POST @GsonWithIds @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Override public Response doRegister(RegistrationData data) { Set<Role> roles = new HashSet<>(); roles.add(data.getRole()); if (getUserStorage().emailExists(data.getEmail())) { return ok(Notifications.error("This email address already exists. Please choose another address.")); } else { new UserManagementService().registerUser(data, roles); return ok(new SuccessMessage(NotificationType.REGISTRATION_SUCCESS.uiNotification())); } }
public static SuccessMessage success(NotificationType type) { return new SuccessMessage(new Notification(type.name(), type.description())); }
public static SuccessMessage success(NotificationType type, String info) { return new SuccessMessage(new Notification(type.name(), type.description(), info)); }