Class IxbusUserIdentifierCache

java.lang.Object
org.exoplatform.addons.ixbus.IxbusUserIdentifierCache

public class IxbusUserIdentifierCache extends Object
Remembers the ixbus identifier of each user, and for a limited time that a user has no ixbus account, so that ixbus is not asked again on every page a user without an account displays, while an account created later is still found once the duration has passed.
  • Constructor Details

    • IxbusUserIdentifierCache

      public IxbusUserIdentifierCache(long unknownDurationMs, LongSupplier clock)
  • Method Details

    • getIdentifier

      public String getIdentifier(String username)
      Returns:
      the cached identifier, or null when it is not known
    • putIdentifier

      public void putIdentifier(String username, String identifier)
    • isUnknown

      public boolean isUnknown(String username)
      Returns:
      true while the user is known to have no ixbus account
    • markUnknown

      public void markUnknown(String username)
      Marks the user as having no ixbus account. With a duration of 0 the mark expires at once, so the user is looked up again on the next call.