io.vertx.rxjava.ext.auth.mongo

## Class MongoAuth

- java.lang.Object
- - io.vertx.rxjava.ext.auth.AuthProvider
  - - io.vertx.rxjava.ext.auth.mongo.MongoAuth

-     public class MongoAuth
      extends AuthProvider

  An extension of AuthProvider which is using as store

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TypeArg<MongoAuth>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MongoAuth(MongoAuth delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MongoAuth` | `create(MongoClient mongoClient, JsonObject config)` Creates an instance of MongoAuth by using the given and configuration object.
    `String` | `getCollectionName()` The name of the collection used to store User objects inside.
    `MongoAuth` | `getDelegate()`
    `HashStrategy` | `getHashStrategy()` The HashStrategy which is used by the current instance
    `String` | `getPasswordCredentialField()` Get the name of the field to be used as property for the password of credentials in the method `AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)`.
    `String` | `getPasswordField()` Get the name of the field to be used for the password Defaults to `MongoAuth`
    `String` | `getPermissionField()` Get the name of the field to be used for the permissions.
    `String` | `getRoleField()` Get the name of the field to be used for the roles.
    `String` | `getSaltField()` Get the name of the field to be used for the salt.
    `String` | `getUsernameCredentialField()` Get the name of the field to be used as property for the username in the method `AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)`.
    `String` | `getUsernameField()` Get the name of the field to be used for the username.
    `void` | `insertUser(String username, String password, List<String> roles, List<String> permissions, Handler<AsyncResult<String>> resultHandler)` Insert a new user into mongo in the convenient way
    `rx.Observable<String>` | `insertUserObservable(String username, String password, List<String> roles, List<String> permissions)` Deprecated. use `rxInsertUser(java.lang.String, java.lang.String, java.util.List<java.lang.String>, java.util.List<java.lang.String>)` instead
    `static MongoAuth` | `newInstance(MongoAuth arg)`
    `rx.Single<String>` | `rxInsertUser(String username, String password, List<String> roles, List<String> permissions)` Insert a new user into mongo in the convenient way
    `MongoAuth` | `setCollectionName(String collectionName)` Set the name of the collection to be used.
    `MongoAuth` | `setHashStrategy(HashStrategy hashStrategy)` The HashStrategy which is used by the current instance
    `MongoAuth` | `setPasswordCredentialField(String fieldName)` Set the name of the field to be used as property for the password of credentials in the method `AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)`.
    `MongoAuth` | `setPasswordField(String fieldName)` Set the name of the field to be used for the password Defaults to `MongoAuth`
    `MongoAuth` | `setPermissionField(String fieldName)` Set the name of the field to be used for the permissions.
    `MongoAuth` | `setRoleField(String fieldName)` Set the name of the field to be used for the roles.
    `MongoAuth` | `setSaltField(String fieldName)` Set the name of the field to be used for the salt.
    `MongoAuth` | `setUsernameCredentialField(String fieldName)` Set the name of the field to be used as property for the username in the method `AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)`.
    `MongoAuth` | `setUsernameField(String fieldName)` Set the name of the field to be used for the username.

    - ### Methods inherited from class io.vertx.rxjava.ext.auth.AuthProvider

      `authenticate, authenticateObservable, newInstance, rxAuthenticate`

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

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

- - ### Field Detail

    - #### __TYPE_ARG

          public static final TypeArg<MongoAuth> __TYPE_ARG

  - ### Constructor Detail

    - #### MongoAuth

          public MongoAuth(MongoAuth delegate)

  - ### Method Detail

    - #### getDelegate

          public MongoAuth getDelegate()

      Overrides:
        `getDelegate` in class `AuthProvider`

    - #### create

          public static MongoAuth create(MongoClient mongoClient,
                                         JsonObject config)

      Creates an instance of MongoAuth by using the given and configuration object. An example for a configuration object:

           JsonObject js = new JsonObject();
           js.put(MongoAuth.PROPERTY_COLLECTION_NAME, createCollectionName(MongoAuth.DEFAULT_COLLECTION_NAME));

      Parameters:
        `mongoClient` - an instance of to be used for data storage and retrival
        `config` - the configuration object for the current instance. By this
      Returns:
        the created instance of `MongoAuth`s

    - #### setCollectionName

          public MongoAuth setCollectionName(String collectionName)

      Set the name of the collection to be used. Defaults to `MongoAuth`
      Parameters:
        `collectionName` - the name of the collection to be used for storing and reading user data
      Returns:
        the current instance itself for fluent calls

    - #### setUsernameField

          public MongoAuth setUsernameField(String fieldName)

      Set the name of the field to be used for the username. Defaults to `MongoAuth`
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setPasswordField

          public MongoAuth setPasswordField(String fieldName)

      Set the name of the field to be used for the password Defaults to `MongoAuth`
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setRoleField

          public MongoAuth setRoleField(String fieldName)

      Set the name of the field to be used for the roles. Defaults to `MongoAuth`. Roles are expected to be saved as JsonArray
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setPermissionField

          public MongoAuth setPermissionField(String fieldName)

      Set the name of the field to be used for the permissions. Defaults to `MongoAuth`. Permissions are expected to be saved as JsonArray
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setUsernameCredentialField

          public MongoAuth setUsernameCredentialField(String fieldName)

      Set the name of the field to be used as property for the username in the method `AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)`. Defaults to `MongoAuth`
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setPasswordCredentialField

          public MongoAuth setPasswordCredentialField(String fieldName)

      Set the name of the field to be used as property for the password of credentials in the method `AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)`. Defaults to `MongoAuth`
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### setSaltField

          public MongoAuth setSaltField(String fieldName)

      Set the name of the field to be used for the salt. Only used when `HashStrategy.setSaltStyle(io.vertx.ext.auth.mongo.HashSaltStyle)` is set to
      Parameters:
        `fieldName` - the name of the field to be used
      Returns:
        the current instance itself for fluent calls

    - #### getCollectionName

          public String getCollectionName()

      The name of the collection used to store User objects inside. Defaults to `MongoAuth`
      Returns:
        the collectionName

    - #### getUsernameField

          public String getUsernameField()

      Get the name of the field to be used for the username. Defaults to `MongoAuth`
      Returns:
        the usernameField

    - #### getPasswordField

          public String getPasswordField()

      Get the name of the field to be used for the password Defaults to `MongoAuth`
      Returns:
        the passwordField

    - #### getRoleField

          public String getRoleField()

      Get the name of the field to be used for the roles. Defaults to `MongoAuth`. Roles are expected to be saved as JsonArray
      Returns:
        the roleField

    - #### getPermissionField

          public String getPermissionField()

      Get the name of the field to be used for the permissions. Defaults to `MongoAuth`. Permissions are expected to be saved as JsonArray
      Returns:
        the permissionField

    - #### getUsernameCredentialField

          public String getUsernameCredentialField()

      Get the name of the field to be used as property for the username in the method `AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)`. Defaults to `MongoAuth`
      Returns:
        the usernameCredentialField

    - #### getPasswordCredentialField

          public String getPasswordCredentialField()

      Get the name of the field to be used as property for the password of credentials in the method `AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)`. Defaults to `MongoAuth`
      Returns:
        the passwordCredentialField

    - #### getSaltField

          public String getSaltField()

      Get the name of the field to be used for the salt. Only used when `HashStrategy.setSaltStyle(io.vertx.ext.auth.mongo.HashSaltStyle)` is set to
      Returns:
        the saltField

    - #### setHashStrategy

          public MongoAuth setHashStrategy(HashStrategy hashStrategy)

      The HashStrategy which is used by the current instance
      Parameters:
        `hashStrategy` - the `HashStrategy` to be set
      Returns:
        the current instance itself for fluent calls

    - #### getHashStrategy

          public HashStrategy getHashStrategy()

      The HashStrategy which is used by the current instance
      Returns:
        the defined instance of `HashStrategy`

    - #### insertUser

          public void insertUser(String username,
                                 String password,
                                 List<String> roles,
                                 List<String> permissions,
                                 Handler<AsyncResult<String>> resultHandler)

      Insert a new user into mongo in the convenient way
      Parameters:
        `username` - the username to be set
        `password` - the passsword in clear text, will be adapted following the definitions of the defined `HashStrategy`
        `roles` - a list of roles to be set
        `permissions` - a list of permissions to be set
        `resultHandler` - the ResultHandler will be provided with the id of the generated record

    - #### insertUserObservable

          @Deprecated
          public rx.Observable<String> insertUserObservable(String username,
                                                                        String password,
                                                                        List<String> roles,
                                                                        List<String> permissions)

      Deprecated. use `rxInsertUser(java.lang.String, java.lang.String, java.util.List<java.lang.String>, java.util.List<java.lang.String>)` instead
      Insert a new user into mongo in the convenient way
      Parameters:
        `username` - the username to be set
        `password` - the passsword in clear text, will be adapted following the definitions of the defined `HashStrategy`
        `roles` - a list of roles to be set
        `permissions` - a list of permissions to be set
      Returns:

    - #### rxInsertUser

          public rx.Single<String> rxInsertUser(String username,
                                                String password,
                                                List<String> roles,
                                                List<String> permissions)

      Insert a new user into mongo in the convenient way
      Parameters:
        `username` - the username to be set
        `password` - the passsword in clear text, will be adapted following the definitions of the defined `HashStrategy`
        `roles` - a list of roles to be set
        `permissions` - a list of permissions to be set
      Returns:

    - #### newInstance

          public static MongoAuth newInstance(MongoAuth arg)

Copyright © 2017. All rights reserved.