Class CachingPrincipalAttributesRepository

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.AutoCloseable, org.apereo.cas.authentication.principal.RegisteredServicePrincipalAttributesRepository

    public class CachingPrincipalAttributesRepository
    extends AbstractPrincipalAttributesRepository
    Wrapper around an attribute repository where attributes cached for a configurable period based on google guava's caching library.
    Since:
    4.2
    See Also:
    Serialized Form
    • Field Detail

      • expiration

        protected long expiration
        The expiration time.
      • timeUnit

        protected java.lang.String timeUnit
        Expiration time unit.
    • Constructor Detail

      • CachingPrincipalAttributesRepository

        public CachingPrincipalAttributesRepository​(java.lang.String timeUnit,
                                                    long expiryDuration)
    • Method Detail

      • getAttributes

        public java.util.Map<java.lang.String,​java.util.List<java.lang.Object>> getAttributes​(org.apereo.cas.authentication.principal.Principal principal,
                                                                                                    org.apereo.cas.services.RegisteredService registeredService)
        Specified by:
        getAttributes in interface org.apereo.cas.authentication.principal.RegisteredServicePrincipalAttributesRepository
        Specified by:
        getAttributes in class AbstractPrincipalAttributesRepository
      • update

        public void update​(java.lang.String id,
                           java.util.Map<java.lang.String,​java.util.List<java.lang.Object>> attributes,
                           org.apereo.cas.services.RegisteredService registeredService)
      • fetchCachedPrincipalAttributes

        protected java.util.Map<java.lang.String,​java.util.List<java.lang.Object>> fetchCachedPrincipalAttributes​(org.apereo.cas.authentication.principal.Principal principal,
                                                                                                                        org.apereo.cas.services.RegisteredService registeredService)
        Gets cached principal attributes.
        Parameters:
        principal - the principal
        registeredService - the registered service
        Returns:
        the cached principal attributes