Package net.shibboleth.idp.cas.ticket

# Class Ticket

java.lang.Object
net.shibboleth.idp.cas.ticket.Ticket

Direct Known Subclasses:
  `ProxyGrantingTicket`, `ProxyTicket`, `ServiceTicket`

public class Ticket extends Object
Generic CAS ticket that has a natural identifier and expiration. All CAS tickets are bound to an IdP session ID that indicates the IdP session in which they were created.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final Instant`
`expirationInstant`
Expiration instant.
`private final String`
`ticketId`
Ticket identifier.
`private final String`
`ticketService`
Service/relying party that requested the ticket.
`private TicketState`
`ticketState`
Supplemental ticket state data.

## Constructor Summary

Constructors
Constructor
Description
`Ticket(String id, String service, Instant expiration)`
Creates a new ticket with the given parameters.

## Method Summary

Modifier and Type
Method
Description
`Ticket`
`clone(String newId)`
Create a new ticket from this one with the given identifier.
`boolean`
`equals(Object o)`
`Instant`
`getExpirationInstant()`
Get the expiration instant.
`String`
`getId()`
Get the ticket ID.
`String`
`getService()`
Get the service that requested the ticket.
`String`
`getSessionId()`
Get the session ID.
`TicketState`
`getTicketState()`
Get the supplemental ticket state data.
`int`
`hashCode()`
`protected Ticket`
`newInstance(String newId)`
Create a new ticket with this ticket's service and expiration.
`void`
`setTicketState(TicketState state)`
Set the supplemental ticket state data.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### ticketId

@Nonnull private final String ticketId
Ticket identifier.

### ticketService

@Nonnull private final String ticketService
Service/relying party that requested the ticket.

### expirationInstant

@Nonnull private final Instant expirationInstant
Expiration instant.

### ticketState

@Nullable private TicketState ticketState
Supplemental ticket state data.

## Constructor Details

### Ticket

public Ticket(@Nonnull String id, @Nonnull String service, @Nonnull Instant expiration)
Creates a new ticket with the given parameters.

Parameters:
  `id` - Ticket ID.
  `service` - Service that requested the ticket.
  `expiration` - Expiration instant.

## Method Details

### getId

@Nonnull public String getId()
Get the ticket ID.

Returns:
  ticket ID

### getSessionId

@Nullable public String getSessionId()
Get the session ID.

Returns:
  session ID

### getService

@Nonnull public String getService()
Get the service that requested the ticket.

Returns:
  service that requested the ticket

### getExpirationInstant

@Nonnull public Instant getExpirationInstant()
Get the expiration instant.

Returns:
  expiration instant

### getTicketState

@Nullable public TicketState getTicketState()
Get the supplemental ticket state data.

Returns:
  ticket state

### setTicketState

public void setTicketState(@Nullable TicketState state)
Set the supplemental ticket state data.

Parameters:
  `state` - supplemental ticket state

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### clone

public Ticket clone(@Nonnull String newId)
Create a new ticket from this one with the given identifier.

Parameters:
  `newId` - New ticket ID.
Returns:
  Clone of this ticket with new ID.

### newInstance

protected Ticket newInstance(@Nonnull String newId)
Create a new ticket with this ticket's service and expiration.

Parameters:
  `newId` - new ticket ID
Returns:
  newly created ticket