Tynamo™-TINI
v1.0.4

com.qindesign.servlet
Class ShutdownServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.qindesign.servlet.AuthenticatedHttpServlet
              extended by com.qindesign.servlet.ShutdownServlet
All Implemented Interfaces:
com.qindesign.tini.http.Authenticator.Authorizer, Serializable, Servlet, ServletConfig

public class ShutdownServlet
extends AuthenticatedHttpServlet

Example servlet that provides a link to the shutdown URL. This uses a simple authentication scheme to grant access.

Version:
1.0.4
Author:
Shawn Silverman
See Also:
Serialized Form

Constructor Summary
ShutdownServlet()
           
 
Method Summary
protected  void doGet(HttpServletRequest req, HttpServletResponse resp)
          Process a GET request.
 String getPassword(String realm, String user)
          Gets the password for the specified user in the given realm.
 String getRealm(HttpServletRequest req)
          The realm is "Shutdown".
 
Methods inherited from class com.qindesign.servlet.AuthenticatedHttpServlet
authorizedService, doUnauthorizedDelete, doUnauthorizedGet, doUnauthorizedOptions, doUnauthorizedPost, doUnauthorizedPut, doUnauthorizedTrace, getDefaultScheme, getProperty, isAuthExpired, isSchemeAcceptable, service, service, unauthorizedService
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPost, doPut, doTrace, getLastModified
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShutdownServlet

public ShutdownServlet()
Method Detail

getRealm

public String getRealm(HttpServletRequest req)
The realm is "Shutdown".

Specified by:
getRealm in interface com.qindesign.tini.http.Authenticator.Authorizer
Specified by:
getRealm in class AuthenticatedHttpServlet
Parameters:
req - the HTTP request object
Returns:
the realm "Shutdown".
See Also:
Authenticator.Authorizer

getPassword

public String getPassword(String realm,
                          String user)
Gets the password for the specified user in the given realm. This checks the "auth" initialization parameter for a username/password pair. The format is username:password.

Specified by:
getPassword in interface com.qindesign.tini.http.Authenticator.Authorizer
Specified by:
getPassword in class AuthenticatedHttpServlet
Parameters:
realm - the protection space, a case-insensitive value
user - the user
Returns:
the password for the specified user in the given realm.

doGet

protected void doGet(HttpServletRequest req,
                     HttpServletResponse resp)
              throws ServletException,
                     IOException
Process a GET request.

Overrides:
doGet in class HttpServlet
Throws:
ServletException
IOException

Tynamo™-TINI
v1.0.4

© 2001-2007 Shawn Silverman