Class JpaEventStoreProvider

    • Constructor Detail

      • JpaEventStoreProvider

        public JpaEventStoreProvider​(KeycloakSession session,
                                     javax.persistence.EntityManager em,
                                     int maxDetailLength,
                                     int maxFieldLength)
    • Method Detail

      • createQuery

        public EventQuery createQuery()
        Description copied from interface: EventStoreProvider
        Returns an object representing auth event query of type EventQuery. The object is used for collecting requested properties of auth events (e.g. realm, operation, resourceType time boundaries, etc.) and contains the EventQuery.getResultStream() method that returns all objects from this store provider that have given properties.
        Specified by:
        createQuery in interface EventStoreProvider
        Returns:
        a query object
      • clear

        public void clear​(RealmModel realm,
                          long olderThan)
        Description copied from interface: EventStoreProvider
        Removes all auth events for the realm that are older than olderThan from this store provider.
        Specified by:
        clear in interface EventStoreProvider
        Parameters:
        realm - the realm
        olderThan - point in time in milliseconds
      • onEvent

        public void onEvent​(Event event)
        Description copied from interface: EventListenerProvider
        Called when a user event occurs e.g. log in, register.

        Note this method should not do any action that cannot be rolled back, see EventListenerProvider javadoc for more details.

        Specified by:
        onEvent in interface EventListenerProvider
        Parameters:
        event - to be triggered
      • clearAdmin

        public void clearAdmin​(RealmModel realm,
                               long olderThan)
        Description copied from interface: EventStoreProvider
        Removes all auth events for the realm that are older than olderThan from this store provider.
        Specified by:
        clearAdmin in interface EventStoreProvider
        Parameters:
        realm - the realm
        olderThan - point in time in milliseconds
      • onEvent

        public void onEvent​(AdminEvent event,
                            boolean includeRepresentation)
        Description copied from interface: EventListenerProvider
        Called when an admin event occurs e.g. a client was updated/deleted.

        Note this method should not do any action that cannot be rolled back, see EventListenerProvider javadoc for more details.

        Specified by:
        onEvent in interface EventListenerProvider
        Parameters:
        event - to be triggered
        includeRepresentation - when false, event listener should NOT include representation field in the resulting action
      • close

        public void close()
        Specified by:
        close in interface Provider
      • clearExpiredAdminEvents

        protected void clearExpiredAdminEvents()