public static class DefaultAuthentication.AuthenticationBuilder extends Object implements Authentication.Builder
Authentication.Builder
implementation.Constructor and Description |
---|
AuthenticationBuilder(String principalName)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Authentication |
build()
Create Authentication instance
|
Authentication.Builder |
root(boolean root)
Set whether authentication is considered a
root principal, for which permission checking is
always skipped, assuming that any permission is granted. |
Authentication.Builder |
scheme(String scheme)
Set the authentication scheme with which this authentication was produced.
|
<T> Authentication.Builder |
withParameter(ConfigProperty<T> property,
T value)
Add an authentication parameter using a
ConfigProperty an ConfigProperty.getKey() as
parameter name |
Authentication.Builder |
withParameter(String name,
Object value)
Add an authentication parameter.
|
Authentication.Builder |
withPermission(Permission permission)
Add a permission granted to Authentication
|
Authentication.Builder |
withPermission(String permission)
Add a permission granted to Authentication using String representation.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parameter, parameter, permission, permission
public AuthenticationBuilder(String principalName)
principalName
- Principal name (not null)public Authentication.Builder scheme(String scheme)
Authentication.Builder
scheme
in interface Authentication.Builder
scheme
- Authentication scheme namepublic Authentication.Builder root(boolean root)
Authentication.Builder
root
principal, for which permission checking is
always skipped, assuming that any permission is granted.root
in interface Authentication.Builder
root
- true
to set authentication as root
principalpublic Authentication.Builder withParameter(String name, Object value)
Authentication.Builder
withParameter
in interface Authentication.Builder
name
- Parameter name (not null)value
- Parameter valuepublic <T> Authentication.Builder withParameter(ConfigProperty<T> property, T value)
Authentication.Builder
ConfigProperty
an ConfigProperty.getKey()
as
parameter namewithParameter
in interface Authentication.Builder
T
- Property typeproperty
- ConfigProperty to obtain parameter name (not null)value
- Parameter valuepublic Authentication.Builder withPermission(Permission permission)
Authentication.Builder
withPermission
in interface Authentication.Builder
permission
- Permission to add (not null)public Authentication.Builder withPermission(String permission)
Authentication.Builder
withPermission
in interface Authentication.Builder
permission
- Permission string to add (not null)public Authentication build()
Authentication.Builder
build
in interface Authentication.Builder
Copyright © 2019 The Holon Platform. All rights reserved.