Class: VertxWeb::FormLoginHandler

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/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)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


21
22
23
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/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:

Raises:

  • (ArgumentError)


52
53
54
55
56
57
58
59
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 52

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) DEFAULT_PASSWORD_PARAM

The default value of the form attribute which will contain the password


106
107
108
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 106

def self.DEFAULT_PASSWORD_PARAM
  Java::IoVertxExtWebHandler::FormLoginHandler.DEFAULT_PASSWORD_PARAM
end

+ (Object) DEFAULT_RETURN_URL_PARAM

The default value of the session attribute which will contain the return url


110
111
112
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 110

def self.DEFAULT_RETURN_URL_PARAM
  Java::IoVertxExtWebHandler::FormLoginHandler.DEFAULT_RETURN_URL_PARAM
end

+ (Object) DEFAULT_USERNAME_PARAM

The default value of the form attribute which will contain the username


102
103
104
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 102

def self.DEFAULT_USERNAME_PARAM
  Java::IoVertxExtWebHandler::FormLoginHandler.DEFAULT_USERNAME_PARAM
end

+ (Object) j_api_type



30
31
32
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/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-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/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-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/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-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 24

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

Instance Method Details

- (void) handle(event = nil)

This method returns an undefined value.

Something has happened, so handle it.

Parameters:

Raises:

  • (ArgumentError)


39
40
41
42
43
44
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 39

def handle(event=nil)
  if event.class.method_defined?(:j_del) && !block_given?
    return @j_del.java_method(:handle, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(event.j_del)
  end
  raise ArgumentError, "Invalid arguments when calling handle(#{event})"
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)


94
95
96
97
98
99
100
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 94

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)


73
74
75
76
77
78
79
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 73

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)


83
84
85
86
87
88
89
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 83

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)


63
64
65
66
67
68
69
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/form_login_handler.rb', line 63

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