Class SessionRestController

  • All Implemented Interfaces:
    SessionRestOpenApi

    @RestController
    @RequestMapping("/v2.1.1/session-manager/")
    public class SessionRestController
    extends Object
    implements SessionRestOpenApi
    Session Manager Rest Controller.
    Author:
    Mauricio Ruiz Beltrán <mauricio.ruiz@kuwaiba.org>
    • Constructor Detail

      • SessionRestController

        public SessionRestController()
    • Method Detail

      • createSession

        @RequestMapping(method=PUT,
                        value="createSession/{user}/{password}/{sessionType}",
                        produces="application/json")
        public Session createSession​(@PathVariable("user")
                                     String user,
                                     @PathVariable("password")
                                     String password,
                                     @PathVariable("sessionType")
                                     int sessionType)
        Creates a session. System users can not create sessions.
        Specified by:
        createSession in interface SessionRestOpenApi
        Parameters:
        user - User name.
        password - Password.
        sessionType - The type of session to be created. This type depends on what kind of client is trying to access (a desktop client, a web client, a web service user, etc. See Session.TYPE_XXX for possible session types).
        Returns:
        A session object with information about the session itself plus information about the user.
      • closeSession

        @RequestMapping(method=DELETE,
                        value="closeSession/{sessionId}",
                        produces="application/json")
        public void closeSession​(@PathVariable("sessionId")
                                 String sessionId)
        Closes a session.
        Specified by:
        closeSession in interface SessionRestOpenApi
        Parameters:
        sessionId - The session id (token).