Package net.shibboleth.idp.cas.ticket

# Interface TicketService

All Known Implementing Classes:
  `AbstractTicketService`, `EncodingTicketService`, `SimpleTicketService`

public interface TicketService
CAS ticket management service.

## Method Summary

Modifier and Type
Method
Description
`ProxyGrantingTicket`
`createProxyGrantingTicket(String id, Instant expiry, ProxyTicket proxyTicket, String pgtUrl)`
Creates a chained proxy-granting ticket from a proxy ticket.
`ProxyGrantingTicket`
`createProxyGrantingTicket(String id, Instant expiry, ServiceTicket serviceTicket, String pgtUrl)`
Creates a top-level proxy-granting ticket from a service ticket.
`ProxyTicket`
`createProxyTicket(String id, Instant expiry, ProxyGrantingTicket pgt, String service)`
Creates and stores a proxy ticket for the given service.
`ServiceTicket`
`createServiceTicket(String id, Instant expiry, String service, TicketState state, boolean renew)`
Creates and stores a ticket for the given service.
`ProxyGrantingTicket`
`fetchProxyGrantingTicket(String id)`
Retrieves a proxy-granting ticket by its ID.
`ProxyGrantingTicket`
`removeProxyGrantingTicket(String id)`
Removes the proxy-granting ticket with the given identifier.
`ProxyTicket`
`removeProxyTicket(String id)`
Removes the proxy ticket with the given identifier.
`ServiceTicket`
`removeServiceTicket(String id)`
Removes the service ticket with the given identifier.

## Method Details

### createServiceTicket

@Nonnull ServiceTicket createServiceTicket(@Nonnull String id, @Nonnull Instant expiry, @Nonnull String service, @Nonnull TicketState state, boolean renew)
Creates and stores a ticket for the given service.

Parameters:
  `id` - ID of ticket to create.
  `expiry` - Expiration date of service ticket.
  `state` - Additional state to be stored with the ticket.
  `service` - Service for which ticket is granted.
  `renew` - True to indicate the ticket was generated in response to a forced authentication, false otherwise.
Returns:
  Created service ticket.

### removeServiceTicket

@Nullable ServiceTicket removeServiceTicket(@Nonnull String id)
Removes the service ticket with the given identifier.

Parameters:
  `id` - Identifier of ticket to remove.
Returns:
  Removed ticket or null if not found.

### createProxyGrantingTicket

@Nonnull ProxyGrantingTicket createProxyGrantingTicket(@Nonnull String id, @Nonnull Instant expiry, @Nonnull ServiceTicket serviceTicket, @Nonnull String pgtUrl)
Creates a top-level proxy-granting ticket from a service ticket.

Parameters:
  `id` - ID of proxy-granting ticket to create.
  `expiry` - Expiration date of proxy-granting ticket.
  `serviceTicket` - Successfully-validated service ticket.
  `pgtUrl` - Proxy callback URL used to authenticate and identify the proxying service.
Returns:
  Created proxy-granting ticket.

### createProxyGrantingTicket

@Nonnull ProxyGrantingTicket createProxyGrantingTicket(@Nonnull String id, @Nonnull Instant expiry, @Nonnull ProxyTicket proxyTicket, @Nonnull String pgtUrl)
Creates a chained proxy-granting ticket from a proxy ticket. The value of `ProxyTicket.getPgtId()` defines the parent of the created ticket, which in turn determines its location in the proxy chain.

Parameters:
  `id` - ID of proxy-granting ticket to create.
  `expiry` - Expiration date of proxy-granting ticket.
  `proxyTicket` - Successfully-validated proxy ticket.
  `pgtUrl` - Proxy callback URL used to authenticate and identify the proxying service.
Returns:
  Created proxy-granting ticket.

### fetchProxyGrantingTicket

@Nullable ProxyGrantingTicket fetchProxyGrantingTicket(@Nonnull String id)
Retrieves a proxy-granting ticket by its ID.

Parameters:
  `id` - Proxy-granting ticket ID.
Returns:
  Proxy-granting ticket or null if not found.

### removeProxyGrantingTicket

@Nullable ProxyGrantingTicket removeProxyGrantingTicket(@Nonnull String id)
Removes the proxy-granting ticket with the given identifier.

Parameters:
  `id` - Identifier of ticket to remove.
Returns:
  Removed ticket or null if not found.

### createProxyTicket

@Nonnull ProxyTicket createProxyTicket(@Nonnull String id, @Nonnull Instant expiry, @Nonnull ProxyGrantingTicket pgt, @Nonnull String service)
Creates and stores a proxy ticket for the given service.

Parameters:
  `id` - ID of proxy-granting ticket to create.
  `expiry` - Expiration date of proxy ticket.
  `pgt` - Proxy-granting ticket used to create proxy ticket.
  `service` - Service for which ticket is granted.
Returns:
  Created proxy ticket.

### removeProxyTicket

@Nullable ProxyTicket removeProxyTicket(@Nonnull String id)
Removes the proxy ticket with the given identifier.

Parameters:
  `id` - Identifier of ticket to remove.
Returns:
  Removed ticket or null if not found.