Package org.apereo.cas.ticket.registry
Class RedisTicketRegistry
- java.lang.Object
-
- org.apereo.cas.ticket.registry.AbstractTicketRegistry
-
- org.apereo.cas.ticket.registry.RedisTicketRegistry
-
- All Implemented Interfaces:
org.apereo.cas.ticket.registry.TicketRegistry
public class RedisTicketRegistry extends org.apereo.cas.ticket.registry.AbstractTicketRegistry
The ticket registry is customized to remove the userid from the redis cache key. It also removes the use of the KEYS command to fetch a key by pattern before fetching it, and instead uses theCAS_TICKET:TICKET_ID
key construct to directly fetch the key. The above optimization does come with a cost: Note that as a result of this change, ticket registry operations that need to query items by user will need to fetch all relevant tickets, filter by type and user id to then find the final result set.- Since:
- 5.1.0
-
-
Constructor Summary
Constructors Constructor Description RedisTicketRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTicketInternal(org.apereo.cas.ticket.Ticket ticket)
long
deleteAll()
long
deleteSingleTicket(java.lang.String ticketId)
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()
java.util.stream.Stream<? extends org.apereo.cas.ticket.Ticket>
stream()
org.apereo.cas.ticket.Ticket
updateTicket(org.apereo.cas.ticket.Ticket ticket)
-
Methods inherited from class org.apereo.cas.ticket.registry.AbstractTicketRegistry
addTicket, countSessionsFor, decodeInternal, decodeTicket, decodeTickets, decodeTickets, deleteChildren, deleteTicket, deleteTicket, deleteTickets, deleteTickets, encodeTicket, encodeTicketId, getPrincipalIdFrom, getTicket, getTicket, isCipherExecutorEnabled, serviceTicketCount, sessionCount, setCipherExecutor
-
-
-
-
Method Detail
-
deleteAll
public long deleteAll()
-
deleteSingleTicket
public long deleteSingleTicket(java.lang.String ticketId)
- Specified by:
deleteSingleTicket
in classorg.apereo.cas.ticket.registry.AbstractTicketRegistry
-
addTicketInternal
public void addTicketInternal(org.apereo.cas.ticket.Ticket ticket)
- Specified by:
addTicketInternal
in classorg.apereo.cas.ticket.registry.AbstractTicketRegistry
-
getTicket
public org.apereo.cas.ticket.Ticket getTicket(java.lang.String ticketId, java.util.function.Predicate<org.apereo.cas.ticket.Ticket> predicate)
-
getTickets
public java.util.Collection<? extends org.apereo.cas.ticket.Ticket> getTickets()
-
updateTicket
public org.apereo.cas.ticket.Ticket updateTicket(org.apereo.cas.ticket.Ticket ticket)
-
stream
public java.util.stream.Stream<? extends org.apereo.cas.ticket.Ticket> stream()
-
getSessionsFor
public java.util.stream.Stream<? extends org.apereo.cas.ticket.Ticket> getSessionsFor(java.lang.String principalId)
-
-