public interface TicketRegistry
Modifier and Type | Method and Description |
---|---|
void |
addTicket(Ticket ticket)
Add a ticket to the registry.
|
long |
deleteAll()
Delete all tickets from the registry.
|
int |
deleteTicket(java.lang.String ticketId)
Remove a specific ticket from the registry.
|
int |
deleteTicket(Ticket ticketId)
Remove a specific ticket from the registry.
|
Ticket |
getTicket(java.lang.String ticketId)
Retrieve a ticket from the registry.
|
<T extends Ticket> |
getTicket(java.lang.String ticketId,
java.lang.Class<T> clazz)
Retrieve a ticket from the registry.
|
java.util.Collection<Ticket> |
getTickets()
Retrieve all tickets from the registry.
|
default java.util.stream.Stream<Ticket> |
getTickets(java.util.function.Predicate<Ticket> predicate)
Gets tickets as a stream having applied a predicate.
|
default java.util.stream.Stream<Ticket> |
getTicketsStream()
Gets tickets stream.
|
long |
serviceTicketCount()
Computes the number of service tickets stored in the ticket registry.
|
long |
sessionCount()
Computes the number of SSO sessions stored in the ticket registry.
|
Ticket |
updateTicket(Ticket ticket)
Update the received ticket.
|
void addTicket(Ticket ticket)
ticket
- The ticket we wish to add to the cache.<T extends Ticket> T getTicket(java.lang.String ticketId, java.lang.Class<T> clazz)
T
- the generic ticket type to return that extends Ticket
ticketId
- the id of the ticket we wish to retrieve.clazz
- The expected class of the ticket we wish to retrieve.Ticket getTicket(java.lang.String ticketId)
ticketId
- the id of the ticket we wish to retrieveint deleteTicket(java.lang.String ticketId)
ticketId
- The id of the ticket to delete.int deleteTicket(Ticket ticketId)
ticketId
- The id of the ticket to delete.long deleteAll()
java.util.Collection<Ticket> getTickets()
default java.util.stream.Stream<Ticket> getTickets(java.util.function.Predicate<Ticket> predicate)
predicate
- the predicateTicket updateTicket(Ticket ticket)
ticket
- the ticketlong sessionCount()
Integer.MIN_VALUE
if unknown.long serviceTicketCount()
Integer.MIN_VALUE
if unknown.default java.util.stream.Stream<Ticket> getTicketsStream()