public class GQLServlet
extends javax.servlet.http.HttpServlet
| Modifier and Type | Class and Description |
|---|---|
static class |
GQLServlet.Builder |
| Modifier and Type | Field and Description |
|---|---|
static String |
CONTENT_TYPE |
static String |
MEDIA_TYPE |
| Constructor and Description |
|---|
GQLServlet(GQLDefinition definition,
GQLProcessorProvider<?> queryProvider,
GQLProcessorProvider<?> mutationProvider,
Collection<GQLFieldProvider<?>> fieldProviders,
GQLContextFactory<?> contextFactory,
ExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
static GQLServlet.Builder |
builder(GQLDefinition definition) |
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Only non-mutation GQL queries may be handed to a get request, putting the
actual query in the query= parameter.
|
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Both normal GQL queries and mutations may be posted.
|
protected void |
handleOperation(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
GQLOperation operation,
boolean handleSerially)
Handle operation.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, servicepublic static final String CONTENT_TYPE
public static final String MEDIA_TYPE
public GQLServlet(@Nonnull GQLDefinition definition, @Nonnull GQLProcessorProvider<?> queryProvider, @Nullable GQLProcessorProvider<?> mutationProvider, @Nonnull Collection<GQLFieldProvider<?>> fieldProviders, @Nullable GQLContextFactory<?> contextFactory, @Nonnull ExecutorService executorService)
public static GQLServlet.Builder builder(GQLDefinition definition)
protected void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws IOException
doGet in class javax.servlet.http.HttpServletreq - The HTTP request.resp - The HTTP response.IOExceptionprotected void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws IOException
doPost in class javax.servlet.http.HttpServletreq - The HTTP request.resp - The HTTP response.IOException@OverridingMethodsMustInvokeSuper protected void handleOperation(@Nonnull javax.servlet.http.HttpServletRequest req, @Nonnull javax.servlet.http.HttpServletResponse resp, @Nonnull GQLOperation operation, boolean handleSerially) throws IOException
req - The HTTP request.resp - The HTTP response.operation - The operation to be done.handleSerially - If the operation should be handled serially.
If true will create a single context and handle all method
calls after one another and stop on first error.
If false will spawn one thread per method call, and write
a data response or error separately for each call.IOException - If operation handle failed.Copyright © 2015–2020 morimekta.net. All rights reserved.