Package io.dropwizard.auth
Class AuthFilter.AuthFilterBuilder<C,P extends Principal,T extends AuthFilter<C,P>>
- java.lang.Object
-
- io.dropwizard.auth.AuthFilter.AuthFilterBuilder<C,P,T>
-
- Type Parameters:
C- the type of credentials that the filter acceptsP- the type of the principal that the filter accepts
- Direct Known Subclasses:
BasicCredentialAuthFilter.Builder,OAuthCredentialAuthFilter.Builder
- Enclosing class:
- AuthFilter<C,P extends Principal>
public abstract static class AuthFilter.AuthFilterBuilder<C,P extends Principal,T extends AuthFilter<C,P>> extends Object
Abstract builder for auth filters.
-
-
Constructor Summary
Constructors Constructor Description AuthFilterBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TbuildAuthFilter()Builds an instance of the filter with a provided authenticator, an authorizer, a prefix, and a realm.protected abstract TnewInstance()AuthFilter.AuthFilterBuilder<C,P,T>setAuthenticator(Authenticator<C,P> authenticator)Sets the given authenticatorAuthFilter.AuthFilterBuilder<C,P,T>setAuthorizer(Authorizer<P> authorizer)Sets the given authorizerAuthFilter.AuthFilterBuilder<C,P,T>setPrefix(String prefix)Sets the given prefixAuthFilter.AuthFilterBuilder<C,P,T>setRealm(String realm)Sets the given realmAuthFilter.AuthFilterBuilder<C,P,T>setUnauthorizedHandler(UnauthorizedHandler unauthorizedHandler)Sets the given unauthorized handler
-
-
-
Method Detail
-
setRealm
public AuthFilter.AuthFilterBuilder<C,P,T> setRealm(String realm)
Sets the given realm- Parameters:
realm- a realm- Returns:
- the current builder
-
setPrefix
public AuthFilter.AuthFilterBuilder<C,P,T> setPrefix(String prefix)
Sets the given prefix- Parameters:
prefix- a prefix- Returns:
- the current builder
-
setAuthorizer
public AuthFilter.AuthFilterBuilder<C,P,T> setAuthorizer(Authorizer<P> authorizer)
Sets the given authorizer- Parameters:
authorizer- anAuthorizer- Returns:
- the current builder
-
setAuthenticator
public AuthFilter.AuthFilterBuilder<C,P,T> setAuthenticator(Authenticator<C,P> authenticator)
Sets the given authenticator- Parameters:
authenticator- anAuthenticator- Returns:
- the current builder
-
setUnauthorizedHandler
public AuthFilter.AuthFilterBuilder<C,P,T> setUnauthorizedHandler(UnauthorizedHandler unauthorizedHandler)
Sets the given unauthorized handler- Parameters:
unauthorizedHandler- anUnauthorizedHandler- Returns:
- the current builder
-
buildAuthFilter
public T buildAuthFilter()
Builds an instance of the filter with a provided authenticator, an authorizer, a prefix, and a realm.- Returns:
- a new instance of the filter
-
newInstance
protected abstract T newInstance()
-
-