@Entity public class TicketGrantingTicketImpl extends AbstractTicket implements TicketGrantingTicket
PREFIX
Constructor and Description |
---|
TicketGrantingTicketImpl(java.lang.String id,
Authentication authentication,
ExpirationPolicy policy)
Constructs a new TicketGrantingTicket without a parent
TicketGrantingTicket.
|
TicketGrantingTicketImpl(java.lang.String id,
Service proxiedBy,
TicketGrantingTicket parentTicketGrantingTicket,
Authentication authentication,
ExpirationPolicy policy)
Constructs a new TicketGrantingTicket.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Authentication> |
getChainedAuthentications()
Gets all authentications (
TicketGrantingTicket.getAuthentication() from this
instance and all dependent tickets that reference this one. |
java.lang.String |
getPrefix()
Gets prefix.
|
TicketGrantingTicket |
getRoot()
Gets the ticket-granting ticket at the root of the ticket hierarchy.
|
ServiceTicket |
grantServiceTicket(java.lang.String id,
Service service,
ExpirationPolicy expirationPolicy,
boolean credentialProvided,
boolean onlyTrackMostRecentSession)
Grant a ServiceTicket for a specific service.
|
boolean |
isRoot()
Return if the TGT has no parent.
|
void |
removeAllServices()
Remove all services of the TGT (at logout).
|
protected void |
trackServiceSession(java.lang.String id,
Service service,
boolean onlyTrackMostRecentSession)
Update service and track session.
|
compareTo, getAuthentication, getTicketGrantingTicket, isExpired, isExpiredInternal, markTicketExpired, toString, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAuthentication, getDescendantTickets, getProxiedBy, getProxyGrantingTickets, getServices
getCountOfUses, getCreationTime, getExpirationPolicy, getId, getTicketGrantingTicket, isExpired, markTicketExpired
getCountOfUses, getCreationTime, getLastTimeUsed, getPreviousTimeUsed
public TicketGrantingTicketImpl(java.lang.String id, Service proxiedBy, TicketGrantingTicket parentTicketGrantingTicket, @NonNull Authentication authentication, ExpirationPolicy policy)
IllegalArgumentException
if the Authentication object is null.id
- the id of the TicketproxiedBy
- Service that produced this proxy ticket.parentTicketGrantingTicket
- the parent ticketauthentication
- the Authentication request for this ticketpolicy
- the expiration policy for this ticket.public TicketGrantingTicketImpl(java.lang.String id, Authentication authentication, ExpirationPolicy policy)
id
- the id of the Ticketauthentication
- the Authentication request for this ticketpolicy
- the expiration policy for this ticket.public ServiceTicket grantServiceTicket(java.lang.String id, Service service, ExpirationPolicy expirationPolicy, boolean credentialProvided, boolean onlyTrackMostRecentSession)
The state of the ticket is affected by this operation and the ticket will be considered used. The state update subsequently may impact the ticket expiration policy in that, depending on the policy configuration, the ticket may be considered expired.
grantServiceTicket
in interface TicketGrantingTicket
id
- The unique identifier for this ticket.service
- The service for which we are granting a ticketexpirationPolicy
- the expiration policy.credentialProvided
- current credential event for issuing this ticket. Could be null.onlyTrackMostRecentSession
- track the most recent session by keeping the latest service ticketprotected void trackServiceSession(java.lang.String id, Service service, boolean onlyTrackMostRecentSession)
id
- the idservice
- the serviceonlyTrackMostRecentSession
- the only track most recent sessionpublic void removeAllServices()
removeAllServices
in interface TicketGrantingTicket
public boolean isRoot()
isRoot
in interface TicketGrantingTicket
public TicketGrantingTicket getRoot()
TicketGrantingTicket
getRoot
in interface TicketGrantingTicket
public java.util.List<Authentication> getChainedAuthentications()
TicketGrantingTicket
TicketGrantingTicket.getAuthentication()
from this
instance and all dependent tickets that reference this one.getChainedAuthentications
in interface TicketGrantingTicket