Class ActiveInstallsScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService

    @Component
    @Named("activeinstalls2")
    @Singleton
    public class ActiveInstallsScriptService
    extends Object
    implements org.xwiki.script.service.ScriptService
    Provides Scripting APIs for the Active Installs module.
    Since:
    5.2M2
    Version:
    $Id: 93eabc04f3e1a817dd53cb923b8d9e28476deaff $
    • Constructor Detail

      • ActiveInstallsScriptService

        public ActiveInstallsScriptService()
    • Method Detail

      • countInstalls

        public long countInstalls​(String jsonQuery)
                           throws Exception
        Executes a Count query for Active Installs.
        Parameters:
        jsonQuery - the Elastic Search JSON query used to search for installs.
        Returns:
        the count number
        Throws:
        Exception - when an error happens while retrieving the data
        Since:
        14.4RC1
      • searchInstalls

        public List<org.xwiki.activeinstalls2.internal.data.Ping> searchInstalls​(String jsonQuery)
                                                                          throws Exception
        Executes a Search query for Active Installs.
        Parameters:
        jsonQuery - the Elastic Search JSON query used to search for installs. For example:
        
                    {
                        "term": { "distributionVersion" : "5.2" }
                    }
                
        Returns:
        the parsed JSON result coming from Elastic Search, as a list of Ping object.
        Throws:
        Exception - when an error happens while retrieving the data
        Since:
        14.4RC1