org.sakaiproject.tool.login
Class LoginTool

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.sakaiproject.tool.login.LoginTool
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class LoginTool
extends HttpServlet

Login tool for Sakai. Works with the ContainerLoginTool servlet to offer container or internal login.

This "tool", being login, is not placed, instead each user can interact with only one login at a time. The Sakai Session is used for attributes.

Version:
$Revision: 5742 $
Author:
University of Michigan, Sakai Software Development Team
See Also:
Serialized Form

Field Summary
static String ATTR_CONTAINER_CHECKED
          Session attribute set and shared with ContainerLoginTool: if set we have failed container and need to check internal.
protected static String ATTR_MSG
          Session attribute used to store a message between steps.
static String ATTR_RETURN_URL
          Session attribute set and shared with ContainerLoginTool: URL for redirecting back here.
 
Constructor Summary
LoginTool()
           
 
Method Summary
protected  void complete(String returnUrl, Session session, Tool tool, HttpServletResponse res)
          Cleanup and redirect when we have a successful login / logout
 void destroy()
          Shutdown the servlet.
protected  void doGet(HttpServletRequest req, HttpServletResponse res)
          Respond to requests.
protected  void doPost(HttpServletRequest req, HttpServletResponse res)
          Respond to data posting requests.
 String getServletInfo()
          Access the Servlet's information display.
 void init(ServletConfig config)
          Initialize the servlet.
protected  void sendForm(HttpServletRequest req, HttpServletResponse res)
          Send the login form
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_MSG

protected static final String ATTR_MSG
Session attribute used to store a message between steps.

See Also:
Constant Field Values

ATTR_RETURN_URL

public static final String ATTR_RETURN_URL
Session attribute set and shared with ContainerLoginTool: URL for redirecting back here.

See Also:
Constant Field Values

ATTR_CONTAINER_CHECKED

public static final String ATTR_CONTAINER_CHECKED
Session attribute set and shared with ContainerLoginTool: if set we have failed container and need to check internal.

See Also:
Constant Field Values
Constructor Detail

LoginTool

public LoginTool()
Method Detail

getServletInfo

public String getServletInfo()
Access the Servlet's information display.

Returns:
servlet information.

init

public void init(ServletConfig config)
          throws ServletException
Initialize the servlet.

Parameters:
config - The servlet config.
Throws:
ServletException

destroy

public void destroy()
Shutdown the servlet.


doGet

protected void doGet(HttpServletRequest req,
                     HttpServletResponse res)
              throws ServletException,
                     IOException
Respond to requests.

Parameters:
req - The servlet request.
res - The servlet response.
Throws:
ServletException.
IOException.
ServletException
IOException

sendForm

protected void sendForm(HttpServletRequest req,
                        HttpServletResponse res)
                 throws IOException
Send the login form

Parameters:
req - Servlet request.
res - Servlet response.
Throws:
IOException

doPost

protected void doPost(HttpServletRequest req,
                      HttpServletResponse res)
               throws ServletException,
                      IOException
Respond to data posting requests.

Parameters:
req - The servlet request.
res - The servlet response.
Throws:
ServletException.
IOException.
ServletException
IOException

complete

protected void complete(String returnUrl,
                        Session session,
                        Tool tool,
                        HttpServletResponse res)
                 throws IOException
Cleanup and redirect when we have a successful login / logout

Parameters:
session -
tool -
res -
Throws:
IOException