Class: VertxWeb::UserSessionHandler

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/user_session_handler.rb

Overview

This handler should be used if you want to store the User object in the Session so it's available between different requests, without you having re-authenticate each time. It requires that the session handler is already present on previous matching routes. It requires an Auth provider so, if the user is deserialized from a clustered session it knows which Auth provider to associate the session with.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


26
27
28
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/user_session_handler.rb', line 26

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

+ (::VertxWeb::UserSessionHandler) create(authProvider = nil)

Create a new handler

Parameters:

Returns:

Raises:

  • (ArgumentError)


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

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

+ (Object) j_api_type



35
36
37
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/user_session_handler.rb', line 35

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



38
39
40
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/user_session_handler.rb', line 38

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

+ (Object) unwrap(obj)



32
33
34
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/user_session_handler.rb', line 32

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

+ (Object) wrap(obj)



29
30
31
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/user_session_handler.rb', line 29

def @@j_api_type.wrap(obj)
  UserSessionHandler.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)


44
45
46
47
48
49
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/user_session_handler.rb', line 44

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