Package org.apereo.cas.ticket
Interface ExpirationPolicy
-
- All Superinterfaces:
java.io.Serializable
public interface ExpirationPolicy extends java.io.SerializableStrategy that determines if the ticket is expired. Implementations of the Expiration Policy define their own rules on what they consider an expired Ticket to be.- Since:
- 3.0.0
- See Also:
Ticket
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.time.ClockgetClock()Gets clock of this expiration policy.java.lang.StringgetName()Gets name of this expiration policy.java.lang.LonggetTimeToIdle()Describes the idle time duration for the item.java.lang.LonggetTimeToLive()Describes the time duration where this policy should consider the item alive.default java.lang.LonggetTimeToLive(TicketState ticketState)Method to determine the actual TTL of aTicket, based on the policy.booleanisExpired(TicketState ticketState)Method to determine if aTickethas expired or not, based on the policy.
-
-
-
Method Detail
-
isExpired
boolean isExpired(TicketState ticketState)
Method to determine if aTickethas expired or not, based on the policy.- Parameters:
ticketState- The snapshot of the current ticket state- Returns:
- true if the ticket is expired, false otherwise.
-
getTimeToLive
default java.lang.Long getTimeToLive(TicketState ticketState)
Method to determine the actual TTL of aTicket, based on the policy.- Parameters:
ticketState- The snapshot of the current ticket state- Returns:
- The time to live in seconds. A zero value indicates the time duration is not supported or is inactive.
-
getTimeToLive
java.lang.Long getTimeToLive()
Describes the time duration where this policy should consider the item alive. Once this time passes, the item is considered expired and dead.- Returns:
- time to live in seconds. A zero value indicates the time duration is not supported or is inactive.
-
getTimeToIdle
java.lang.Long getTimeToIdle()
Describes the idle time duration for the item.- Returns:
- idle time in seconds. A zero value indicates the time duration is not supported or is inactive. Unit of measure is defined by the implementation.
-
getName
java.lang.String getName()
Gets name of this expiration policy.- Returns:
- the name
-
getClock
java.time.Clock getClock()
Gets clock of this expiration policy.- Returns:
- the clock
-
-