Package net.shibboleth.idp.cas.ticket

# Class TicketState

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

public class TicketState extends Object
Supplemental state data to be stored with a ticket.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`authenticatedPrincipalName`
Canonical authenticated principal name.
`private Instant`
`authenticationInstant`
Authentication instant.
`private String`
`authenticationMethod`
Authentication method ID/name/description.
`private Set<String>`
`consentedAttributeIds`
Attribute IDs that were consented to during the ticket request.
`private String`
`sessId`
ID of session in which ticket is created.

## Constructor Summary

Constructors
Constructor
Description
`TicketState(String sessionId, String principalName, Instant authnInstant, String authnMethod)`
Creates a new instance with required fields.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`Instant`
`getAuthenticationInstant()`
Get the instant at which the principal authenticated.
`String`
`getAuthenticationMethod()`
Get the principal authentication method ID/name/description.
`Set<String>`
`getConsentedAttributeIds()`
Get the attribute IDs that were consented to during the request.
`String`
`getPrincipalName()`
Get the canonical authenticated principal name.
`String`
`getSessionId()`
Get the ID of the session in which the ticket was created.
`int`
`hashCode()`
`void`
`setConsentedAttributeIds(Collection<String> attributeIds)`
Set the attribute IDs that were consented to during the request.

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

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

## Field Details

### sessId

@Nullable private String sessId
ID of session in which ticket is created.

### authenticatedPrincipalName

@Nonnull private String authenticatedPrincipalName
Canonical authenticated principal name.

### authenticationInstant

@Nonnull private Instant authenticationInstant
Authentication instant.

### authenticationMethod

@Nonnull private String authenticationMethod
Authentication method ID/name/description.

### consentedAttributeIds

@Nullable private Set<String> consentedAttributeIds
Attribute IDs that were consented to during the ticket request.

## Constructor Details

### TicketState

public TicketState(@Nullable String sessionId, @Nonnull String principalName, @Nonnull Instant authnInstant, @Nonnull String authnMethod)
Creates a new instance with required fields.

Parameters:
  `sessionId` - ID of the session in which the ticket was created
  `principalName` - canonical authenticated principal name
  `authnInstant` - instant at which the principal authenticated
  `authnMethod` - principal authentication method ID/name/description

## Method Details

### getSessionId

@Nullable public String getSessionId()
Get the ID of the session in which the ticket was created.

Returns:
  IdP session ID.

### getPrincipalName

@Nonnull public String getPrincipalName()
Get the canonical authenticated principal name.

Returns:
  Canonical principal.

### getAuthenticationInstant

@Nonnull public Instant getAuthenticationInstant()
Get the instant at which the principal authenticated.

Returns:
  Principal authentication instant.

### getAuthenticationMethod

@Nonnull public String getAuthenticationMethod()
Get the principal authentication method ID/name/description.

Returns:
  Principal authentication method.

### getConsentedAttributeIds

@Nullable @Unmodifiable @NotLive public Set<String> getConsentedAttributeIds()
Get the attribute IDs that were consented to during the request.

Returns:
  immutable set of attribute IDs
Since:
  4.2.0

### setConsentedAttributeIds

public void setConsentedAttributeIds(@Nullable Collection<String> attributeIds)
Set the attribute IDs that were consented to during the request.

Parameters:
  `attributeIds` - attribute IDs
Since:
  4.2.0

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`