Class HazelcastTicketRegistry

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.apereo.cas.ticket.registry.TicketRegistry, org.springframework.beans.factory.DisposableBean

    public class HazelcastTicketRegistry
    extends org.apereo.cas.ticket.registry.AbstractTicketRegistry
    implements java.lang.AutoCloseable, org.springframework.beans.factory.DisposableBean
    Hazelcast-based implementation of a TicketRegistry.

    This implementation just wraps the Hazelcast's IMap which is an extension of the standard Java's ConcurrentMap.

    The heavy lifting of distributed data partitioning, network cluster discovery and join, data replication, etc. is done by Hazelcast's Map implementation.

    Since:
    4.1.0
    • Field Summary

      • Fields inherited from class org.apereo.cas.ticket.registry.AbstractTicketRegistry

        cipherExecutor
      • Fields inherited from interface org.apereo.cas.ticket.registry.TicketRegistry

        BEAN_NAME
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTicketInternal​(org.apereo.cas.ticket.Ticket ticket)  
      void close()  
      long countSessionsFor​(java.lang.String principalId)  
      long deleteAll()  
      long deleteSingleTicket​(java.lang.String ticketIdToDelete)  
      void destroy()  
      java.util.stream.Stream<? extends org.apereo.cas.ticket.Ticket> getSessionsFor​(java.lang.String principalId)  
      org.apereo.cas.ticket.Ticket getTicket​(java.lang.String ticketId, java.util.function.Predicate<org.apereo.cas.ticket.Ticket> predicate)  
      java.util.Collection<? extends org.apereo.cas.ticket.Ticket> getTickets()  
      void shutdown()
      Make sure we shutdown HazelCast when the context is destroyed.
      org.apereo.cas.ticket.Ticket updateTicket​(org.apereo.cas.ticket.Ticket ticket)  
      • Methods inherited from class org.apereo.cas.ticket.registry.AbstractTicketRegistry

        addTicket, decodeTicket, decodeTickets, decodeTickets, deleteChildren, deleteTicket, deleteTicket, deleteTickets, deleteTickets, encodeTicket, encodeTicketId, getPrincipalIdFrom, getTicket, getTicket, isCipherExecutorEnabled, serviceTicketCount, sessionCount, setCipherExecutor
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apereo.cas.ticket.registry.TicketRegistry

        addTicket, getTickets, stream
    • Constructor Detail

      • HazelcastTicketRegistry

        public HazelcastTicketRegistry()
    • Method Detail

      • updateTicket

        public org.apereo.cas.ticket.Ticket updateTicket​(org.apereo.cas.ticket.Ticket ticket)
                                                  throws java.lang.Exception
        Specified by:
        updateTicket in interface org.apereo.cas.ticket.registry.TicketRegistry
        Throws:
        java.lang.Exception
      • addTicketInternal

        public void addTicketInternal​(org.apereo.cas.ticket.Ticket ticket)
                               throws java.lang.Exception
        Specified by:
        addTicketInternal in class org.apereo.cas.ticket.registry.AbstractTicketRegistry
        Throws:
        java.lang.Exception
      • getTicket

        public org.apereo.cas.ticket.Ticket getTicket​(java.lang.String ticketId,
                                                      java.util.function.Predicate<org.apereo.cas.ticket.Ticket> predicate)
        Specified by:
        getTicket in interface org.apereo.cas.ticket.registry.TicketRegistry
      • deleteSingleTicket

        public long deleteSingleTicket​(java.lang.String ticketIdToDelete)
        Specified by:
        deleteSingleTicket in class org.apereo.cas.ticket.registry.AbstractTicketRegistry
      • deleteAll

        public long deleteAll()
        Specified by:
        deleteAll in interface org.apereo.cas.ticket.registry.TicketRegistry
      • getTickets

        public java.util.Collection<? extends org.apereo.cas.ticket.Ticket> getTickets()
        Specified by:
        getTickets in interface org.apereo.cas.ticket.registry.TicketRegistry
      • countSessionsFor

        public long countSessionsFor​(java.lang.String principalId)
        Specified by:
        countSessionsFor in interface org.apereo.cas.ticket.registry.TicketRegistry
        Overrides:
        countSessionsFor in class org.apereo.cas.ticket.registry.AbstractTicketRegistry
      • getSessionsFor

        public java.util.stream.Stream<? extends org.apereo.cas.ticket.Ticket> getSessionsFor​(java.lang.String principalId)
        Specified by:
        getSessionsFor in interface org.apereo.cas.ticket.registry.TicketRegistry
      • shutdown

        public void shutdown()
        Make sure we shutdown HazelCast when the context is destroyed.
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable