Class APIController

    • Constructor Detail

    • Method Detail

      • createEventAsync

        public void createEventAsync​(EventModel body,
                                     APICallBack<HttpResponse> callBack)
                              throws com.fasterxml.jackson.core.JsonProcessingException
        Add Single API Event Call
        Specified by:
        createEventAsync in interface IAPIController
        Parameters:
        body - The event to create
        callBack - Called after the HTTP response is received
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - on error creating event
      • createEventsBatchAsync

        public void createEventsBatchAsync​(List<EventModel> body,
                                           APICallBack<HttpResponse> callBack)
                                    throws com.fasterxml.jackson.core.JsonProcessingException
        Add multiple API Events in a single batch
        Specified by:
        createEventsBatchAsync in interface IAPIController
        Parameters:
        body - The events to create
        callBack - Called after the HTTP response is received
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - on error creating event
      • updateUserAsync

        public void updateUserAsync​(UserModel body,
                                    APICallBack<HttpResponse> callBack)
                             throws com.fasterxml.jackson.core.JsonProcessingException
        Update a Single User async
        Specified by:
        updateUserAsync in interface IAPIController
        Parameters:
        body - The user to update
        callBack - Called after the HTTP response is received
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - on error updating user
      • updateUsersBatchAsync

        public void updateUsersBatchAsync​(List<UserModel> body,
                                          APICallBack<HttpResponse> callBack)
                                   throws com.fasterxml.jackson.core.JsonProcessingException
        Update multiple Users in a single batch async
        Specified by:
        updateUsersBatchAsync in interface IAPIController
        Parameters:
        body - The list of users to update
        callBack - Called after the HTTP response is received
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - on error updating users
      • updateCompanyAsync

        public void updateCompanyAsync​(CompanyModel body,
                                       APICallBack<HttpResponse> callBack)
                                throws com.fasterxml.jackson.core.JsonProcessingException
        Update a Single Company async
        Specified by:
        updateCompanyAsync in interface IAPIController
        Parameters:
        body - The company to update
        callBack - Called after the HTTP response is received
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - on error updating a company
      • updateCompaniesBatchAsync

        public void updateCompaniesBatchAsync​(List<CompanyModel> body,
                                              APICallBack<HttpResponse> callBack)
                                       throws com.fasterxml.jackson.core.JsonProcessingException
        Update multiple Companies in a single batch async
        Specified by:
        updateCompaniesBatchAsync in interface IAPIController
        Parameters:
        body - The list of companies to update
        callBack - Called after the HTTP response is received
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - on error updating companies
      • getAppConfigAsync

        public void getAppConfigAsync​(APICallBack<HttpResponse> callBack)
                               throws com.fasterxml.jackson.core.JsonProcessingException
        Get the Application config async
        Specified by:
        getAppConfigAsync in interface IAPIController
        Parameters:
        callBack - Called after the HTTP response is received
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - on error getting app config
      • getGovernanceRulesAsync

        public void getGovernanceRulesAsync​(APICallBack<HttpResponse> callBack)
                                     throws com.fasterxml.jackson.core.JsonProcessingException
        Get the Governance rules
        Specified by:
        getGovernanceRulesAsync in interface IAPIController
        Parameters:
        callBack - Called after the HTTP response is received
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - on error getting app config
      • calculateWeight

        public int calculateWeight​(int sampleRate)
      • isBlockedByGovernanceRules

        public boolean isBlockedByGovernanceRules​(EventModel eventModel)
      • shouldSendSampledEvent

        public boolean shouldSendSampledEvent​(EventModel eventModel)
      • getSampleRateToUse

        public int getSampleRateToUse​(EventModel eventModel)