Class List Method List File List

# Class: VertxAuthMongo::MongoAuth

Inherits:
  VertxAuthCommon::AuthProvider
  - Object
  - VertxAuthCommon::AuthProvider
  - VertxAuthMongo::MongoAuth
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb

## Class Method Summary (collapse)

- + (Object) create(mongoClient = nil, config = nil)

## Instance Method Summary (collapse)

- - (Object) authenticate(arg0 = nil)
- - (Object) get_collection_name
- - (Object) get_hash_strategy
- - (Object) get_password_credential_field
- - (Object) get_password_field
- - (Object) get_permission_field
- - (Object) get_role_field
- - (Object) get_salt_field
- - (Object) get_username_credential_field
- - (Object) get_username_field
- - (MongoAuth) initialize(j_del) constructor
  A new instance of MongoAuth.
- - (Object) insert_user(username = nil, password = nil, roles = nil, permissions = nil)
- - (Object) j_del
- - (Object) set_collection_name(collectionName = nil)
- - (Object) set_hash_strategy(hashStrategy = nil)
- - (Object) set_password_credential_field(fieldName = nil)
- - (Object) set_password_field(fieldName = nil)
- - (Object) set_permission_field(fieldName = nil)
- - (Object) set_role_field(fieldName = nil)
- - (Object) set_salt_field(fieldName = nil)
- - (Object) set_username_credential_field(fieldName = nil)
- - (Object) set_username_field(fieldName = nil)

## Constructor Details

### - (`MongoAuth`) initialize(j_del)

