Class HitService

  • All Implemented Interfaces:
    IHitService

    public class HitService
    extends java.lang.Object
    implements IHitService
    HitService
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BEAN_SERVICE
      The Constant BEAN_SERVICE.
    • Constructor Summary

      Constructors 
      Constructor Description
      HitService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void create​(Hit hit)
      Creates the a hit extender.
      Hit findByParameters​(java.lang.String strIdExtendableResource, java.lang.String strExtendableResourceType)
      Find by id extender.
      Hit findByPrimaryKey​(int nIdHit)
      Find.
      java.util.List<Hit> findByResourceList​(java.util.List<java.lang.String> listIdExtendableResource, java.lang.String strExtendableResourceType)
      Find by list id extendable resource.
      java.util.List<java.lang.Integer> findIdMostHitedResources​(java.lang.String strExtendableResourceType, int nItemsOffset, int nMaxItemsNumber)
      Get the ids of resources ordered by their number of hits
      void incrementHit​(Hit hit)
      Increment hit.
      void remove​(int nIdExtender)
      Removes a hit extender.
      void removeByResource​(java.lang.String strIdResource, java.lang.String strResourceType)
      Removes a hit extender by id resource and resource type.
      void update​(Hit hit)
      Update a hit extender.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • BEAN_SERVICE

        public static final java.lang.String BEAN_SERVICE
        The Constant BEAN_SERVICE.
        See Also:
        Constant Field Values
    • Constructor Detail

      • HitService

        public HitService()
    • Method Detail

      • create

        public void create​(Hit hit)
        Creates the a hit extender.
        Specified by:
        create in interface IHitService
        Parameters:
        hit - the hit
      • update

        public void update​(Hit hit)
        Update a hit extender.
        Specified by:
        update in interface IHitService
        Parameters:
        hit - the hit
      • remove

        public void remove​(int nIdExtender)
        Removes a hit extender.
        Specified by:
        remove in interface IHitService
        Parameters:
        nIdExtender - the n id hit
      • removeByResource

        public void removeByResource​(java.lang.String strIdResource,
                                     java.lang.String strResourceType)
        Removes a hit extender by id resource and resource type.
        Specified by:
        removeByResource in interface IHitService
        Parameters:
        strIdResource - The id of the resource to remove
        strResourceType - The type of the resource to remove
      • incrementHit

        public void incrementHit​(Hit hit)
        Increment hit.
        Specified by:
        incrementHit in interface IHitService
        Parameters:
        hit - the hit
      • findByPrimaryKey

        public Hit findByPrimaryKey​(int nIdHit)
        Find.
        Specified by:
        findByPrimaryKey in interface IHitService
        Parameters:
        nIdHit - the n id extender
        Returns:
        the hit
      • findByParameters

        public Hit findByParameters​(java.lang.String strIdExtendableResource,
                                    java.lang.String strExtendableResourceType)
        Find by id extender.
        Specified by:
        findByParameters in interface IHitService
        Parameters:
        strIdExtendableResource - the str id extendable resource
        strExtendableResourceType - the str extendable resource type
        Returns:
        the hit
      • findIdMostHitedResources

        public java.util.List<java.lang.Integer> findIdMostHitedResources​(java.lang.String strExtendableResourceType,
                                                                          int nItemsOffset,
                                                                          int nMaxItemsNumber)
        Get the ids of resources ordered by their number of hits
        Specified by:
        findIdMostHitedResources in interface IHitService
        Parameters:
        strExtendableResourceType - The type of resources to consider
        nItemsOffset - The offset of the items to get, or 0 to get items from the first one
        nMaxItemsNumber - The maximum number of items to return, or 0 to get every items
        Returns:
        The list of ids of resources ordered by the number hits
      • findByResourceList

        public java.util.List<Hit> findByResourceList​(java.util.List<java.lang.String> listIdExtendableResource,
                                                      java.lang.String strExtendableResourceType)
        Find by list id extendable resource.
        Specified by:
        findByResourceList in interface IHitService
        Parameters:
        listIdExtendableResource - the list of str id extendable resource
        strExtendableResourceType - the str extendable resource type
        Returns:
        the hit list