-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bmoric/extract source definition specification api (#18997)
* 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
- Loading branch information
1 parent
f22485a
commit 77d22c5
Showing
6 changed files
with
93 additions
and
162 deletions.
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
...rver/src/main/java/io/airbyte/server/apis/SourceDefinitionSpecificationApiController.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,25 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.server.apis; | ||
|
||
import io.airbyte.api.generated.SourceDefinitionSpecificationApi; | ||
import io.airbyte.api.model.generated.SourceDefinitionIdWithWorkspaceId; | ||
import io.airbyte.api.model.generated.SourceDefinitionSpecificationRead; | ||
import io.airbyte.server.handlers.SchedulerHandler; | ||
import javax.ws.rs.Path; | ||
import lombok.AllArgsConstructor; | ||
|
||
@Path("/v1/source_definition_specifications/get") | ||
@AllArgsConstructor | ||
public class SourceDefinitionSpecificationApiController implements SourceDefinitionSpecificationApi { | ||
|
||
private final SchedulerHandler schedulerHandler; | ||
|
||
@Override | ||
public SourceDefinitionSpecificationRead getSourceDefinitionSpecification(final SourceDefinitionIdWithWorkspaceId sourceDefinitionIdWithWorkspaceId) { | ||
return ConfigurationApi.execute(() -> schedulerHandler.getSourceDefinitionSpecification(sourceDefinitionIdWithWorkspaceId)); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
.../src/main/java/io/airbyte/server/apis/binders/SourceDefinitionSpecificationApiBinder.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,21 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.server.apis.binders; | ||
|
||
import io.airbyte.server.apis.SourceDefinitionSpecificationApiController; | ||
import io.airbyte.server.apis.factories.SourceDefinitionSpecificationApiFactory; | ||
import org.glassfish.hk2.utilities.binding.AbstractBinder; | ||
import org.glassfish.jersey.process.internal.RequestScoped; | ||
|
||
public class SourceDefinitionSpecificationApiBinder extends AbstractBinder { | ||
|
||
@Override | ||
protected void configure() { | ||
bindFactory(SourceDefinitionSpecificationApiFactory.class) | ||
.to(SourceDefinitionSpecificationApiController.class) | ||
.in(RequestScoped.class); | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
...c/main/java/io/airbyte/server/apis/factories/SourceDefinitionSpecificationApiFactory.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,29 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.server.apis.factories; | ||
|
||
import io.airbyte.server.apis.SourceDefinitionSpecificationApiController; | ||
import io.airbyte.server.handlers.SchedulerHandler; | ||
import org.glassfish.hk2.api.Factory; | ||
|
||
public class SourceDefinitionSpecificationApiFactory implements Factory<SourceDefinitionSpecificationApiController> { | ||
|
||
private static SchedulerHandler schedulerHandler; | ||
|
||
public static void setValues(final SchedulerHandler schedulerHandler) { | ||
SourceDefinitionSpecificationApiFactory.schedulerHandler = schedulerHandler; | ||
} | ||
|
||
@Override | ||
public SourceDefinitionSpecificationApiController provide() { | ||
return new SourceDefinitionSpecificationApiController(SourceDefinitionSpecificationApiFactory.schedulerHandler); | ||
} | ||
|
||
@Override | ||
public void dispose(final SourceDefinitionSpecificationApiController instance) { | ||
/* no op */ | ||
} | ||
|
||
} |