Class QSession

java.lang.Object
com.kingsrook.qqq.backend.core.model.session.QSession
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
QSystemUserSession

public class QSession extends Object implements Serializable, Cloneable
See Also:
  • Field Details

  • Constructor Details

    • QSession

      public QSession()
      Default constructor, puts a uuid in the session
  • Method Details

    • clone

      public QSession clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • getIdReference

      public String getIdReference()
      Getter for idReference
    • setIdReference

      public void setIdReference(String idReference)
      Setter for idReference
    • getUser

      public QUser getUser()
      Getter for user
    • setUser

      public void setUser(QUser user)
      Setter for user
    • getValue

      public String getValue(String key)
    • setValue

      public void setValue(String key, String value)
    • removeValue

      public void removeValue(String key)
    • withValue

      public QSession withValue(String key, String value)
    • getValues

      public Map<String,String> getValues()
    • setValues

      public void setValues(Map<String,String> values)
    • getUuid

      public String getUuid()
      Getter for uuid
    • setUuid

      public void setUuid(String uuid)
      Setter for uuid
    • getSecurityKeyValues

      public Map<String,List<Serializable>> getSecurityKeyValues()
      Getter for securityKeyValues
    • getSecurityKeyValues

      public List<Serializable> getSecurityKeyValues(String keyName)
      Getter for securityKeyValues - the list under a given key - never null.
    • getSecurityKeyValues

      public List<Serializable> getSecurityKeyValues(String keyName, QFieldType type)
      Getter for securityKeyValues - the list under a given key - as the expected tye - never null.
    • hasSecurityKeyValue

      public boolean hasSecurityKeyValue(String keyName, Serializable value)
      Test if this session has a given value for a given key
    • hasSecurityKeyValue

      public boolean hasSecurityKeyValue(String keyName, Serializable value, QFieldType fieldType)
    • setSecurityKeyValues

      public void setSecurityKeyValues(Map<String,List<Serializable>> securityKeyValues)
      Setter for securityKeyValues
    • withSecurityKeyValues

      public QSession withSecurityKeyValues(Map<String,List<Serializable>> securityKeyValues)
      Fluent setter for securityKeyValues - replaces the map.
    • withSecurityKeyValue

      public QSession withSecurityKeyValue(String keyName, Serializable value)
      Fluent setter for securityKeyValues - add 1 value for 1 key.
    • clearSecurityKeyValues

      public void clearSecurityKeyValues()
      Clear the map of security key values in the session.
    • setPermissions

      public void setPermissions(Set<String> permissions)
      Setter for permissions
    • withPermission

      public QSession withPermission(String permission)
    • withPermissions

      public QSession withPermissions(String... permissionNames)
    • withPermissions

      public QSession withPermissions(Collection<String> permissionNames)
    • hasPermission

      public boolean hasPermission(String permissionName)
    • getPermissions

      public Set<String> getPermissions()
      Getter for permissions
    • withUser

      public QSession withUser(QUser user)
      Fluent setter for user
    • getBackendVariants

      public Map<String,Serializable> getBackendVariants()
      Getter for backendVariants
    • setBackendVariants

      public void setBackendVariants(Map<String,Serializable> backendVariants)
      Setter for backendVariants
    • withBackendVariants

      public QSession withBackendVariants(Map<String,Serializable> backendVariants)
      Fluent setter for backendVariants
    • getValuesForFrontend

      public Map<String,Serializable> getValuesForFrontend()
      Getter for valuesForFrontend
    • setValuesForFrontend

      public void setValuesForFrontend(Map<String,Serializable> valuesForFrontend)
      Setter for valuesForFrontend
    • withValuesForFrontend

      public QSession withValuesForFrontend(Map<String,Serializable> valuesForFrontend)
      Fluent setter for valuesForFrontend
    • withValueForFrontend

      public QSession withValueForFrontend(String key, Serializable value)
      Fluent setter for a single valuesForFrontend