protected Response constructSuccessMessage(Notification... notifications) { return statusMessage(new SuccessMessage(notifications)); }
@POST @Produces(MediaType.APPLICATION_JSON) @GsonWithIds public Response addPipeline(@PathParam("username") String username, org.streampipes.model.client.pipeline.Pipeline pipeline) { String pipelineId = UUID.randomUUID().toString(); pipeline.setPipelineId(pipelineId); pipeline.setRunning(false); pipeline.setCreatedByUser(username); pipeline.setCreatedAt(new Date().getTime()); //userService.addOwnPipeline(username, pipeline); Operations.storePipeline(pipeline); SuccessMessage message = Notifications.success(NotificationType.PIPELINE_STORAGE_SUCCESS); message.addNotification(new Notification("id", pipelineId)); return ok(message); }
@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, String info) { return new SuccessMessage(new Notification(type.name(), type.description(), info)); }
public static SuccessMessage success(NotificationType type) { return new SuccessMessage(new Notification(type.name(), type.description())); }