Class: VertxWeb::ClusteredSessionStore
- Inherits:
-
SessionStore
- Object
- SessionStore
- VertxWeb::ClusteredSessionStore
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb
Overview
A session store which stores sessions in a distributed map so they are available across the cluster.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
-
+ (::VertxWeb::ClusteredSessionStore) create(param_1 = nil, param_2 = nil, param_3 = nil)
Create a session store.
-
+ (Object) DEFAULT_RETRY_TIMEOUT
Default retry time out, in ms, for a session not found in this store.
-
+ (Object) DEFAULT_SESSION_MAP_NAME
The default name used for the session map.
-
+ (Object) DEFAULT_SESSIONID_LENGTH
Default length for a session id.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (void) clear { ... }
Remove all sessions from the store.
-
- (void) close
Close the store.
-
- (::VertxWeb::Session) create_session(timeout = nil, length = nil)
Create a new session.
-
- (void) delete(id = nil) { ... }
Delete the session with the specified ID.
-
- (void) get(cookieValue = nil) { ... }
Get the session with the specified ID.
-
- (self) init(vertx = nil, options = nil)
Initialize this store.
-
- (void) put(session = nil) { ... }
Add a session with the specified ID.
-
- (Fixnum) retry_timeout
The retry timeout value in milli seconds used by the session handler when it retrieves a value from the store.
-
- (void) size { ... }
Get the number of sessions in the store.
Class Method Details
+ (Boolean) accept?(obj)
21 22 23 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 21 def @@j_api_type.accept?(obj) obj.class == ClusteredSessionStore end |
+ (::VertxWeb::ClusteredSessionStore) create(vertx) + (::VertxWeb::ClusteredSessionStore) create(vertx, sessionMapName) + (::VertxWeb::ClusteredSessionStore) create(vertx, retryTimeout) + (::VertxWeb::ClusteredSessionStore) create(vertx, sessionMapName, retryTimeout)
Create a session store.
The retry timeout value, configures how long the session handler will retry to get a session from the store
when it is not found.
144 145 146 147 148 149 150 151 152 153 154 155 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 144 def self.create(param_1=nil,param_2=nil,param_3=nil) if param_1.class.method_defined?(:j_del) && !block_given? && param_2 == nil && param_3 == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebSstore::ClusteredSessionStore.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(param_1.j_del),::VertxWeb::ClusteredSessionStore) elsif param_1.class.method_defined?(:j_del) && param_2.class == String && !block_given? && param_3 == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebSstore::ClusteredSessionStore.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class]).call(param_1.j_del,param_2),::VertxWeb::ClusteredSessionStore) elsif param_1.class.method_defined?(:j_del) && param_2.class == Fixnum && !block_given? && param_3 == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebSstore::ClusteredSessionStore.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::long.java_class]).call(param_1.j_del,param_2),::VertxWeb::ClusteredSessionStore) elsif param_1.class.method_defined?(:j_del) && param_2.class == String && param_3.class == Fixnum && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebSstore::ClusteredSessionStore.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class,Java::long.java_class]).call(param_1.j_del,param_2,param_3),::VertxWeb::ClusteredSessionStore) end raise ArgumentError, "Invalid arguments when calling create(#{param_1},#{param_2},#{param_3})" end |
+ (Object) DEFAULT_RETRY_TIMEOUT
Default retry time out, in ms, for a session not found in this store.
166 167 168 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 166 def self.DEFAULT_RETRY_TIMEOUT Java::IoVertxExtWebSstore::ClusteredSessionStore.DEFAULT_RETRY_TIMEOUT end |
+ (Object) DEFAULT_SESSION_MAP_NAME
The default name used for the session map
162 163 164 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 162 def self.DEFAULT_SESSION_MAP_NAME Java::IoVertxExtWebSstore::ClusteredSessionStore.DEFAULT_SESSION_MAP_NAME end |
+ (Object) DEFAULT_SESSIONID_LENGTH
Default length for a session id.
More info: https://www.owasp.org/index.php/Session_Management_Cheat_Sheet
158 159 160 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 158 def self.DEFAULT_SESSIONID_LENGTH Java::IoVertxExtWebSstore::ClusteredSessionStore.DEFAULT_SESSIONID_LENGTH 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/clustered_session_store.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/clustered_session_store.rb', line 33 def self.j_class Java::IoVertxExtWebSstore::ClusteredSessionStore.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/clustered_session_store.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/clustered_session_store.rb', line 24 def @@j_api_type.wrap(obj) ClusteredSessionStore.new(obj) end |
Instance Method Details
- (void) clear { ... }
This method returns an undefined value.
Remove all sessions from the store.
102 103 104 105 106 107 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 102 def clear if block_given? return @j_del.java_method(:clear, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling clear()" end |
- (void) close
This method returns an undefined value.
Close the store
121 122 123 124 125 126 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 121 def close if !block_given? return @j_del.java_method(:close, []).call() end raise ArgumentError, "Invalid arguments when calling close()" end |
- (::VertxWeb::Session) create_session(timeout = nil, length = nil)
Create a new session.
61 62 63 64 65 66 67 68 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 61 def create_session(timeout=nil,length=nil) if timeout.class == Fixnum && !block_given? && length == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSession, [Java::long.java_class]).call(timeout),::VertxWeb::Session) elsif timeout.class == Fixnum && length.class == Fixnum && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSession, [Java::long.java_class,Java::int.java_class]).call(timeout,length),::VertxWeb::Session) end raise ArgumentError, "Invalid arguments when calling create_session(#{timeout},#{length})" end |
- (void) delete(id = nil) { ... }
This method returns an undefined value.
Delete the session with the specified ID.
83 84 85 86 87 88 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 83 def delete(id=nil) if id.class == String && block_given? return @j_del.java_method(:delete, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(id,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling delete(#{id})" end |
- (void) get(cookieValue = nil) { ... }
This method returns an undefined value.
Get the session with the specified ID.
73 74 75 76 77 78 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 73 def get(=nil) if .class == String && block_given? return @j_del.java_method(:get, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWeb::Session) : nil) })) end raise ArgumentError, "Invalid arguments when calling get(#{})" end |
- (self) init(vertx = nil, options = nil)
Initialize this store.
40 41 42 43 44 45 46 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 40 def init(vertx=nil,=nil) if vertx.class.method_defined?(:j_del) && .class == Hash && !block_given? @j_del.java_method(:init, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object()) return self end raise ArgumentError, "Invalid arguments when calling init(#{vertx},#{})" end |
- (void) put(session = nil) { ... }
This method returns an undefined value.
Add a session with the specified ID.
93 94 95 96 97 98 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 93 def put(session=nil) if session.class.method_defined?(:j_del) && block_given? return @j_del.java_method(:put, [Java::IoVertxExtWeb::Session.java_class,Java::IoVertxCore::Handler.java_class]).call(session.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling put(#{session})" end |
- (Fixnum) retry_timeout
The retry timeout value in milli seconds used by the session handler when it retrieves a value from the store.
A non positive value means there is no retry at all.
51 52 53 54 55 56 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 51 def retry_timeout if !block_given? return @j_del.java_method(:retryTimeout, []).call() end raise ArgumentError, "Invalid arguments when calling retry_timeout()" end |
- (void) size { ... }
This method returns an undefined value.
Get the number of sessions in the store.Beware of the result which is just an estimate, in particular with distributed session stores.
113 114 115 116 117 118 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/clustered_session_store.rb', line 113 def size if block_given? return @j_del.java_method(:size, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) })) end raise ArgumentError, "Invalid arguments when calling size()" end |