Class UserController

java.lang.Object
org.vrspace.server.api.ApiBase
org.vrspace.server.api.UserController

@RestController @RequestMapping("/vrspace/api/user") public class UserController extends ApiBase
Basic user information. Users can't be created here yet, it's all automated in Oauth2Controller for authenticated users, and WorldManager for guest users.
Author:
joe
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.vrspace.server.api.ApiBase

    API_ROOT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    authenticated(jakarta.servlet.http.HttpSession session)
    Check if the user is already authenticated
    boolean
    checkName(String name, jakarta.servlet.http.HttpSession session)
    Verifies that user name is available: if user is not logged in, that there's no such user, or user's name in the database matches name in current session.
    userName(jakarta.servlet.http.HttpSession session)
    Returns current user name
    userObject(jakarta.servlet.http.HttpSession session)
    Returns current user object

    Methods inherited from class org.vrspace.server.api.ApiBase

    currentUserName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • UserController

      public UserController()
  • Method Details

    • checkName

      @GetMapping("/available") public boolean checkName(String name, jakarta.servlet.http.HttpSession session)
      Verifies that user name is available: if user is not logged in, that there's no such user, or user's name in the database matches name in current session.
      Parameters:
      name - user name to verify
      session - http session, automatically provided
      Returns:
      true if user can log in with given name
    • authenticated

      @GetMapping("/authenticated") public boolean authenticated(jakarta.servlet.http.HttpSession session)
      Check if the user is already authenticated
      Parameters:
      session - http session, automatically provided
      Returns:
      true if user is currently authenticated
    • userName

      @GetMapping("/name") public String userName(jakarta.servlet.http.HttpSession session)
      Returns current user name
      Parameters:
      session -
      Returns:
      authenticated user name, or null if user is not authenticated
    • userObject

      @GetMapping("/object") public Client userObject(jakarta.servlet.http.HttpSession session)
      Returns current user object
      Parameters:
      session -
      Returns:
      current user Client object, or null if user is not authenticated