com.holonplatform.auth

## Interface Realm.Builder

- Enclosing interface:
    Realm

      public static interface Realm.Builder

  Builder to create `Realm` instances.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `default <T extends AuthenticationToken> Realm.Builder` | `authenticator(Authenticator<T> authenticator)` Deprecated. Use `withAuthenticator(Authenticator)`
    `default <P extends Permission> Realm.Builder` | `authorizer(Authorizer<P> authorizer)` Deprecated. Use `withAuthorizer(Authorizer)`
    `Realm` | `build()` Build `Realm` instance
    `default Realm.Builder` | `listener(Authentication.AuthenticationListener authenticationListener)` Deprecated. Use withAuthenticationListener(AuthenticationListener)
    `Realm.Builder` | `name(String name)` Set Realm name
    `default Realm.Builder` | `resolver(AuthenticationToken.AuthenticationTokenResolver<?> authenticationTokenResolver)` Deprecated. Use withResolver(AuthenticationTokenResolver)
    `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.

- - ### Method Detail

    - #### name

          Realm.Builder name(String name)

      Set Realm name
      Parameters:
        `name` - Realm name to set
      Returns:
        this

    - #### withAuthenticator

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

      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)`.

      Type Parameters:
        `T` - Authentication token type
      Parameters:
        `authenticator` - The `Authenticator` to add (not null)
      Returns:
        this

    - #### authenticator

          @Deprecated
          default <T extends AuthenticationToken> Realm.Builder authenticator(Authenticator<T> authenticator)

      Deprecated. Use `withAuthenticator(Authenticator)`
      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)`.

      Type Parameters:
        `T` - Authentication token type
      Parameters:
        `authenticator` - Authenticator to add
      Returns:
        this

    - #### withResolver

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

      Add an `AuthenticationToken.AuthenticationTokenResolver` to translate `Message`s into `AuthenticationToken`s.
      Parameters:
        `authenticationTokenResolver` - Resolver to add
      Returns:
        this

    - #### resolver

          @Deprecated
          default Realm.Builder resolver(AuthenticationToken.AuthenticationTokenResolver<?> authenticationTokenResolver)

      Deprecated. Use withResolver(AuthenticationTokenResolver)
      Add an `AuthenticationToken.AuthenticationTokenResolver` to translate `Message`s into `AuthenticationToken`s.
      Parameters:
        `authenticationTokenResolver` - The `AuthenticationToken.AuthenticationTokenResolver` to add (not null)
      Returns:
        this

    - #### withAuthorizer

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

      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.

      Type Parameters:
        `P` - Permission type
      Parameters:
        `authorizer` - Authorizer to add
      Returns:
        this

    - #### authorizer

          @Deprecated
          default <P extends Permission> Realm.Builder authorizer(Authorizer<P> authorizer)

      Deprecated. Use `withAuthorizer(Authorizer)`
      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.

      Type Parameters:
        `P` - Permission type
      Parameters:
        `authorizer` - The `Authorizer` to add (not null)
      Returns:
        this

    - #### withDefaultAuthorizer

          Realm.Builder withDefaultAuthorizer()

      Register the default `Authorizer`
      Returns:
        this
      See Also:
        `Authorizer.create()`

    - #### withAuthenticationListener

          Realm.Builder withAuthenticationListener(Authentication.AuthenticationListener authenticationListener)

      Register an `Authentication.AuthenticationListener` for authentication events
      Parameters:
        `authenticationListener` - The AuthenticationListener to register (not null)
      Returns:
        this

    - #### listener

          @Deprecated
          default Realm.Builder listener(Authentication.AuthenticationListener authenticationListener)

      Deprecated. Use withAuthenticationListener(AuthenticationListener)
      Register an `Authentication.AuthenticationListener` for authentication events
      Parameters:
        `authenticationListener` - The AuthenticationListener to register
      Returns:
        this

    - #### build

          Realm build()

      Build `Realm` instance
      Returns:
        Realm

Copyright © 2019 The Holon Platform. All rights reserved.