Interface TicketProvider

All Known Implementing Classes:
AuthenticationServiceClient
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TicketProvider
Supplies the Alfresco authentication ticket sent to the gRPC module in the alfresco-ticket header: every call runs as the user the ticket belongs to. Share one provider between service clients so that authentication and ticket renewal are coordinated.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    invalidate(String expired)
    Invalidates a rejected ticket without discarding a newer ticket obtained by another call.
    of(String ticket)
    Creates a provider that always returns the supplied ticket and cannot renew it.
    Returns the current ticket, authenticating lazily when necessary.
  • Method Details

    • ticket

      String ticket()
      Returns the current ticket, authenticating lazily when necessary.
      Returns:
      the repository ticket to attach to the next RPC
    • invalidate

      default void invalidate(String expired)
      Invalidates a rejected ticket without discarding a newer ticket obtained by another call. The default implementation retains the fixed ticket; clients do not retry with an unchanged value.
      Parameters:
      expired - ticket rejected by the repository
    • of

      static TicketProvider of(String ticket)
      Creates a provider that always returns the supplied ticket and cannot renew it.
      Parameters:
      ticket - existing Alfresco repository ticket
      Returns:
      a fixed-ticket provider reusable by all service clients