Package org.saidone.unrest.client
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.
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 TypeMethodDescriptiondefault voidinvalidate(String expired) Invalidates a rejected ticket without discarding a newer ticket obtained by another call.static TicketProviderCreates a provider that always returns the supplied ticket and cannot renew it.ticket()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
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
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
-