|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.google.api.client.extensions.servlet.auth.AbstractTwoLeggedFlowServlet
public abstract class AbstractTwoLeggedFlowServlet
This specialization of HttpServlet allows accessing OAuth resources using a credential
that can be created without user intervention. Subclasses should call getCredential in their
handlers when they want access to protected resources.
| Constructor Summary | |
|---|---|
AbstractTwoLeggedFlowServlet()
Create an instance of the servlet. |
|
| Method Summary | |
|---|---|
protected Credential |
getCredential(javax.servlet.http.HttpServletRequest req)
Fetch a credential associated with this request. |
protected HttpTransport |
getHttpTransport()
Return the HttpTransport instance for this servlet. |
protected JsonFactory |
getJsonFactory()
Return the JsonFactory instance for this servlet. |
protected abstract javax.jdo.PersistenceManagerFactory |
getPersistenceManagerFactory()
Obtain a PersistenceManagerFactory for working with the datastore. |
protected abstract String |
getUserId()
|
protected abstract TwoLeggedFlow |
newFlow(String userId)
Create a two legged flow that can be used to create credentials for accessing protected resources using OAuth. |
protected abstract HttpTransport |
newHttpTransportInstance()
Create a new HttpTransport instance. |
protected abstract JsonFactory |
newJsonFactoryInstance()
Create a new JsonFactory instance. |
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
|
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
| 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 |
|---|
public AbstractTwoLeggedFlowServlet()
| Method Detail |
|---|
protected void service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
service in class javax.servlet.http.HttpServletjavax.servlet.ServletException
IOException
protected Credential getCredential(javax.servlet.http.HttpServletRequest req)
throws IOException
req - Request object to use as context for fetching the credential.
IOExceptionprotected abstract TwoLeggedFlow newFlow(String userId)
userId - Identifier used to associate a flow or credential object with a specific user.
protected final JsonFactory getJsonFactory()
JsonFactory instance for this servlet.
protected final HttpTransport getHttpTransport()
HttpTransport instance for this servlet.
protected abstract javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
protected abstract HttpTransport newHttpTransportInstance()
HttpTransport instance. Implementations can create any type of applicable
transport and should be as simple as:
new NetHttpTransport();
HttpTransport instance for your particular environmentprotected abstract JsonFactory newJsonFactoryInstance()
JsonFactory instance. Implementations can create any type of applicable
json factory and should be as simple as:
new JacksonFactory();
JsonFactory instance for your particular environmentprotected abstract String getUserId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||