Interface RequestHandlerDelegate


public interface RequestHandlerDelegate
Provides the interface to the request handler. This is an internal class that is not to be used and may change at any time.
  • Method Details

    • logger

      ILogNode logger()
      Returns the logger of this request handler.
      Returns:
      the log node
    • getSessionFromRequest

      ISession getSessionFromRequest(IMxRuntimeRequest request) throws CoreException
      Get the session using the cookie. No CSRF check will be performed.
      Parameters:
      request - the request from which to get the session
      Returns:
      the session
      Throws:
      CoreException - if the session cannot be retrieved
    • getSessionFromRequest

      ISession getSessionFromRequest(IMxRuntimeRequest request, boolean performCSRFCheck) throws CoreException
      Get the session using the cookie.
      Parameters:
      request - the request from which to get the session
      performCSRFCheck - whether a CSRF check will be performed using the request headers
      Returns:
      the session
      Throws:
      CoreException - if the session cannot be retrieved
    • getSessionIdCookieName

      String getSessionIdCookieName()
      Returns the name of the header field containing the session ID cookie.
      Returns:
      the header name
    • isSessionKilledByNewLogin

      boolean isSessionKilledByNewLogin(IMxRuntimeRequest request)
      Returns whether the specified session was killed because the same user logged in for a different session.
      Parameters:
      request - the request from which to get the session
      Returns:
      true if the session was killed, false otherwise
    • buildUserInfo

      String buildUserInfo(IContext context)
      Returns a string representation of the user for the specified context, including its roles.

      If the context is a system context an empty string is returned.

      Parameters:
      context - the string representation
    • getExpiresTimeStamp

      long getExpiresTimeStamp(Integer addYears)
      Returns the current time (in milliseconds since the Unix epoch) after the specified number of years.
      Parameters:
      addYears - the number of years to add to the current time
    • formatDate

      String formatDate(Date date)
      Converts the specified date to a string.
      Parameters:
      date - the date to convert
      Returns:
      the string representation of the date
    • parseDate

      Date parseDate(String date) throws ParseException
      Converts the specified string to a date.
      Parameters:
      date - the string to parse
      Returns:
      the parsed date
      Throws:
      ParseException - if parsing the date fails