Class FilterFavoriteService


  • public class FilterFavoriteService
    extends java.lang.Object
    Service to handle CRUD operations and such on OnmsFilterFavorite objects.
    • Constructor Detail

      • FilterFavoriteService

        public FilterFavoriteService()
    • Method Detail

      • getFavorite

        public OnmsFilterFavorite getFavorite​(java.lang.String favoriteId,
                                              java.lang.String username,
                                              java.lang.String filterString)
        Returns a favorite only if the given user is allowed to see that favorite and if the given filterString matches with the stored filter criteria inside the favorite. If the favorite does not exist for the user or the filter criteria does not match null is return.
        Parameters:
        favoriteId - The id of the favorite.
        username - The username which tries to load the favorite.
        filterString - The expected filter criteria.
        Returns:
        The requested favorite or null.
      • deleteFavorite

        public boolean deleteFavorite​(java.lang.String favoriteId,
                                      java.lang.String username)
        Deletes the given favorite, but only if the given username is allowed to delete.
        Parameters:
        favoriteId -
        username -
        Returns:
        true if the favorite was deleted, otherwise false.
      • getFavorite

        public OnmsFilterFavorite getFavorite​(java.lang.String favoriteId,
                                              java.lang.String userName)
        Returns the requested favorite if the favorite exists, the favoriteId is a valid Integer and if the given username is allowed to load the favorite.
        Parameters:
        favoriteId - The id of the favorite.
        userName - The user which tries to load the favorite.
        Returns:
        The favorite or null if the favoriteId is not an Integer, the favorite does not exist or the given username is not allowed to see the requested favorite.
      • getFavorite

        public OnmsFilterFavorite getFavorite​(java.lang.Integer favoriteId,
                                              java.lang.String userName)
        Returns the requested favorite if the favorite exists and if the given username is allowed to load the favorite.
        Parameters:
        favoriteId - The id of the favorite.
        userName - The user which tries to load the favorite.
        Returns:
        The favorite or null if the favorite does not exist or the given username is not allowed to see the requested favorite.
      • deleteFavorite

        public boolean deleteFavorite​(int favoriteId,
                                      java.lang.String userName)
        Deletes the favorite. The deletion is only performed if the favorite exists and the given user is allowed to delete.
        Parameters:
        favoriteId -
        userName -
        Returns:
      • getFavorites

        public java.util.List<OnmsFilterFavorite> getFavorites​(java.lang.String userName,
                                                               OnmsFilterFavorite.Page page)
        Loads all favorites for the user and the given page.
        Parameters:
        userName -
        page -
        Returns:
      • setFilterFavoriteDao

        protected void setFilterFavoriteDao​(FilterFavoriteDao favoriteDao)