Class RevocationCache

    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Logger.
      • strict

        private boolean strict
        Flag controlling behavior on storage failure.
      • expires

        @Nonnull
        @Positive
        private Duration expires
        Default lifetime of revocation entry. Default value: 6 hours
    • Constructor Detail

      • RevocationCache

        public RevocationCache()
        Constructor.
    • Method Detail

      • setEntryExpiration

        public void setEntryExpiration​(@Positive
                                       Duration entryExpiration)
        Set the default revocation entry expiration.
        Parameters:
        entryExpiration - lifetime of an revocation entry in milliseconds
      • setStorage

        public void setStorage​(@Nonnull
                               StorageService storageService)
        Set the backing store for the cache.
        Parameters:
        storageService - backing store to use
      • isStrict

        public boolean isStrict()
        Get the strictness flag.
        Returns:
        true iff we should treat storage failures as a replay
      • setStrict

        public void setStrict​(boolean flag)
        Set the strictness flag.
        Parameters:
        flag - true iff we should treat storage failures as a replay
      • revoke

        public boolean revoke​(@Nonnull @NotEmpty
                              String context,
                              @Nonnull @NotEmpty
                              String s)
        Invokes revoke(String, String, Duration) with a default expiration parameter.
        Parameters:
        context - a context label to subdivide the cache
        s - value to revoke
        Returns:
        true if value has successfully been listed as revoked in the cache.
      • revoke

        public boolean revoke​(@Nonnull @NotEmpty
                              String context,
                              @Nonnull @NotEmpty
                              String s,
                              @Nonnull
                              Duration exp)
        Returns true if the value is successfully revoked. If value has already been revoked, expiration is updated.
        Parameters:
        context - a context label to subdivide the cache
        s - value to revoke
        exp - entry expiration
        Returns:
        true if value has successfully been listed as revoked in the cache.
      • isRevoked

        public boolean isRevoked​(@Nonnull @NotEmpty
                                 String context,
                                 @Nonnull @NotEmpty
                                 String s)
        Returns false if the value has successfully been confirmed as not revoked.
        Parameters:
        context - a context label to subdivide the cache
        s - value to revoke
        Returns:
        false if the check value is not found in the cache