Class ReactivePostgresSessionRepository

  • All Implemented Interfaces:
    org.springframework.session.ReactiveSessionRepository<net.andreaskluth.session.postgres.ReactivePostgresSessionRepository.PostgresSession>

    public class ReactivePostgresSessionRepository
    extends Object
    implements org.springframework.session.ReactiveSessionRepository<net.andreaskluth.session.postgres.ReactivePostgresSessionRepository.PostgresSession>
    A ReactiveSessionRepository that is implemented using vert.x reactive postgres client.
    • Constructor Detail

      • ReactivePostgresSessionRepository

        public ReactivePostgresSessionRepository​(io.reactiverse.pgclient.PgPool pgPool,
                                                 SerializationStrategy serializationStrategy,
                                                 Clock clock)
        Creates a new instance.
        Parameters:
        pgPool - the database pool
        serializationStrategy - the SerializationStrategy to read and write session data with.
        clock - the Clock to use
    • Method Detail

      • setDefaultMaxInactiveInterval

        public void setDefaultMaxInactiveInterval​(int defaultMaxInactiveInterval)
        Sets the maximum inactive interval in seconds between requests before newly created sessions will be invalidated. A negative time indicates that the session will never timeout. The default is 1800 (30 minutes).
        Parameters:
        defaultMaxInactiveInterval - the number of seconds that the Session should be kept alive between client requests.
      • createSession

        public reactor.core.publisher.Mono<net.andreaskluth.session.postgres.ReactivePostgresSessionRepository.PostgresSession> createSession()
        Specified by:
        createSession in interface org.springframework.session.ReactiveSessionRepository<net.andreaskluth.session.postgres.ReactivePostgresSessionRepository.PostgresSession>
      • save

        public reactor.core.publisher.Mono<Void> save​(net.andreaskluth.session.postgres.ReactivePostgresSessionRepository.PostgresSession postgresSession)
        Specified by:
        save in interface org.springframework.session.ReactiveSessionRepository<net.andreaskluth.session.postgres.ReactivePostgresSessionRepository.PostgresSession>
      • findById

        public reactor.core.publisher.Mono<net.andreaskluth.session.postgres.ReactivePostgresSessionRepository.PostgresSession> findById​(String id)
        Specified by:
        findById in interface org.springframework.session.ReactiveSessionRepository<net.andreaskluth.session.postgres.ReactivePostgresSessionRepository.PostgresSession>
      • deleteById

        public reactor.core.publisher.Mono<Void> deleteById​(String id)
        Specified by:
        deleteById in interface org.springframework.session.ReactiveSessionRepository<net.andreaskluth.session.postgres.ReactivePostgresSessionRepository.PostgresSession>
      • cleanupExpiredSessions

        public reactor.core.publisher.Mono<Integer> cleanupExpiredSessions()