Open Kilda Java Documentation
org.openkilda.controller.BaseController Class Referenceabstract
Inheritance diagram for org.openkilda.controller.BaseController:
org.openkilda.controller.FlowController org.openkilda.controller.HomeController org.openkilda.controller.LogActivityController org.openkilda.controller.LoginController org.openkilda.controller.SwitchController org.openkilda.controller.TopologyController org.openkilda.controller.UsermanagementController

Public Member Functions

ModelAndView validateAndRedirect (final HttpServletRequest request, final String viewName)
 
ModelAndView error (final Model model)
 
String getErrorPath ()
 

Protected Member Functions

UserInfo getLoggedInUser (final HttpServletRequest request)
 
boolean isUserLoggedIn ()
 

Detailed Description

Definition at line 24 of file BaseController.java.

Member Function Documentation

◆ error()

ModelAndView org.openkilda.controller.BaseController.error ( final Model  model)

Error.

Parameters
modelthe model
Returns
the model and view

Definition at line 67 of file BaseController.java.

◆ getErrorPath()

String org.openkilda.controller.BaseController.getErrorPath ( )

Definition at line 78 of file BaseController.java.

◆ getLoggedInUser()

UserInfo org.openkilda.controller.BaseController.getLoggedInUser ( final HttpServletRequest  request)
protected

Return logged in user information.

Parameters
requestHttpServletRequest to retrieve logged in user information.
Returns
logged in user information.

Definition at line 88 of file BaseController.java.

◆ isUserLoggedIn()

boolean org.openkilda.controller.BaseController.isUserLoggedIn ( )
protected

Returns true if user is logged in, false otherwise.

Returns
true, if is user logged in

Definition at line 114 of file BaseController.java.

◆ validateAndRedirect()

ModelAndView org.openkilda.controller.BaseController.validateAndRedirect ( final HttpServletRequest  request,
final String  viewName 
)

Validate request.

  • If user is logged in and role is user then redirected to Home.
  • If user is logged in and role is not user then redirected to view passed as an argument.
  • If user is not logged in then redirected to login page.
Parameters
requestHttpServletRequest to check user log in status.
viewNameon which user has to redirect if logged in and not of type user.
Returns
ModelAndView information containing view name on which user is going to be redirected.

Definition at line 45 of file BaseController.java.


The documentation for this class was generated from the following file: