Package io.vertx.ext.auth.authorization
Interface Authorizations
-
public interface AuthorizationsRepresents a cache map of authorizations per provider. Authorizations are immutable and can be shared between users.- Author:
- Stephane Bastian
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Authorizationsclear()Clears the authorizations.booleancontains(String providerId)Logical check if the this object contains the given provider idAuthorizationsforEach(String providerId, Consumer<Authorization> consumer)Walk all the authorizations for the given provider and call the consumer for each authorization.AuthorizationsforEach(BiConsumer<String,Authorization> consumer)Walk all the authorizations and call the consumer for each authorization.booleanisEmpty()trueif the authorizations contains at least one provider.default Authorizationsput(String providerId, Authorization... authorizations)Replaces the current authorizations with the given authorizations for the given provider.Authorizationsput(String providerId, Set<Authorization> authorizations)Replaces the current authorizations with the given authorizations for the given provider.AuthorizationsputAll(Map<String,Set<Authorization>> authorizations)Replaces the current authorizations with the given authorizations.booleanverify(Authorization resolvedAuthorization)Verifies that the given authorization is present in the authorizations.
-
-
-
Method Detail
-
putAll
Authorizations putAll(Map<String,Set<Authorization>> authorizations)
Replaces the current authorizations with the given authorizations. The map is expected to be immutable.- Parameters:
authorizations- the new map of authorizations.- Returns:
- fluent self.
-
put
Authorizations put(String providerId, Set<Authorization> authorizations)
Replaces the current authorizations with the given authorizations for the given provider.- Parameters:
providerId- the provider.authorizations- the new map of authorizations.nullis equivalent to remove all authorizations for the given provider.- Returns:
- fluent self.
-
put
default Authorizations put(String providerId, Authorization... authorizations)
Replaces the current authorizations with the given authorizations for the given provider.- Parameters:
providerId- the provider.authorizations- the new array of authorizations.- Returns:
- fluent self.
-
isEmpty
boolean isEmpty()
trueif the authorizations contains at least one provider.
-
clear
Authorizations clear()
Clears the authorizations.
-
contains
boolean contains(String providerId)
Logical check if the this object contains the given provider id- Parameters:
providerId- the provider to search for.- Returns:
truewhen the provider is present.
-
verify
boolean verify(Authorization resolvedAuthorization)
Verifies that the given authorization is present in the authorizations.- Parameters:
resolvedAuthorization- the authorization to verify.- Returns:
trueif the authorization is present.
-
forEach
Authorizations forEach(BiConsumer<String,Authorization> consumer)
Walk all the authorizations and call the consumer for each authorization.- Parameters:
consumer- the consumer to call.
-
forEach
Authorizations forEach(String providerId, Consumer<Authorization> consumer)
Walk all the authorizations for the given provider and call the consumer for each authorization.- Parameters:
consumer- the consumer to call.
-
-