use of io.cdap.cdap.etl.api.connector.ConnectorConfigurer in project cdap by caskdata.
the class ConnectionHandler method browseLocally.
private void browseLocally(String namespace, BrowseRequest browseRequest, Connection conn, HttpServiceResponder responder) throws IOException {
ServicePluginConfigurer pluginConfigurer = getContext().createServicePluginConfigurer(namespace);
ConnectorConfigurer connectorConfigurer = new DefaultConnectorConfigurer(pluginConfigurer);
ConnectorContext connectorContext = new DefaultConnectorContext(new SimpleFailureCollector(), pluginConfigurer);
TrackedPluginSelector pluginSelector = new TrackedPluginSelector(new ArtifactSelectorProvider().getPluginSelector(conn.getPlugin().getArtifact()));
try (Connector connector = getConnector(pluginConfigurer, conn.getPlugin(), namespace, pluginSelector)) {
connector.configure(connectorConfigurer);
responder.sendJson(connector.browse(connectorContext, browseRequest));
}
}
Aggregations