Package net.shibboleth.idp.cas.ticket.impl

# Class SimpleTicketService

java.lang.Object
net.shibboleth.idp.cas.ticket.impl.AbstractTicketService
net.shibboleth.idp.cas.ticket.impl.SimpleTicketService

All Implemented Interfaces:
  `TicketService`

public class SimpleTicketService extends AbstractTicketService
Simple CAS ticket management service that delegates storage to `StorageService`.

## Constructor Summary

Constructors
Constructor
Description
`SimpleTicketService(StorageService service)`
Creates a new instance.

## Method Summary

Modifier and Type
Method
Description
`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.
`ProxyTicket`
`removeProxyTicket(String id)`
Removes the proxy ticket with the given identifier.
`ServiceTicket`
`removeServiceTicket(String id)`
Removes the service ticket with the given identifier.

### Methods inherited from class net.shibboleth.idp.cas.ticket.impl.AbstractTicketService

`context, createProxyGrantingTicket, createProxyGrantingTicket, delete, fetchProxyGrantingTicket, read, removeProxyGrantingTicket, serializer, store`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SimpleTicketService

public SimpleTicketService(@Nonnull @ParameterName(name="service") StorageService service)
Creates a new instance.

Parameters:
  `service` - Storage service to which tickets are persisted.

## Method Details

### createServiceTicket

@Nonnull public ServiceTicket createServiceTicket(@Nonnull String id, @Nonnull Instant expiry, @Nonnull String service, @Nullable 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.
  `service` - Service for which ticket is granted.
  `state` - Additional state to be stored with the ticket.
  `renew` - True to indicate the ticket was generated in response to a forced authentication, false otherwise.
Returns:
  Created service ticket.

### removeServiceTicket

@Nullable public 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.

### createProxyTicket

@Nonnull public 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 public 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.