public static ErrorMessage error(NotificationType type, String info) { return new ErrorMessage(new Notification(type.name(), type.description(), info)); } }
public static SuccessMessage success(NotificationType type, String info) { return new SuccessMessage(new Notification(type.name(), type.description(), info)); }
public static SuccessMessage success(String message) { return new SuccessMessage(new Notification(message, "")); }
public Notification getNotification() { return new Notification(type.title(), type.description()); }
public static Notification create(NotificationType type) { return new Notification(type.name(), type.description()); }
public Message verifyAndUpdate(String username) throws SepaParseException { try { this.elementDescription = transform(); } catch (RDFParseException | UnsupportedRDFormatException | RepositoryException | IOException e) { return new ErrorMessage(NotificationType.UNKNOWN_ERROR.uiNotification()); } verify(); if (isVerifiedSuccessfully()) { update(username); return successMessage(); } else return errorMessage(); }
public static ErrorMessage error(String message) { return new ErrorMessage(new Notification(message, "")); }
private Message successMessage() { List<Notification> notifications = collectNotifications(); notifications.add(NotificationType.STORAGE_SUCCESS.uiNotification()); return new SuccessMessage(elementDescription.getName(), notifications); }
public Notification uiNotification() { return new Notification(title, description); } }
public static ErrorMessage error(NotificationType type) { return new ErrorMessage(new Notification(type.name(), type.description())); }
public static SuccessMessage success(NotificationType type) { return new SuccessMessage(new Notification(type.name(), type.description())); }
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); }
public Notification getNotification() { return new Notification(type.title(), type.description()); }
public static Notification create(NotificationType type, String info) { return new Notification(type.name(), type.description(), info); }
public Message verifyAndUpdate(String username) throws SepaParseException { try { this.elementDescription = transform(); } catch (RDFParseException | UnsupportedRDFormatException | RepositoryException | IOException e) { return new ErrorMessage(NotificationType.UNKNOWN_ERROR.uiNotification()); } verify(); if (isVerifiedSuccessfully()) { update(username); return successMessage(); } else return errorMessage(); }
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); }
public Message verifyAndAdd(String username, boolean publicElement) throws SepaParseException { try { this.elementDescription = transform(); } catch (RDFParseException | UnsupportedRDFormatException | RepositoryException | IOException e) { return new ErrorMessage(NotificationType.UNKNOWN_ERROR.uiNotification()); } verify(); if (isVerifiedSuccessfully()) { StorageState state = store(username, publicElement); if (state == StorageState.STORED) return successMessage(); else if (state == StorageState.ALREADY_IN_SESAME) return addedToUserSuccessMessage(); else return skippedSuccessMessage(); } else return errorMessage(); }
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 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); }