Class LocalSessionStore

java.lang.Object
io.vertx.mutiny.ext.web.sstore.SessionStore
io.vertx.mutiny.ext.web.sstore.LocalSessionStore
All Implemented Interfaces:
MutinyDelegate

public class LocalSessionStore extends SessionStore implements MutinyDelegate
A session store which is only available on a single node.

This store is appropriate if you have just a single Vert.x instance and you are using sticky sessions in your application and have configured your load balancer to always route HTTP requests to the same Vert.x instance.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Tim Fox, Paulo Lopes
See Also:
  • LocalSessionStore
  • Field Details

    • DEFAULT_REAPER_INTERVAL

      public static final long DEFAULT_REAPER_INTERVAL
      Default of how often, in ms, to check for expired sessions
      See Also:
    • DEFAULT_SESSION_MAP_NAME

      public static final String DEFAULT_SESSION_MAP_NAME
      Default name for map used to store sessions
      See Also:
    • __TYPE_ARG

      public static final TypeArg<LocalSessionStore> __TYPE_ARG
  • Constructor Details

    • LocalSessionStore

      public LocalSessionStore(io.vertx.ext.web.sstore.LocalSessionStore delegate)
      Create a new instance of LocalSessionStore delegating to the given (non-null) instance of LocalSessionStore.
    • LocalSessionStore

      public LocalSessionStore(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.web.sstore.LocalSessionStore getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Overrides:
      getDelegate in class SessionStore
      Returns:
      the delegate instance
    • get

      @CheckReturnValue public io.smallrye.mutiny.Uni<Session> get(String arg0)
      Get the session with the specified ID.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      get in class SessionStore
      Parameters:
      cookieValue - the unique ID of the session
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SessionStore.get(String)
    • getAndAwait

      public Session getAndAwait(String arg0)
      Get the session with the specified ID.

      Unlike the bare Vert.x variant, this method returns a Session. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      getAndAwait in class SessionStore
      Parameters:
      cookieValue - the unique ID of the session
      Returns:
      The operation result
      See Also:
      • SessionStore.get(String)
    • getAndForget

      public LocalSessionStore getAndForget(String arg0)
      Get the session with the specified ID.

      Unlike the bare Vert.x variant, this method ignores the Session result or any failure.

      Overrides:
      getAndForget in class SessionStore
      Parameters:
      cookieValue - the unique ID of the session
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SessionStore.get(String)
    • put

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> put(Session arg0)
      Add a session with the specified ID.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      put in class SessionStore
      Parameters:
      session - the session
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • io.vertx.ext.web.sstore.LocalSessionStore#put(Session)
    • putAndAwait

      public void putAndAwait(Session arg0)
      Add a session with the specified ID.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      putAndAwait in class SessionStore
      Parameters:
      session - the session
      See Also:
      • io.vertx.ext.web.sstore.LocalSessionStore#put(Session)
    • putAndForget

      public LocalSessionStore putAndForget(Session arg0)
      Add a session with the specified ID.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Overrides:
      putAndForget in class SessionStore
      Parameters:
      session - the session
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • io.vertx.ext.web.sstore.LocalSessionStore#put(Session)
    • size

      @CheckReturnValue public io.smallrye.mutiny.Uni<Integer> size()
      Get the number of sessions in the store.

      Beware of the result which is just an estimate, in particular with distributed session stores.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      size in class SessionStore
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SessionStore.size()
    • sizeAndAwait

      public Integer sizeAndAwait()
      Get the number of sessions in the store.

      Beware of the result which is just an estimate, in particular with distributed session stores.

      Unlike the bare Vert.x variant, this method returns a Integer. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      sizeAndAwait in class SessionStore
      Returns:
      The operation result
      See Also:
      • SessionStore.size()
    • sizeAndForget

      public LocalSessionStore sizeAndForget()
      Get the number of sessions in the store.

      Beware of the result which is just an estimate, in particular with distributed session stores.

      Unlike the bare Vert.x variant, this method ignores the Integer result or any failure.

      Overrides:
      sizeAndForget in class SessionStore
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SessionStore.size()
    • delete

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> delete(String arg0)
      Delete the session with the specified ID.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      delete in class SessionStore
      Parameters:
      id - the session id
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SessionStore.delete(String)
    • deleteAndAwait

      public void deleteAndAwait(String arg0)
      Delete the session with the specified ID.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      deleteAndAwait in class SessionStore
      Parameters:
      id - the session id
      See Also:
      • SessionStore.delete(String)
    • deleteAndForget

      public LocalSessionStore deleteAndForget(String arg0)
      Delete the session with the specified ID.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Overrides:
      deleteAndForget in class SessionStore
      Parameters:
      id - the session id
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SessionStore.delete(String)
    • clear

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> clear()
      Remove all sessions from the store.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      clear in class SessionStore
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SessionStore.clear()
    • clearAndAwait

      public void clearAndAwait()
      Remove all sessions from the store.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      clearAndAwait in class SessionStore
      See Also:
      • SessionStore.clear()
    • clearAndForget

      public LocalSessionStore clearAndForget()
      Remove all sessions from the store.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Overrides:
      clearAndForget in class SessionStore
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SessionStore.clear()
    • create

      public static LocalSessionStore create(Vertx vertx)
      Create a session store
      Parameters:
      vertx - the Vert.x instance
      Returns:
      the session store
    • create

      public static LocalSessionStore create(Vertx vertx, String sessionMapName)
      Create a session store
      Parameters:
      vertx - the Vert.x instance
      sessionMapName - name for map used to store sessions
      Returns:
      the session store
    • create

      public static LocalSessionStore create(Vertx vertx, String sessionMapName, long reaperInterval)
      Create a session store
      Parameters:
      vertx - the Vert.x instance
      sessionMapName - name for map used to store sessions
      reaperInterval - how often, in ms, to check for expired sessions
      Returns:
      the session store
    • newInstance

      public static LocalSessionStore newInstance(io.vertx.ext.web.sstore.LocalSessionStore delegate)
      Creates a new instance of the LocalSessionStore.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class SessionStore
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class SessionStore
    • toString

      public String toString()
      Overrides:
      toString in class SessionStore