Returns a new instance of MongoAuth

    12
    13
    14
    15
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 12

    def initialize(j_del)
      super(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(mongoClient = nil, config = nil)

Raises:

- (`ArgumentError`)

    40
    41
    42
    43
    44
    45
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 40

    def self.create(mongoClient=nil,config=nil)
      if mongoClient.class.method_defined?(:j_del) && config.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthMongo::MongoAuth.java_method(:create, [Java::IoVertxExtMongo::MongoClient.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(mongoClient.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxAuthMongo::MongoAuth)
      end
      raise ArgumentError, "Invalid arguments when calling create(mongoClient,config)"
    end

## Instance Method Details

### - (`Object`) authenticate(arg0 = nil)

Raises:

- (`ArgumentError`)

    24
    25
    26
    27
    28
    29
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 24

    def authenticate(arg0=nil)
      if arg0.class == Hash && block_given?
        return @j_del.java_method(:authenticate, [Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_json_object(arg0),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxAuthCommon::User) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling authenticate(arg0)"
    end

### - (`Object`) get_collection_name

Raises:

- (`ArgumentError`)

    133
    134
    135
    136
    137
    138
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 133

    def get_collection_name
      if !block_given?
        return @j_del.java_method(:getCollectionName, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling get_collection_name()"
    end

### - (`Object`) get_hash_strategy

Raises:

- (`ArgumentError`)

    212
    213
    214
    215
    216
    217
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 212

    def get_hash_strategy
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getHashStrategy, []).call(),::VertxAuthMongo::HashStrategy)
      end
      raise ArgumentError, "Invalid arguments when calling get_hash_strategy()"
    end

### - (`Object`) get_password_credential_field

Raises:

- (`ArgumentError`)

    185
    186
    187
    188
    189
    190
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 185

    def get_password_credential_field
      if !block_given?
        return @j_del.java_method(:getPasswordCredentialField, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling get_password_credential_field()"
    end

### - (`Object`) get_password_field

Raises:

- (`ArgumentError`)

    149
    150
    151
    152
    153
    154
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 149

    def get_password_field
      if !block_given?
        return @j_del.java_method(:getPasswordField, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling get_password_field()"
    end

### - (`Object`) get_permission_field

Raises:

- (`ArgumentError`)

    167
    168
    169
    170
    171
    172
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 167

    def get_permission_field
      if !block_given?
        return @j_del.java_method(:getPermissionField, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling get_permission_field()"
    end

### - (`Object`) get_role_field

Raises:

- (`ArgumentError`)

    158
    159
    160
    161
    162
    163
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 158

    def get_role_field
      if !block_given?
        return @j_del.java_method(:getRoleField, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling get_role_field()"
    end

### - (`Object`) get_salt_field

Raises:

- (`ArgumentError`)

    194
    195
    196
    197
    198
    199
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 194

    def get_salt_field
      if !block_given?
        return @j_del.java_method(:getSaltField, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling get_salt_field()"
    end

### - (`Object`) get_username_credential_field

Raises:

- (`ArgumentError`)

    176
    177
    178
    179
    180
    181
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 176

    def get_username_credential_field
      if !block_given?
        return @j_del.java_method(:getUsernameCredentialField, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling get_username_credential_field()"
    end

### - (`Object`) get_username_field

Raises:

- (`ArgumentError`)

    141
    142
    143
    144
    145
    146
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 141

    def get_username_field
      if !block_given?
        return @j_del.java_method(:getUsernameField, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling get_username_field()"
    end

### - (`Object`) insert_user(username = nil, password = nil, roles = nil, permissions = nil)

Raises:

- (`ArgumentError`)

    225
    226
    227
    228
    229
    230
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 225

    def insert_user(username=nil,password=nil,roles=nil,permissions=nil)
      if username.class == String && password.class == String && roles.class == Array && permissions.class == Array && block_given?
        return @j_del.java_method(:insertUser, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::JavaUtil::List.java_class,Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(username,password,roles.map { |element| element },permissions.map { |element| element },(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling insert_user(username,password,roles,permissions)"
    end

### - (`Object`) j_del

    18
    19
    20
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 18

    def j_del
      @j_del
    end

### - (`Object`) set_collection_name(collectionName = nil)

Raises:

- (`ArgumentError`)

    49
    50
    51
    52
    53
    54
    55
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 49

    def set_collection_name(collectionName=nil)
      if collectionName.class == String && !block_given?
        @j_del.java_method(:setCollectionName, [Java::java.lang.String.java_class]).call(collectionName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_collection_name(collectionName)"
    end

### - (`Object`) set_hash_strategy(hashStrategy = nil)

Raises:

- (`ArgumentError`)

    203
    204
    205
    206
    207
    208
    209
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 203

    def set_hash_strategy(hashStrategy=nil)
      if hashStrategy.class.method_defined?(:j_del) && !block_given?
        @j_del.java_method(:setHashStrategy, [Java::IoVertxExtAuthMongo::HashStrategy.java_class]).call(hashStrategy.j_del)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_hash_strategy(hashStrategy)"
    end

### - (`Object`) set_password_credential_field(fieldName = nil)

Raises:

- (`ArgumentError`)

    113
    114
    115
    116
    117
    118
    119
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 113

    def set_password_credential_field(fieldName=nil)
      if fieldName.class == String && !block_given?
        @j_del.java_method(:setPasswordCredentialField, [Java::java.lang.String.java_class]).call(fieldName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_password_credential_field(fieldName)"
    end

### - (`Object`) set_password_field(fieldName = nil)

Raises:

- (`ArgumentError`)

    69
    70
    71
    72
    73
    74
    75
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 69

    def set_password_field(fieldName=nil)
      if fieldName.class == String && !block_given?
        @j_del.java_method(:setPasswordField, [Java::java.lang.String.java_class]).call(fieldName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_password_field(fieldName)"
    end

### - (`Object`) set_permission_field(fieldName = nil)

Raises:

- (`ArgumentError`)

    91
    92
    93
    94
    95
    96
    97
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 91

    def set_permission_field(fieldName=nil)
      if fieldName.class == String && !block_given?
        @j_del.java_method(:setPermissionField, [Java::java.lang.String.java_class]).call(fieldName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_permission_field(fieldName)"
    end

### - (`Object`) set_role_field(fieldName = nil)

Raises:

- (`ArgumentError`)

    80
    81
    82
    83
    84
    85
    86
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 80

    def set_role_field(fieldName=nil)
      if fieldName.class == String && !block_given?
        @j_del.java_method(:setRoleField, [Java::java.lang.String.java_class]).call(fieldName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_role_field(fieldName)"
    end

### - (`Object`) set_salt_field(fieldName = nil)

Raises:

- (`ArgumentError`)

    124
    125
    126
    127
    128
    129
    130
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 124

    def set_salt_field(fieldName=nil)
      if fieldName.class == String && !block_given?
        @j_del.java_method(:setSaltField, [Java::java.lang.String.java_class]).call(fieldName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_salt_field(fieldName)"
    end

### - (`Object`) set_username_credential_field(fieldName = nil)

Raises:

- (`ArgumentError`)

    102
    103
    104
    105
    106
    107
    108
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 102

    def set_username_credential_field(fieldName=nil)
      if fieldName.class == String && !block_given?
        @j_del.java_method(:setUsernameCredentialField, [Java::java.lang.String.java_class]).call(fieldName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_username_credential_field(fieldName)"
    end

### - (`Object`) set_username_field(fieldName = nil)

Raises:

- (`ArgumentError`)

    59
    60
    61
    62
    63
    64
    65
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-mongo/mongo_auth.rb', line 59

    def set_username_field(fieldName=nil)
      if fieldName.class == String && !block_given?
        @j_del.java_method(:setUsernameField, [Java::java.lang.String.java_class]).call(fieldName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_username_field(fieldName)"
    end