Interface SessionAttributes

All Known Implementing Classes:
Authenticated, Login

public interface SessionAttributes
This interface defines the methods that classes with SessionAttributes functionalities have to implement.

A SessionAttributes class defines the context in which a session is being validated. The presence and the value of certain attributes can influence whether the access to a secured resource is authorized or prohibited for a particular user.

For example, regular users have access to everything besides in the administration interface. Resources that are restricted to administrators can for example have a role attribute that is set to admin. A SessionValidator instance can detect the presence of this attribute and act accordingly to verify if the user has the authorities of the required role (in this case, administrator rights).

Since:
1.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the value of a particular attribute.
    boolean
    Checks if a certain attribute is present.
  • Method Details

    • hasAttribute

      boolean hasAttribute(String key)
      Checks if a certain attribute is present.
      Parameters:
      key - The key that identifies the attribute.
      Returns:
      true if the attribute was present; or

      false otherwise.

      Since:
      1.0
      See Also:
    • getAttribute

      String getAttribute(String key)
      Retrieves the value of a particular attribute.
      Parameters:
      key - The key that identifies the attribute.
      Returns:
      A String instance with the value of the requested attribute; or

      null if the attribute couldn't be found.

      Since:
      1.0
      See Also: