@Entity public class ServiceTicketImpl extends AbstractTicket implements ServiceTicket
PREFIX
Constructor and Description |
---|
ServiceTicketImpl(java.lang.String id,
TicketGrantingTicket ticket,
Service service,
boolean credentialProvided,
ExpirationPolicy policy)
Constructs a new ServiceTicket with a Unique Id, a TicketGrantingTicket,
a Service, Expiration Policy and a flag to determine if the ticket
creation was from a new Login or not.
|
Modifier and Type | Method and Description |
---|---|
Authentication |
getAuthentication()
Authentication information from the ticket.
|
java.lang.String |
getPrefix()
Gets prefix.
|
ProxyGrantingTicket |
grantProxyGrantingTicket(java.lang.String id,
Authentication authentication,
ExpirationPolicy expirationPolicy)
Method to grant a TicketGrantingTicket from this service to the
authentication.
|
boolean |
isValidFor(Service serviceToValidate)
Attempts to ensure that the service specified matches the service associated with the ticket.
|
compareTo, getTicketGrantingTicket, isExpired, isExpiredInternal, markTicketExpired, toString, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getService, isFromNewLogin
getCountOfUses, getCreationTime, getExpirationPolicy, getId, getTicketGrantingTicket, isExpired, markTicketExpired
getCountOfUses, getCreationTime, getLastTimeUsed, getPreviousTimeUsed
public ServiceTicketImpl(java.lang.String id, @NonNull TicketGrantingTicket ticket, @NonNull Service service, boolean credentialProvided, ExpirationPolicy policy)
id
- the unique identifier for the ticket.ticket
- the TicketGrantingTicket parent.service
- the service this ticket is for.credentialProvided
- current credential that prompted this service ticket. May be null.policy
- the expiration policy for the Ticket.java.lang.IllegalArgumentException
- if the TicketGrantingTicket or the Service are null.public boolean isValidFor(Service serviceToValidate)
The state of the ticket is affected by this operation and the ticket will be considered used regardless of the match result. The state update subsequently may impact the ticket expiration policy in that, depending on the policy configuration, the ticket may be considered expired.
isValidFor
in interface ServiceTicket
serviceToValidate
- The incoming service to match this service ticket against.public ProxyGrantingTicket grantProxyGrantingTicket(java.lang.String id, Authentication authentication, ExpirationPolicy expirationPolicy) throws AbstractTicketException
ServiceTicket
grantProxyGrantingTicket
in interface ServiceTicket
id
- The unique identifier for this ticket.authentication
- The Authentication we wish to grant a ticket for.expirationPolicy
- expiration policy associated with this ticketAbstractTicketException
- ticket exception thrown when generating the ticketpublic Authentication getAuthentication()
TicketState
getAuthentication
in interface TicketState
getAuthentication
in class AbstractTicket