forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exposing SSL-only version of Postgres Source (airbytehq#6362)
- Loading branch information
Showing
22 changed files
with
605 additions
and
69 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...ava/src/main/java/io/airbyte/integrations/base/spec_modification/SpecModifyingSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.base.spec_modification; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import io.airbyte.commons.util.AutoCloseableIterator; | ||
import io.airbyte.integrations.base.Source; | ||
import io.airbyte.protocol.models.AirbyteCatalog; | ||
import io.airbyte.protocol.models.AirbyteConnectionStatus; | ||
import io.airbyte.protocol.models.AirbyteMessage; | ||
import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; | ||
import io.airbyte.protocol.models.ConnectorSpecification; | ||
|
||
/** | ||
* In some cases we want to prune or mutate the spec for an existing source. The common case is that | ||
* we want to remove features that are not appropriate for some reason. e.g. In cloud, we do not | ||
* want to allow users to send data unencrypted. | ||
*/ | ||
public abstract class SpecModifyingSource implements Source { | ||
|
||
private final Source source; | ||
|
||
public SpecModifyingSource(final Source source) { | ||
this.source = source; | ||
} | ||
|
||
public abstract ConnectorSpecification modifySpec(ConnectorSpecification originalSpec) throws Exception; | ||
|
||
@Override | ||
public ConnectorSpecification spec() throws Exception { | ||
return modifySpec(source.spec()); | ||
} | ||
|
||
@Override | ||
public AirbyteConnectionStatus check(final JsonNode config) throws Exception { | ||
return source.check(config); | ||
} | ||
|
||
@Override | ||
public AirbyteCatalog discover(final JsonNode config) throws Exception { | ||
return source.discover(config); | ||
} | ||
|
||
@Override | ||
public AutoCloseableIterator<AirbyteMessage> read(final JsonNode config, final ConfiguredAirbyteCatalog catalog, final JsonNode state) | ||
throws Exception { | ||
return source.read(config, catalog, state); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.