Class MoesifFilter

  • All Implemented Interfaces:
    jakarta.servlet.Filter

    public class MoesifFilter
    extends Object
    implements jakarta.servlet.Filter
    • Constructor Detail

      • MoesifFilter

        public MoesifFilter()
        Default Constructor, please set ApplicationId before use.
      • MoesifFilter

        public MoesifFilter​(String applicationId)
        Constructor
        Parameters:
        applicationId - Required parameter: obtained from your moesif Account.
      • MoesifFilter

        public MoesifFilter​(String applicationId,
                            boolean debug)
        Constructor
        Parameters:
        applicationId - Required parameter: obtained from your moesif Account.
        debug - Flag for turning debug messages on.
      • MoesifFilter

        public MoesifFilter​(String applicationId,
                            MoesifConfiguration config)
        Constructor
        Parameters:
        applicationId - Required parameter: obtained from your moesif Account.
        config - MoesifConfiguration Object.
      • MoesifFilter

        public MoesifFilter​(String applicationId,
                            MoesifConfiguration config,
                            boolean debug)
        Constructor
        Parameters:
        applicationId - Required parameter: obtained from your moesif Account.
        config - MoesifConfiguration Object
        debug - boolean
    • Method Detail

      • setApplicationId

        public void setApplicationId​(String applicationId)
        Sets the Moesif Application Id.
        Parameters:
        applicationId - Required parameter: obtained from your moesif Account.
      • setConfigure

        public void setConfigure​(MoesifConfiguration config)
        Sets the MoesifConfiguration
        Parameters:
        config - MoesifConfiguration Object
      • setDebug

        public void setDebug​(boolean debug)
        Sets the debug flag
        Parameters:
        debug - boolean
      • setLogBody

        public void setLogBody​(boolean logBody)
        Sets the logBody flag
        Parameters:
        logBody - boolean
      • getAPI

        public com.moesif.api.controllers.APIController getAPI()
        Get the underlying APIController
        Returns:
        Returns the APIController instance
      • init

        public void init​(jakarta.servlet.FilterConfig filterConfig)
        Specified by:
        init in interface jakarta.servlet.Filter
      • destroy

        public void destroy()
        Specified by:
        destroy in interface jakarta.servlet.Filter
      • updateUser

        public void updateUser​(com.moesif.api.models.UserModel userModel)
                        throws Throwable
        Throws:
        Throwable
      • updateUsersBatch

        public void updateUsersBatch​(List<com.moesif.api.models.UserModel> usersModel)
                              throws Throwable
        Throws:
        Throwable
      • updateCompany

        public void updateCompany​(com.moesif.api.models.CompanyModel companyModel)
                           throws Throwable
        Throws:
        Throwable
      • updateCompaniesBatch

        public void updateCompaniesBatch​(List<com.moesif.api.models.CompanyModel> companiesModel)
                                  throws Throwable
        Throws:
        Throwable
      • updateSubscription

        public void updateSubscription​(com.moesif.api.models.SubscriptionModel subscriptionModel)
                                throws Throwable
        Throws:
        Throwable
      • updateSubscriptionsBatch

        public void updateSubscriptionsBatch​(List<com.moesif.api.models.SubscriptionModel> subscriptionsModel)
                                      throws Throwable
        Throws:
        Throwable
      • doFilter

        public void doFilter​(jakarta.servlet.ServletRequest request,
                             jakarta.servlet.ServletResponse response,
                             jakarta.servlet.FilterChain filterChain)
                      throws IOException,
                             jakarta.servlet.ServletException
        Specified by:
        doFilter in interface jakarta.servlet.Filter
        Throws:
        IOException
        jakarta.servlet.ServletException
      • drainQueueAndStopJobs

        public void drainQueueAndStopJobs()
        Method to stop the scheduled jobs and drain the batch queue. Batch event processor sends the leftover events present in queue before stopping the scheduled jobs.