@Entity public class TicketGrantingTicketImpl extends AbstractTicket implements TicketGrantingTicket
PREFIX
Constructor and Description |
---|
TicketGrantingTicketImpl()
Instantiates a new ticket granting ticket impl.
|
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 |
---|---|
boolean |
equals(java.lang.Object object) |
Authentication |
getAuthentication()
Method to retrieve the authentication.
|
java.util.List<Authentication> |
getChainedAuthentications()
Gets all authentications (
TicketGrantingTicket.getAuthentication() from this
instance and all dependent tickets that reference this one. |
TicketGrantingTicket |
getGrantingTicket()
Method to retrieve the TicketGrantingTicket that granted this ticket.
|
Service |
getProxiedBy()
Gets the service that produced a proxy-granting ticket.
|
java.util.Collection<ProxyGrantingTicket> |
getProxyGrantingTickets()
Gets proxy granting tickets created by this TGT.
|
TicketGrantingTicket |
getRoot()
Gets the ticket-granting ticket at the root of the ticket hierarchy.
|
java.util.Map<java.lang.String,Service> |
getServices()
Gets an immutable map of service ticket and services accessed by this ticket-granting ticket.
|
ServiceTicket |
grantServiceTicket(java.lang.String id,
Service service,
ExpirationPolicy expirationPolicy,
boolean credentialProvided,
boolean onlyTrackMostRecentSession)
Grant a ServiceTicket for a specific service.
|
boolean |
isExpiredInternal()
Return if the TGT is expired.
|
boolean |
isRoot()
Return if the TGT has no parent.
|
void |
markTicketExpired()
Mark a ticket as expired.
|
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, getCountOfUses, getCreationTime, getExpirationPolicy, getId, getLastTimeUsed, getPreviousTimeUsed, hashCode, isExpired, toString, update
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getCountOfUses, getCreationTime, getExpirationPolicy, getId, isExpired
public TicketGrantingTicketImpl()
public TicketGrantingTicketImpl(java.lang.String id, Service proxiedBy, TicketGrantingTicket parentTicketGrantingTicket, 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 TicketGrantingTicket getGrantingTicket()
Ticket
getGrantingTicket
in interface Ticket
public Authentication getAuthentication()
TicketGrantingTicket
getAuthentication
in interface TicketGrantingTicket
getAuthentication
in interface TicketState
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 java.util.Map<java.lang.String,Service> getServices()
Collections.unmodifiableMap(java.util.Map)
,
which is a view of a separate map which can still change, an instance of ImmutableMap
contains its own data and will never change.getServices
in interface TicketGrantingTicket
public java.util.Collection<ProxyGrantingTicket> getProxyGrantingTickets()
TicketGrantingTicket
getProxyGrantingTickets
in interface TicketGrantingTicket
public void removeAllServices()
removeAllServices
in interface TicketGrantingTicket
public boolean isRoot()
isRoot
in interface TicketGrantingTicket
public void markTicketExpired()
TicketGrantingTicket
markTicketExpired
in interface TicketGrantingTicket
public TicketGrantingTicket getRoot()
TicketGrantingTicket
getRoot
in interface TicketGrantingTicket
public boolean isExpiredInternal()
isExpiredInternal
in class AbstractTicket
public java.util.List<Authentication> getChainedAuthentications()
TicketGrantingTicket
TicketGrantingTicket.getAuthentication()
from this
instance and all dependent tickets that reference this one.getChainedAuthentications
in interface TicketGrantingTicket
public Service getProxiedBy()
TicketGrantingTicket
getProxiedBy
in interface TicketGrantingTicket
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object