Class List Method List File List

# Class: VertxWeb::FormLoginHandler

Inherits:
  Object
  - Object
  - VertxWeb::FormLoginHandler
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb

## Overview

Handler that handles login from a form on a custom login page.

Used in conjunction with the RedirectAuthHandler.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxWeb::FormLoginHandler) create(authProvider = nil, usernameParam = nil, passwordParam = nil, returnURLParam = nil, directLoggedInOKURL = nil)
  Create a handler.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) handle(arg0 = nil)
- - (self) set_direct_logged_in_okurl(directLoggedInOKURL = nil)
  Set the url to redirect to if the user logs in directly at the url of the form login handler without being redirected here first.
- - (self) set_password_param(passwordParam = nil)
  Set the name of the form param used to submit the password.
- - (self) set_return_url_param(returnURLParam = nil)
  Set the name of the session attrioute used to specify the return url.
- - (self) set_username_param(usernameParam = nil)
  Set the name of the form param used to submit the username.

## Class Method Details

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

Returns:

- (`Boolean`)

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 21

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

### + (`::VertxWeb::FormLoginHandler`) create(authProvider = nil, usernameParam = nil, passwordParam = nil, returnURLParam = nil, directLoggedInOKURL = nil)

Create a handler

Parameters:

- authProvider (`::VertxAuthCommon::AuthProvider`) (defaults to: `nil`) —
  the auth service to use
- usernameParam (`String`) (defaults to: `nil`) —
  the value of the form attribute which will contain the username
- passwordParam (`String`) (defaults to: `nil`) —
  the value of the form attribute which will contain the password
- returnURLParam (`String`) (defaults to: `nil`) —
  the value of the session attribute which will contain the return url
- directLoggedInOKURL (`String`) (defaults to: `nil`) —
  a url to redirect to if the user logs in directly at the url of the form login handler without being redirected here first

Returns:

- (`::VertxWeb::FormLoginHandler`) —
  the handler

Raises:

- (`ArgumentError`)

    51
    52
    53
    54
    55
    56
    57
    58
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 51

    def self.create(authProvider=nil,usernameParam=nil,passwordParam=nil,returnURLParam=nil,directLoggedInOKURL=nil)
      if authProvider.class.method_defined?(:j_del) && !block_given? && usernameParam == nil && passwordParam == nil && returnURLParam == nil && directLoggedInOKURL == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::FormLoginHandler.java_method(:create, [Java::IoVertxExtAuth::AuthProvider.java_class]).call(authProvider.j_del),::VertxWeb::FormLoginHandler)
      elsif authProvider.class.method_defined?(:j_del) && usernameParam.class == String && passwordParam.class == String && returnURLParam.class == String && directLoggedInOKURL.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::FormLoginHandler.java_method(:create, [Java::IoVertxExtAuth::AuthProvider.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(authProvider.j_del,usernameParam,passwordParam,returnURLParam,directLoggedInOKURL),::VertxWeb::FormLoginHandler)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{authProvider},#{usernameParam},#{passwordParam},#{returnURLParam},#{directLoggedInOKURL})"
    end

### + (`Object`) j_api_type

    30
    31
    32
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.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-web/form_login_handler.rb', line 33

    def self.j_class
      Java::IoVertxExtWebHandler::FormLoginHandler.java_class
    end

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

    27
    28
    29
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.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-web/form_login_handler.rb', line 24

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

## Instance Method Details

### - (`void`) handle(arg0 = nil)

This method returns an undefined value.

Parameters:

- arg0 (`::VertxWeb::RoutingContext`) (defaults to: `nil`)

Raises:

- (`ArgumentError`)

    38
    39
    40
    41
    42
    43
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 38

    def handle(arg0=nil)
      if arg0.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:handle, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(arg0.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling handle(#{arg0})"
    end

### - (`self`) set_direct_logged_in_okurl(directLoggedInOKURL = nil)

Set the url to redirect to if the user logs in directly at the url of the form login handler without being redirected here first

Parameters:

- directLoggedInOKURL (`String`) (defaults to: `nil`) —
  the URL to redirect to

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    93
    94
    95
    96
    97
    98
    99
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 93

    def set_direct_logged_in_okurl(directLoggedInOKURL=nil)
      if directLoggedInOKURL.class == String && !block_given?
        @j_del.java_method(:setDirectLoggedInOKURL, [Java::java.lang.String.java_class]).call(directLoggedInOKURL)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_direct_logged_in_okurl(#{directLoggedInOKURL})"
    end

### - (`self`) set_password_param(passwordParam = nil)

Set the name of the form param used to submit the password

Parameters:

- passwordParam (`String`) (defaults to: `nil`) —
  the name of the param

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    72
    73
    74
    75
    76
    77
    78
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 72

    def set_password_param(passwordParam=nil)
      if passwordParam.class == String && !block_given?
        @j_del.java_method(:setPasswordParam, [Java::java.lang.String.java_class]).call(passwordParam)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_password_param(#{passwordParam})"
    end

### - (`self`) set_return_url_param(returnURLParam = nil)

Set the name of the session attrioute used to specify the return url

Parameters:

- returnURLParam (`String`) (defaults to: `nil`) —
  the name of the param

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    82
    83
    84
    85
    86
    87
    88
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 82

    def set_return_url_param(returnURLParam=nil)
      if returnURLParam.class == String && !block_given?
        @j_del.java_method(:setReturnURLParam, [Java::java.lang.String.java_class]).call(returnURLParam)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_return_url_param(#{returnURLParam})"
    end

### - (`self`) set_username_param(usernameParam = nil)

Set the name of the form param used to submit the username

Parameters:

- usernameParam (`String`) (defaults to: `nil`) —
  the name of the param

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    62
    63
    64
    65
    66
    67
    68
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 62

    def set_username_param(usernameParam=nil)
      if usernameParam.class == String && !block_given?
        @j_del.java_method(:setUsernameParam, [Java::java.lang.String.java_class]).call(usernameParam)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_username_param(#{usernameParam})"
    end