Search in sources :

Example 6 with ConnectorConfigurer

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));
    }
}
Also used : Connector(io.cdap.cdap.etl.api.connector.Connector) SimpleFailureCollector(io.cdap.cdap.etl.proto.validation.SimpleFailureCollector) ArtifactSelectorProvider(io.cdap.cdap.etl.common.ArtifactSelectorProvider) DefaultConnectorContext(io.cdap.cdap.datapipeline.connection.DefaultConnectorContext) TrackedPluginSelector(io.cdap.cdap.etl.spec.TrackedPluginSelector) ConnectorContext(io.cdap.cdap.etl.api.connector.ConnectorContext) DefaultConnectorContext(io.cdap.cdap.datapipeline.connection.DefaultConnectorContext) DefaultConnectorConfigurer(io.cdap.cdap.datapipeline.connection.DefaultConnectorConfigurer) DefaultConnectorConfigurer(io.cdap.cdap.datapipeline.connection.DefaultConnectorConfigurer) ConnectorConfigurer(io.cdap.cdap.etl.api.connector.ConnectorConfigurer) ServicePluginConfigurer(io.cdap.cdap.api.service.http.ServicePluginConfigurer)

Aggregations

ServicePluginConfigurer (io.cdap.cdap.api.service.http.ServicePluginConfigurer)6 DefaultConnectorConfigurer (io.cdap.cdap.datapipeline.connection.DefaultConnectorConfigurer)6 Connector (io.cdap.cdap.etl.api.connector.Connector)6 ConnectorConfigurer (io.cdap.cdap.etl.api.connector.ConnectorConfigurer)6 ConnectorContext (io.cdap.cdap.etl.api.connector.ConnectorContext)6 ArtifactSelectorProvider (io.cdap.cdap.etl.common.ArtifactSelectorProvider)6 TrackedPluginSelector (io.cdap.cdap.etl.spec.TrackedPluginSelector)6 DefaultConnectorContext (io.cdap.cdap.datapipeline.connection.DefaultConnectorContext)5 SimpleFailureCollector (io.cdap.cdap.etl.proto.validation.SimpleFailureCollector)5 ConnectorSpec (io.cdap.cdap.etl.api.connector.ConnectorSpec)3 ConnectorSpecRequest (io.cdap.cdap.etl.api.connector.ConnectorSpecRequest)3 ValidationException (io.cdap.cdap.etl.api.validation.ValidationException)2 SampleRequest (io.cdap.cdap.etl.api.connector.SampleRequest)1 Connection (io.cdap.cdap.etl.proto.connection.Connection)1 ConnectionBadRequestException (io.cdap.cdap.etl.proto.connection.ConnectionBadRequestException)1 ConnectionCreationRequest (io.cdap.cdap.etl.proto.connection.ConnectionCreationRequest)1 ConnectorDetail (io.cdap.cdap.etl.proto.connection.ConnectorDetail)1 PluginInfo (io.cdap.cdap.etl.proto.connection.PluginInfo)1 SampleResponse (io.cdap.cdap.etl.proto.connection.SampleResponse)1 SpecGenerationRequest (io.cdap.cdap.etl.proto.connection.SpecGenerationRequest)1