Class List Method List File List

# Class: VertxAuthShiro::ShiroAuth

Inherits:
  VertxAuthCommon::AuthProvider
  - Object
  - VertxAuthCommon::AuthProvider
  - VertxAuthShiro::ShiroAuth
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-shiro/shiro_auth.rb

## Overview

Factory interface for creating Apache Shiro based VertxAuthCommon::AuthProvider instances.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxAuthShiro::ShiroAuth) create(param_1 = nil, param_2 = nil, param_3 = nil)
  Create a Shiro auth provider.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) authenticate(arg0 = nil) { ... }
- - (::VertxAuthShiro::ShiroAuth) set_role_prefix(rolePrefix = nil)
  Set the role prefix to distinguish from permissions when checking for isPermitted requests.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-shiro/shiro_auth.rb', line 21

    def @@j_api_type.accept?(obj)
      obj.class == ShiroAuth
    end

### + (`::VertxAuthShiro::ShiroAuth`) create(vertx, options) + (`::VertxAuthShiro::ShiroAuth`) create(vertx, realmType, config)

Create a Shiro auth provider

Overloads:

- + (`::VertxAuthShiro::ShiroAuth`) create(vertx, options)

  Parameters:

  - vertx (`::Vertx::Vertx`) —
    the Vert.x instance
  - options (`Hash`) —
    the Shiro configuration options
- + (`::VertxAuthShiro::ShiroAuth`) create(vertx, realmType, config)

  Parameters:

  - vertx (`::Vertx::Vertx`) —
    the Vert.x instance
  - realmType (`:PROPERTIES`, `:LDAP`) —
    the Shiro realm type
  - config (`Hash{String => Object}`) —
    the config

Returns:

- (`::VertxAuthShiro::ShiroAuth`) —
  the auth provider

Raises:

- (`ArgumentError`)

    54
    55
    56
    57
    58
    59
    60
    61
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-shiro/shiro_auth.rb', line 54

    def self.create(param_1=nil,param_2=nil,param_3=nil)
      if param_1.class.method_defined?(:j_del) && param_2.class == Hash && !block_given? && param_3 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthShiro::ShiroAuth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtAuthShiro::ShiroAuthOptions.java_class]).call(param_1.j_del,Java::IoVertxExtAuthShiro::ShiroAuthOptions.new(::Vertx::Util::Utils.to_json_object(param_2))),::VertxAuthShiro::ShiroAuth)
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Symbol && param_3.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthShiro::ShiroAuth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtAuthShiro::ShiroAuthRealmType.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(param_1.j_del,Java::IoVertxExtAuthShiro::ShiroAuthRealmType.valueOf(param_2.to_s),::Vertx::Util::Utils.to_json_object(param_3)),::VertxAuthShiro::ShiroAuth)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{param_1},#{param_2},#{param_3})"
    end

### + (`Object`) j_api_type

    30
    31
    32
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-shiro/shiro_auth.rb', line 30

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    33
    34
    35
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-shiro/shiro_auth.rb', line 33

    def self.j_class
      Java::IoVertxExtAuthShiro::ShiroAuth.java_class
    end

### + (`Object`) unwrap(obj)

    27
    28
    29
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-shiro/shiro_auth.rb', line 27

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    24
    25
    26
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-shiro/shiro_auth.rb', line 24

    def @@j_api_type.wrap(obj)
      ShiroAuth.new(obj)
    end

## Instance Method Details

### - (`void`) authenticate(arg0 = nil) { ... }

This method returns an undefined value.

Parameters:

- arg0 (`Hash{String => Object}`) (defaults to: `nil`)

Yields:

Raises:

- (`ArgumentError`)

    39
    40
    41
    42
    43
    44
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-shiro/shiro_auth.rb', line 39

    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

### - (`::VertxAuthShiro::ShiroAuth`) set_role_prefix(rolePrefix = nil)

Set the role prefix to distinguish from permissions when checking for isPermitted requests.

Parameters:

- rolePrefix (`String`) (defaults to: `nil`) —
  a Prefix e.g.: "role:"

Returns:

- (`::VertxAuthShiro::ShiroAuth`) —
  a reference to this for fluency

Raises:

- (`ArgumentError`)

    65
    66
    67
    68
    69
    70
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-shiro/shiro_auth.rb', line 65

    def set_role_prefix(rolePrefix=nil)
      if rolePrefix.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setRolePrefix, [Java::java.lang.String.java_class]).call(rolePrefix),::VertxAuthShiro::ShiroAuth)
      end
      raise ArgumentError, "Invalid arguments when calling set_role_prefix(#{rolePrefix})"
    end