-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Extract Operation API * Extract scheduler API * Format * extract source api * Extract source definition api * Add path * Extract State API * extract webbackend api * extract webbackend api * extract workspace api * Extract source definition specification api * Remove configuration API
- Loading branch information
1 parent
78fb528
commit 41f3c0a
Showing
26 changed files
with
140 additions
and
1,338 deletions.
There are no files selected for viewing
20 changes: 0 additions & 20 deletions
20
airbyte-server/src/main/java/io/airbyte/server/ConfigurationApiBinder.java
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
airbyte-server/src/main/java/io/airbyte/server/ConfigurationApiFactory.java
This file was deleted.
Oops, something went wrong.
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
35 changes: 35 additions & 0 deletions
35
airbyte-server/src/main/java/io/airbyte/server/apis/ApiHelper.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,35 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.server.apis; | ||
|
||
import io.airbyte.config.persistence.ConfigNotFoundException; | ||
import io.airbyte.server.errors.BadObjectSchemaKnownException; | ||
import io.airbyte.server.errors.IdNotFoundKnownException; | ||
import io.airbyte.validation.json.JsonValidationException; | ||
import java.io.IOException; | ||
|
||
public class ApiHelper { | ||
|
||
static <T> T execute(final HandlerCall<T> call) { | ||
try { | ||
return call.call(); | ||
} catch (final ConfigNotFoundException e) { | ||
throw new IdNotFoundKnownException(String.format("Could not find configuration for %s: %s.", e.getType(), e.getConfigId()), | ||
e.getConfigId(), e); | ||
} catch (final JsonValidationException e) { | ||
throw new BadObjectSchemaKnownException( | ||
String.format("The provided configuration does not fulfill the specification. Errors: %s", e.getMessage()), e); | ||
} catch (final IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
interface HandlerCall<T> { | ||
|
||
T call() throws ConfigNotFoundException, IOException, JsonValidationException; | ||
|
||
} | ||
|
||
} |
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.