Package org.jets3t.servlets.gatekeeper
Class GatekeeperServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.jets3t.servlets.gatekeeper.GatekeeperServlet
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class GatekeeperServlet
extends javax.servlet.http.HttpServlet
A servlet implementation of an S3 Gatekeeper, as described in the document
Gatekeeper Concepts.
This servlet offers an easily configurable and extensible approach, where key steps in the authorization and signature generation process are performed by pluggable interfaces:
TransactionIdProvider
: Generate a transaction ID to uniquely identify a request/response transactionAuthorizer
: Allow or deny specific requested operationsUrlSigner
: Generate signed URLs for each operation that has been allowed by the Authorizer
These pluggable interfaces are configured in the servlet's configuration file, or if left unconfigured the default JetS3t implementations are used.
For more information about this servlet please refer to: JetS3t Gatekeeper
- Author:
- James Murty
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
doGet
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Sends a simple HTML page in response to GET requests, indicating that the servlet is running.void
doPost
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handles POST requests that contain Gatekeeper messages encoded as POST form properties, and sends a plain text response document containing the Gatekeeper response message encoded as a properties file.void
init
(javax.servlet.ServletConfig servletConfig) Initialises the pluggable implementation classes forAuthorizer
,TransactionIdProvider
, andUrlSigner
Methods inherited from class javax.servlet.http.HttpServlet
service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
GatekeeperServlet
public GatekeeperServlet()
-
-
Method Details
-
init
public void init(javax.servlet.ServletConfig servletConfig) throws javax.servlet.ServletException Initialises the pluggable implementation classes forAuthorizer
,TransactionIdProvider
, andUrlSigner
- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Sends a simple HTML page in response to GET requests, indicating that the servlet is running.- Throws:
javax.servlet.ServletException
IOException
-
doPost
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Handles POST requests that contain Gatekeeper messages encoded as POST form properties, and sends a plain text response document containing the Gatekeeper response message encoded as a properties file.- Throws:
javax.servlet.ServletException
IOException
-