org.jasig.cas.ticket
Class ServiceTicketImpl

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

@Entity
public final class ServiceTicketImpl
extends AbstractTicket
implements ServiceTicket

Domain object representing a Service Ticket. A service ticket grants specific access to a particular service. It will only work for a particular service. Generally, it is a one time use Ticket, but the specific expiration policy can be anything.

Since:
3.0
Version:
$Revision: 43947 $ $Date: 2008-07-10 16:31:57 -0400 (Thu, 10 Jul 2008) $
Author:
Scott Battaglia
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jasig.cas.ticket.ServiceTicket
PREFIX
 
Constructor Summary
  ServiceTicketImpl()
           
protected ServiceTicketImpl(java.lang.String id, TicketGrantingTicketImpl ticket, Service service, boolean fromNewLogin, 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.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 Authentication getAuthentication()
          Authentication information from the ticket.
 Service getService()
          Retrieve the service this ticket was given for.
 TicketGrantingTicket grantTicketGrantingTicket(java.lang.String id, Authentication authentication, ExpirationPolicy expirationPolicy)
          Method to grant a TicketGrantingTicket from this service to the authentication.
 boolean isFromNewLogin()
          Determine if this ticket was created at the same time as a TicketGrantingTicket.
 boolean isValidFor(Service serviceToValidate)
           
 
Methods inherited from class org.jasig.cas.ticket.AbstractTicket
getCountOfUses, getCreationTime, getGrantingTicket, getId, getLastTimeUsed, getPreviousTimeUsed, hashCode, isExpired, isExpiredInternal, 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

ServiceTicketImpl

public ServiceTicketImpl()

ServiceTicketImpl

protected ServiceTicketImpl(java.lang.String id,
                            TicketGrantingTicketImpl ticket,
                            Service service,
                            boolean fromNewLogin,
                            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.

Parameters:
id - the unique identifier for the ticket.
ticket - the TicketGrantingTicket parent.
service - the service this ticket is for.
fromNewLogin - is it from a new login.
policy - the expiration policy for the Ticket.
Throws:
java.lang.IllegalArgumentException - if the TicketGrantingTicket or the Service are null.
Method Detail

isFromNewLogin

public boolean isFromNewLogin()
Description copied from interface: ServiceTicket
Determine if this ticket was created at the same time as a TicketGrantingTicket.

Specified by:
isFromNewLogin in interface ServiceTicket
Returns:
true if it is, false otherwise.

getService

public Service getService()
Description copied from interface: ServiceTicket
Retrieve the service this ticket was given for.

Specified by:
getService in interface ServiceTicket
Returns:
the server.

isValidFor

public boolean isValidFor(Service serviceToValidate)
Specified by:
isValidFor in interface ServiceTicket

grantTicketGrantingTicket

public TicketGrantingTicket grantTicketGrantingTicket(java.lang.String id,
                                                      Authentication authentication,
                                                      ExpirationPolicy expirationPolicy)
Description copied from interface: ServiceTicket
Method to grant a TicketGrantingTicket from this service to the authentication. Analogous to the ProxyGrantingTicket.

Specified by:
grantTicketGrantingTicket in interface ServiceTicket
Parameters:
id - The unique identifier for this ticket.
authentication - The Authentication we wish to grant a ticket for.
Returns:
The ticket granting ticket.

getAuthentication

public Authentication getAuthentication()
Description copied from interface: TicketState
Authentication information from the ticket. This may be null.

Specified by:
getAuthentication in interface TicketState
Returns:
the authentication information.

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.