com.holonplatform.auth.internal

## Class DefaultRealm.RealmBuilder

- java.lang.Object
- - com.holonplatform.auth.internal.DefaultRealm.RealmBuilder

- All Implemented Interfaces:
    Realm.Builder
  Enclosing class:
    DefaultRealm

      public static class DefaultRealm.RealmBuilder
      extends Object
      implements Realm.Builder

  Default `Builder` implementation.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RealmBuilder()` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Realm` | `build()` Build `Realm` instance
    `Realm.Builder` | `name(String name)` Set Realm name
    `Realm.Builder` | `withAuthenticationListener(Authentication.AuthenticationListener authenticationListener)` Register an `Authentication.AuthenticationListener` for authentication events
    `<T extends AuthenticationToken> Realm.Builder` | `withAuthenticator(Authenticator<T> authenticator)` Register given `Authenticator` in Realm.
    `<P extends Permission> Realm.Builder` | `withAuthorizer(Authorizer<P> authorizer)` Register given `Authorizer` in Realm.
    `Realm.Builder` | `withDefaultAuthorizer()` Register the default `Authorizer`
    `Realm.Builder` | `withResolver(AuthenticationToken.AuthenticationTokenResolver<?> authenticationTokenResolver)` Add an `AuthenticationToken.AuthenticationTokenResolver` to translate `Message`s into `AuthenticationToken`s.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.auth.Realm.Builder

      `authenticator, authorizer, listener, resolver`

- - ### Constructor Detail

    - #### RealmBuilder

          public RealmBuilder()

      Constructor

  - ### Method Detail

    - #### name

          public Realm.Builder name(String name)

      Description copied from interface: `Realm.Builder`
      Set Realm name
      Specified by:
        `name` in interface `Realm.Builder`
      Parameters:
        `name` - Realm name to set
      Returns:
        this

    - #### withAuthenticator

          public <T extends AuthenticationToken> Realm.Builder withAuthenticator(Authenticator<T> authenticator)

      Description copied from interface: `Realm.Builder`
      Register given `Authenticator` in Realm.

      Registered Authenticators will be inspected in the order they were added to Realm to find the first one which is consistent with the `AuthenticationToken` type to process during authentication operations performed using `Authenticator.authenticate(AuthenticationToken)`.

      Specified by:
        `withAuthenticator` in interface `Realm.Builder`
      Type Parameters:
        `T` - Authentication token type
      Parameters:
        `authenticator` - The `Authenticator` to add (not null)
      Returns:
        this

    - #### withResolver

          public Realm.Builder withResolver(AuthenticationToken.AuthenticationTokenResolver<?> authenticationTokenResolver)

      Description copied from interface: `Realm.Builder`
      Add an `AuthenticationToken.AuthenticationTokenResolver` to translate `Message`s into `AuthenticationToken`s.
      Specified by:
        `withResolver` in interface `Realm.Builder`
      Parameters:
        `authenticationTokenResolver` - Resolver to add
      Returns:
        this

    - #### withAuthorizer

          public <P extends Permission> Realm.Builder withAuthorizer(Authorizer<P> authorizer)

      Description copied from interface: `Realm.Builder`
      Register given `Authorizer` in Realm.

      Registered Authorizers will be inspected in the order they were added to Realm to find the first one which is consistent with the `Permission` type to process during authorization checking performed using `isPermitted` methods.

      Specified by:
        `withAuthorizer` in interface `Realm.Builder`
      Type Parameters:
        `P` - Permission type
      Parameters:
        `authorizer` - Authorizer to add
      Returns:
        this

    - #### withDefaultAuthorizer

          public Realm.Builder withDefaultAuthorizer()

      Description copied from interface: `Realm.Builder`
      Register the default `Authorizer`
      Specified by:
        `withDefaultAuthorizer` in interface `Realm.Builder`
      Returns:
        this
      See Also:
        `Authorizer.create()`

    - #### withAuthenticationListener

          public Realm.Builder withAuthenticationListener(Authentication.AuthenticationListener authenticationListener)

      Description copied from interface: `Realm.Builder`
      Register an `Authentication.AuthenticationListener` for authentication events
      Specified by:
        `withAuthenticationListener` in interface `Realm.Builder`
      Parameters:
        `authenticationListener` - The AuthenticationListener to register (not null)
      Returns:
        this

    - #### build

          public Realm build()

      Description copied from interface: `Realm.Builder`
      Build `Realm` instance
      Specified by:
        `build` in interface `Realm.Builder`
      Returns:
        Realm

Copyright © 2019 The Holon Platform. All rights reserved.