Interface Wishlist2Service

All Known Implementing Classes:
DefaultWishlist2Service

public interface Wishlist2Service
This interface provides the wish list related methods.
  • Method Details

    • getWishlists

      List<Wishlist2Model> getWishlists(UserModel user)
      Returns all wishlists for the given user
      Parameters:
      user - the owner of the wish lists
      Returns:
      all wishlists of the given user
    • getWishlists

      List<Wishlist2Model> getWishlists()
      Resturns all wishlists for the current user
      Returns:
      all wishlists of the current user
    • hasDefaultWishlist

      boolean hasDefaultWishlist()
      Returns:
      true if there is a default wishlist for the current user
    • hasDefaultWishlist

      boolean hasDefaultWishlist(UserModel user)
      Returns:
      true if there is a default wishlist for the given user
    • createDefaultWishlist

      Wishlist2Model createDefaultWishlist(String name, String description)
      creates a new default wishlist for the current user. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
      Parameters:
      name - The name of the wishlist
      description - The description of the wishlist
      Throws:
      SystemException - when a default wishlist already exists for the current user
    • createDefaultWishlist

      Wishlist2Model createDefaultWishlist(UserModel user, String name, String description)
      creates a new default wishlist for the given user. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
      Parameters:
      user - The user for which the whishlist should be created
      name - The name of the wishlist
      description - The description of the wishlist
      Throws:
      SystemException - when a default wishlist already exists for the current user
    • createWishlist

      Wishlist2Model createWishlist(String name, String description)
      creates a new wishlist for the current user. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
      Parameters:
      name - The name of the wishlist
      description - The description of the wishlist
    • createWishlist

      Wishlist2Model createWishlist(UserModel user, String name, String description)
      creates a new wishlist for the given user. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
      Parameters:
      user - The user for which the whishlist should be created
      name - The name of the wishlist
      description - The description of the wishlist
    • getDefaultWishlist

      Wishlist2Model getDefaultWishlist(UserModel user)
      Returns the default wishlist for the given user
      Parameters:
      user - the owner of the wishlist
      Returns:
      the default wishlist
      Throws:
      NullPointerException - if the user has no default wishlist
    • getDefaultWishlist

      Wishlist2Model getDefaultWishlist()
      Returns the default wishlist for the current user
      Returns:
      the default wishlist
      Throws:
      NullPointerException - if the user has no default wishlist
    • addWishlistEntry

      void addWishlistEntry(Wishlist2Model wishlist, Wishlist2EntryModel entry)
      Adds the given entry to the given wishlist. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
      Parameters:
      wishlist - the wishlist the entry should be added to
      entry - the entry which should be added to the wishlist
    • addWishlistEntry

      void addWishlistEntry(Wishlist2Model wishlist, ProductModel product, Integer desired, Wishlist2EntryPriority priority, String comment)
      Adds a given product to the given wishlist
      Parameters:
      wishlist - The wishlist on which the product should be added
      product - The product which should be added to the wishlist
    • addWishlistEntry

      void addWishlistEntry(ProductModel product, Integer desired, Wishlist2EntryPriority priority, String comment)
      Adds a given product to the default wishlist of the current user
      Parameters:
      product - The product which should be added to the wishlist
      Throws:
      NullPointerException - if the user has no default wishlist
    • addWishlistEntry

      void addWishlistEntry(UserModel user, ProductModel product, Integer desired, Wishlist2EntryPriority priority, String comment)
      Adds a given product to the default wishlist of the given user
      Parameters:
      user - the owner of the wishlist
      product - The product which should be added to the wishlist
      Throws:
      NullPointerException - if the user has no default wishlist
    • removeWishlistEntry

      void removeWishlistEntry(Wishlist2Model wishlist, Wishlist2EntryModel entry)
      Removes a given entry from the wishlist. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
      Parameters:
      wishlist - the wishlist from which the entry should be removed
      entry - the entry which should be removed
    • getWishlistEntryForProduct

      Wishlist2EntryModel getWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist)
      Returns the wishlist entry which contains the given product from the specific wishlist
      Parameters:
      product - the product which is contained in the wishlist entry which needs to be found
      wishlist - the wishlist which contains the wishlist entry
      Returns:
      the found wishlist entry
      Throws:
      UnknownIdentifierException - if no wishlist entry that meets the conditions can be found.
      AmbiguousIdentifierException - if more than one wishlist entry that meets the conditions can be found
      IllegalArgumentException - if parameter product or wishlist is null.
    • removeWishlistEntryForProduct

      void removeWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist)
      Removes a wishlist entry from the wishlist which contains the given product. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
      Parameters:
      product - the product which is contained in the wishlist entry which will be removed
      wishlist - the wishlist from which the entry should be removed
      Throws:
      UnknownIdentifierException - if no wishlist entry that meets the conditions can be found.
      AmbiguousIdentifierException - if more than one wishlist entry that meets the conditions can be found
      IllegalArgumentException - if parameter product or wishlist is null.