org.jasig.cas.ticket
Class TicketGrantingTicketImpl

java.lang.Object
  extended by org.jasig.cas.ticket.AbstractTicket
      extended by org.jasig.cas.ticket.TicketGrantingTicketImpl
All Implemented Interfaces:
java.io.Serializable, Ticket, TicketGrantingTicket, TicketState

@Entity
public final class TicketGrantingTicketImpl
extends AbstractTicket
implements TicketGrantingTicket

Concrete implementation of a TicketGrantingTicket. A TicketGrantingTicket is the global identifier of a principal into the system. It grants the Principal single-sign on access to any service that opts into single-sign on. Expiration of a TicketGrantingTicket is controlled by the ExpirationPolicy specified as object creation.

Since:
3.0
Version:
$Revision: 1.3 $ $Date: 2007/02/20 14:41:04 $
Author:
Scott Battaglia
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jasig.cas.ticket.TicketGrantingTicket
PREFIX
 
Constructor Summary
TicketGrantingTicketImpl()
           
TicketGrantingTicketImpl(java.lang.String id, Authentication authentication, ExpirationPolicy policy)
          Constructs a new TicketGrantingTicket without a parent TicketGrantingTicket.
TicketGrantingTicketImpl(java.lang.String id, TicketGrantingTicketImpl ticketGrantingTicket, Authentication authentication, ExpirationPolicy policy)
          Constructs a new TicketGrantingTicket.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 void expire()
          Explicitly expire a ticket.
 Authentication getAuthentication()
          Method to retrieve the authentication.
 java.util.List<Authentication> getChainedAuthentications()
          Method to retrieve the chained list of Authentications for this TicketGrantingTicket.
 ServiceTicket grantServiceTicket(java.lang.String id, Service service, ExpirationPolicy expirationPolicy, boolean credentialsProvided)
          Grant a ServiceTicket for a specific service.
 boolean isExpiredInternal()
           
 boolean isRoot()
          Convenience method to determine if the TicketGrantingTicket is the root of the heirachy of tickets.
 
Methods inherited from class org.jasig.cas.ticket.AbstractTicket
getCountOfUses, getCreationTime, getGrantingTicket, getId, getLastTimeUsed, getPreviousTimeUsed, hashCode, isExpired, toString, updateState
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jasig.cas.ticket.Ticket
getCountOfUses, getCreationTime, getGrantingTicket, getId, isExpired
 

Constructor Detail

TicketGrantingTicketImpl

public TicketGrantingTicketImpl()

TicketGrantingTicketImpl

public TicketGrantingTicketImpl(java.lang.String id,
                                TicketGrantingTicketImpl ticketGrantingTicket,
                                Authentication authentication,
                                ExpirationPolicy policy)
Constructs a new TicketGrantingTicket.

Parameters:
id - the id of the Ticket
ticketGrantingTicket - the parent ticket
authentication - the Authentication request for this ticket
policy - the expiration policy for this ticket.
Throws:
java.lang.IllegalArgumentException - if the Authentication object is null

TicketGrantingTicketImpl

public TicketGrantingTicketImpl(java.lang.String id,
                                Authentication authentication,
                                ExpirationPolicy policy)
Constructs a new TicketGrantingTicket without a parent TicketGrantingTicket.

Parameters:
id - the id of the Ticket
authentication - the Authentication request for this ticket
policy - the expiration policy for this ticket.
Method Detail

getAuthentication

public Authentication getAuthentication()
Description copied from interface: TicketGrantingTicket
Method to retrieve the authentication.

Specified by:
getAuthentication in interface TicketGrantingTicket
Specified by:
getAuthentication in interface TicketState
Returns:
the authentication

grantServiceTicket

public ServiceTicket grantServiceTicket(java.lang.String id,
                                        Service service,
                                        ExpirationPolicy expirationPolicy,
                                        boolean credentialsProvided)
Description copied from interface: TicketGrantingTicket
Grant a ServiceTicket for a specific service.

Specified by:
grantServiceTicket in interface TicketGrantingTicket
Parameters:
id - The unique identifier for this ticket.
service - The service for which we are granting a ticket
Returns:
the service ticket granted to a specific service for the principal of the TicketGrantingTicket

isRoot

public boolean isRoot()
Description copied from interface: TicketGrantingTicket
Convenience method to determine if the TicketGrantingTicket is the root of the heirachy of tickets.

Specified by:
isRoot in interface TicketGrantingTicket
Returns:
true if it has no parent, false otherwise.

expire

public void expire()
Description copied from interface: TicketGrantingTicket
Explicitly expire a ticket. This method will log out of any service associated with the Ticket Granting Ticket.

Specified by:
expire in interface TicketGrantingTicket

isExpiredInternal

public boolean isExpiredInternal()
Overrides:
isExpiredInternal in class AbstractTicket

getChainedAuthentications

public java.util.List<Authentication> getChainedAuthentications()
Description copied from interface: TicketGrantingTicket
Method to retrieve the chained list of Authentications for this TicketGrantingTicket.

Specified by:
getChainedAuthentications in interface TicketGrantingTicket
Returns:
the list of principals

equals

public final boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object


Copyright © 2004-2010 Java Architectures Special Interest Group. All Rights Reserved.