Class SessionObjects

java.lang.Object
com.vaadin.browserless.internal.SessionObjects

public final class SessionObjects extends Object
Holds the objects created during session initialization, before they are installed as thread-locals. Used by MockVaadin.createSessionObjects(com.vaadin.flow.server.VaadinServletService) to allow callers (e.g. multi-user context) to manage thread-locals themselves.

For internal use only. May be renamed or removed in a future release.

  • Constructor Summary

    Constructors
    Constructor
    Description
    SessionObjects(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request, com.vaadin.flow.server.VaadinResponse response, MockHttpSession httpSession)
    Groups the four objects that make up one mocked user's session.
  • Method Summary

    Modifier and Type
    Method
    Description
    copy(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request, com.vaadin.flow.server.VaadinResponse response, MockHttpSession httpSession)
    Returns a copy of this group with the given objects in place of the current ones.
    boolean
    equals(Object other)
     
    Returns the HTTP session the Vaadin session is stored in.
    com.vaadin.flow.server.VaadinRequest
    Returns the request bound to the session.
    com.vaadin.flow.server.VaadinResponse
    Returns the response bound to the session.
    com.vaadin.flow.server.VaadinSession
    Returns the session.
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SessionObjects

      public SessionObjects(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request, com.vaadin.flow.server.VaadinResponse response, MockHttpSession httpSession)
      Groups the four objects that make up one mocked user's session.
      Parameters:
      session - the session
      request - the request bound to the session
      response - the response bound to the session
      httpSession - the HTTP session the Vaadin session is stored in
  • Method Details

    • getSession

      public com.vaadin.flow.server.VaadinSession getSession()
      Returns the session.
      Returns:
      the session
    • getRequest

      public com.vaadin.flow.server.VaadinRequest getRequest()
      Returns the request bound to the session.
      Returns:
      the request
    • getResponse

      public com.vaadin.flow.server.VaadinResponse getResponse()
      Returns the response bound to the session.
      Returns:
      the response
    • getHttpSession

      public MockHttpSession getHttpSession()
      Returns the HTTP session the Vaadin session is stored in.
      Returns:
      the HTTP session
    • copy

      public SessionObjects copy(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request, com.vaadin.flow.server.VaadinResponse response, MockHttpSession httpSession)
      Returns a copy of this group with the given objects in place of the current ones.
      Parameters:
      session - the session
      request - the request bound to the session
      response - the response bound to the session
      httpSession - the HTTP session the Vaadin session is stored in
      Returns:
      the new group
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

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

      public boolean equals(Object other)
      Overrides:
      equals in class Object