Class AbstractProtocolConfiguration

All Implemented Interfaces:
ConditionalProfileConfiguration, ProfileConfiguration, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent
Direct Known Subclasses:
LoginConfiguration, ProxyConfiguration, ValidateConfiguration

public abstract class AbstractProtocolConfiguration
extends AbstractConditionalProfileConfiguration
implements InitializableComponent
Base class for CAS protocol configuration.
  • Field Details

    • PROTOCOL_URI

      @Nonnull @NotEmpty public static final String PROTOCOL_URI
      CAS base protocol URI.
      See Also:
      Constant Field Values
    • DEFAULT_TICKET_VALIDITY_PERIOD

      @Nonnull public static final Duration DEFAULT_TICKET_VALIDITY_PERIOD
      Default ticket validity.
    • ticketValidityPeriodLookupStrategy

      @Nonnull private Function<ProfileRequestContext,​Duration> ticketValidityPeriodLookupStrategy
      Lookup function to supply ticketValidityPeriod property.
    • resolveAttributesPredicate

      @Nonnull private Predicate<ProfileRequestContext> resolveAttributesPredicate
      Whether attributes should be resolved in the course of the profile.
    • defaultSecurityConfiguration

      @Nonnull private final SecurityConfiguration defaultSecurityConfiguration
      Holds default security config object to use.
  • Constructor Details

    • AbstractProtocolConfiguration

      public AbstractProtocolConfiguration​(@Nonnull @NotEmpty String profileId)
      Creates a new configuration instance.
      Parameters:
      profileId - Unique profile identifier
  • Method Details

    • getSecurityConfiguration

      @Nullable public SecurityConfiguration getSecurityConfiguration​(@Nullable ProfileRequestContext profileRequestContext)
      Get the SecurityConfiguration to use with this profile.
      Specified by:
      getSecurityConfiguration in interface ProfileConfiguration
      Overrides:
      getSecurityConfiguration in class AbstractProfileConfiguration
      Parameters:
      profileRequestContext - current profile request context
      Returns:
      security configuration to use with this profile
    • getTicketValidityPeriod

      @Nonnull public Duration getTicketValidityPeriod​(@Nullable ProfileRequestContext profileRequestContext)
      Get ticket validity period.
      Parameters:
      profileRequestContext - current profile request context
      Returns:
      ticket validity period
    • setTicketValidityPeriod

      public void setTicketValidityPeriod​(@Nonnull Duration ticketTTL)
      Sets the ticket validity period.
      Parameters:
      ticketTTL - ticket validity period
    • setTicketValidityPeriodLookupStrategy

      public void setTicketValidityPeriodLookupStrategy​(@Nonnull Function<ProfileRequestContext,​Duration> strategy)
      Set a lookup strategy for the ticket validity period.
      Parameters:
      strategy - lookup strategy
      Since:
      3.3.0
    • isResolveAttributes

      public boolean isResolveAttributes​(@Nullable ProfileRequestContext profileRequestContext)
      Get whether attributes should be resolved during the profile (defaults to true).
      Parameters:
      profileRequestContext - current profile request context
      Returns:
      true iff attributes should be resolved
    • setResolveAttributes

      public void setResolveAttributes​(boolean flag)
      Set whether attributes should be resolved during the profile.
      Parameters:
      flag - flag to set
    • setResolveAttributesPredicate

      public void setResolveAttributesPredicate​(@Nonnull Predicate<ProfileRequestContext> condition)
      Set a condition to determine whether attributes should be resolved during the profile.
      Parameters:
      condition - condition to set
      Since:
      3.3.0
    • getDefaultTicketPrefix

      @Nonnull @NotEmpty protected abstract String getDefaultTicketPrefix()
      Get default ticket prefix.
      Returns:
      prefix
    • getDefaultTicketLength

      protected abstract int getDefaultTicketLength()
      Get default ticket length.
      Returns:
      length