public class AbstractWranglerHandler
extends io.cdap.cdap.api.service.http.AbstractSystemHttpServiceHandler
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
AbstractWranglerHandler.NamespacedResponder<T>
Responds to a request within a namespace.
|
| Constructor and Description |
|---|
AbstractWranglerHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected Connection |
getConnection(NamespacedId connectionId) |
protected Connection |
getValidatedConnection(ConnectionStore store,
NamespacedId connectionId,
ConnectionType expectedType)
Validates that the specified connection exists and is of the expected type.
|
protected Connection |
getValidatedConnection(NamespacedId connectionId,
ConnectionType expectedType) |
protected Workspace |
getWorkspace(NamespacedId workspaceId) |
protected <T> void |
respond(io.cdap.cdap.api.service.http.HttpServiceRequest request,
io.cdap.cdap.api.service.http.HttpServiceResponder responder,
Callable<T> callable)
Utility method for executing an endpoint with common error handling built in.
|
protected <T> void |
respond(io.cdap.cdap.api.service.http.HttpServiceRequest request,
io.cdap.cdap.api.service.http.HttpServiceResponder responder,
String namespace,
AbstractWranglerHandler.NamespacedResponder<T> callable)
Utility method for executing an endpoint with common error handling and namespace checks built in.
|
protected boolean |
shouldCopyHeader(WorkspaceDataset ws,
NamespacedId workspaceId)
Return whether the header needs to be copied when creating the pipeline source for the specified workspace.
|
createTableconfigure, configure, destroy, getConfigurer, getContext, initialize, setPropertiesusePlugin, usePlugin, usePluginClass, usePluginClassprotected Workspace getWorkspace(NamespacedId workspaceId)
protected boolean shouldCopyHeader(WorkspaceDataset ws, @Nullable NamespacedId workspaceId) throws IOException
IOExceptionprotected Connection getConnection(NamespacedId connectionId)
protected Connection getValidatedConnection(NamespacedId connectionId, ConnectionType expectedType)
@Nullable protected Connection getValidatedConnection(ConnectionStore store, NamespacedId connectionId, ConnectionType expectedType) throws IOException
store - the connection store to read fromconnectionId - the id of the connectionexpectedType - the expected type of the connectionConnectionNotFoundException - if the connection does not existIOException - if there was an error reading from the storeprotected <T> void respond(io.cdap.cdap.api.service.http.HttpServiceRequest request,
io.cdap.cdap.api.service.http.HttpServiceResponder responder,
Callable<T> callable)
StatusCodeException, the exception's status code and message will be used
to create the response.
If a JsonSyntaxException is thrown, a 400 response will be sent.
If anything else if thrown, a 500 response will be sent.
If nothing is thrown, the result of the callable will be sent as json.request - the http requestresponder - the http respondercallable - the endpoint logic to runprotected <T> void respond(io.cdap.cdap.api.service.http.HttpServiceRequest request,
io.cdap.cdap.api.service.http.HttpServiceResponder responder,
String namespace,
AbstractWranglerHandler.NamespacedResponder<T> callable)
StatusCodeException, the exception's status code and message will be used
to create the response.
If a JsonSyntaxException is thrown, a 400 response will be sent.
If anything else if thrown, a 500 response will be sent.
If nothing is thrown, the result of the callable will be sent as json.request - the http requestresponder - the http respondernamespace - the namespace to check forcallable - the endpoint logic to runCopyright © 2020 CDAP Licensed under the Apache License, Version 2.0.