Class UserContext

java.lang.Object
ro.sync.ecss.extensions.api.webapp.plugin.UserContext

@API(src=PUBLIC, type=NOT_EXTENDABLE) public class UserContext extends Object
The context of the user that opened the URL.
Since:
17
  • Constructor Details

    • UserContext

      public UserContext(Map<String,String> headersMap, String sessionId)
      Parameters:
      headersMap - The cookies that are part of the context of this URL.
      sessionId - The session ID of the user.
  • Method Details

    • getCookies

      public Map<String,String> getCookies()
      Returns:
      Returns the cookies.
    • getHeaders

      public Map<String,String> getHeaders()
      Returns:
      the an immutable request headers map.
    • getSessionId

      public String getSessionId()
      Returns:
      The id of the session of the user maintained by the Servlet container.
    • isServiceAccount

      public boolean isServiceAccount()
      UserContext is used both for real users connected with their web browser and for plugins that try to open an URL on their own behalf. For example, in a concurrent editing session, users join and leave. In order to have a robust way to save changes, a plugin may choose to use a dedicated set of credentials that do not belong to any of those users. Such credentials belong to a "service account".
      Returns:
      false if the user context represents a real user connected with their web browser.