109
109
import io .airbyte .config .persistence .ConfigRepository ;
110
110
import io .airbyte .config .persistence .SecretsRepositoryReader ;
111
111
import io .airbyte .config .persistence .SecretsRepositoryWriter ;
112
+ import io .airbyte .config .persistence .StatePersistence ;
112
113
import io .airbyte .persistence .job .JobPersistence ;
113
114
import io .airbyte .persistence .job .WorkspaceHelper ;
114
115
import io .airbyte .server .errors .BadObjectSchemaKnownException ;
117
118
import io .airbyte .server .handlers .DestinationDefinitionsHandler ;
118
119
import io .airbyte .server .handlers .DestinationHandler ;
119
120
import io .airbyte .server .handlers .JobHistoryHandler ;
121
+ import io .airbyte .server .handlers .OperationsHandler ;
120
122
import io .airbyte .server .handlers .SchedulerHandler ;
121
123
import io .airbyte .server .handlers .SourceDefinitionsHandler ;
122
124
import io .airbyte .server .handlers .SourceHandler ;
125
+ import io .airbyte .server .handlers .StateHandler ;
126
+ import io .airbyte .server .handlers .WebBackendConnectionsHandler ;
127
+ import io .airbyte .server .handlers .WebBackendGeographiesHandler ;
123
128
import io .airbyte .server .handlers .WorkspacesHandler ;
124
129
import io .airbyte .server .scheduler .EventRunner ;
125
130
import io .airbyte .server .scheduler .SynchronousSchedulerClient ;
@@ -141,14 +146,19 @@ public class ConfigurationApi implements io.airbyte.api.generated.V1Api {
141
146
private final DestinationDefinitionsHandler destinationDefinitionsHandler ;
142
147
private final DestinationHandler destinationHandler ;
143
148
private final ConnectionsHandler connectionsHandler ;
149
+ private final OperationsHandler operationsHandler ;
144
150
private final SchedulerHandler schedulerHandler ;
151
+ private final StateHandler stateHandler ;
145
152
private final JobHistoryHandler jobHistoryHandler ;
153
+ private final WebBackendConnectionsHandler webBackendConnectionsHandler ;
154
+ private final WebBackendGeographiesHandler webBackendGeographiesHandler ;
146
155
147
156
public ConfigurationApi (final ConfigRepository configRepository ,
148
157
final JobPersistence jobPersistence ,
149
158
final SecretsRepositoryReader secretsRepositoryReader ,
150
159
final SecretsRepositoryWriter secretsRepositoryWriter ,
151
160
final SynchronousSchedulerClient synchronousSchedulerClient ,
161
+ final StatePersistence statePersistence ,
152
162
final TrackingClient trackingClient ,
153
163
final WorkerEnvironment workerEnvironment ,
154
164
final LogConfigs logConfigs ,
@@ -176,13 +186,15 @@ public ConfigurationApi(final ConfigRepository configRepository,
176
186
eventRunner ,
177
187
connectionsHandler );
178
188
189
+ stateHandler = new StateHandler (statePersistence );
179
190
sourceHandler = new SourceHandler (
180
191
configRepository ,
181
192
secretsRepositoryReader ,
182
193
secretsRepositoryWriter ,
183
194
schemaValidator ,
184
195
connectionsHandler );
185
196
sourceDefinitionsHandler = new SourceDefinitionsHandler (configRepository , synchronousSchedulerClient , sourceHandler );
197
+ operationsHandler = new OperationsHandler (configRepository );
186
198
destinationHandler = new DestinationHandler (
187
199
configRepository ,
188
200
secretsRepositoryReader ,
@@ -198,6 +210,17 @@ public ConfigurationApi(final ConfigRepository configRepository,
198
210
sourceHandler );
199
211
jobHistoryHandler = new JobHistoryHandler (jobPersistence , workerEnvironment , logConfigs , connectionsHandler , sourceHandler ,
200
212
sourceDefinitionsHandler , destinationHandler , destinationDefinitionsHandler , airbyteVersion );
213
+ webBackendConnectionsHandler = new WebBackendConnectionsHandler (
214
+ connectionsHandler ,
215
+ stateHandler ,
216
+ sourceHandler ,
217
+ destinationHandler ,
218
+ jobHistoryHandler ,
219
+ schedulerHandler ,
220
+ operationsHandler ,
221
+ eventRunner ,
222
+ configRepository );
223
+ webBackendGeographiesHandler = new WebBackendGeographiesHandler ();
201
224
}
202
225
203
226
// WORKSPACE
@@ -394,7 +417,7 @@ public void revokeSourceDefinitionFromWorkspace(final SourceDefinitionIdWithWork
394
417
395
418
@ Override
396
419
public InternalOperationResult saveStats (final SaveStatsRequestBody saveStatsRequestBody ) {
397
- throw new NotImplementedException ();
420
+ throw new UnsupportedOperationException ();
398
421
}
399
422
400
423
// SOURCE SPECIFICATION
@@ -1093,67 +1116,39 @@ public HealthCheckRead getHealthCheck() {
1093
1116
1094
1117
// WEB BACKEND
1095
1118
1096
- /**
1097
- * This implementation has been moved to {@link HealthApiController}. Since the path of
1098
- * {@link HealthApiController} is more granular, it will override this implementation
1099
- */
1100
1119
@ Override
1101
1120
public WebBackendConnectionReadList webBackendListConnectionsForWorkspace (final WorkspaceIdRequestBody workspaceIdRequestBody ) {
1102
- throw new NotImplementedException ( );
1121
+ return execute (() -> webBackendConnectionsHandler . webBackendListConnectionsForWorkspace ( workspaceIdRequestBody ) );
1103
1122
}
1104
1123
1105
- /**
1106
- * This implementation has been moved to {@link HealthApiController}. Since the path of
1107
- * {@link HealthApiController} is more granular, it will override this implementation
1108
- */
1109
1124
@ Override
1110
1125
public WebBackendGeographiesListResult webBackendListGeographies () {
1111
- throw new NotImplementedException ( );
1126
+ return execute ( webBackendGeographiesHandler :: listGeographiesOSS );
1112
1127
}
1113
1128
1114
- /**
1115
- * This implementation has been moved to {@link HealthApiController}. Since the path of
1116
- * {@link HealthApiController} is more granular, it will override this implementation
1117
- */
1118
1129
@ Override
1119
1130
public WebBackendConnectionRead webBackendGetConnection (final WebBackendConnectionRequestBody webBackendConnectionRequestBody ) {
1120
- throw new NotImplementedException ( );
1131
+ return execute (() -> webBackendConnectionsHandler . webBackendGetConnection ( webBackendConnectionRequestBody ) );
1121
1132
}
1122
1133
1123
- /**
1124
- * This implementation has been moved to {@link HealthApiController}. Since the path of
1125
- * {@link HealthApiController} is more granular, it will override this implementation
1126
- */
1127
1134
@ Override
1128
1135
public WebBackendConnectionRead webBackendCreateConnection (final WebBackendConnectionCreate webBackendConnectionCreate ) {
1129
- throw new NotImplementedException ( );
1136
+ return execute (() -> webBackendConnectionsHandler . webBackendCreateConnection ( webBackendConnectionCreate ) );
1130
1137
}
1131
1138
1132
- /**
1133
- * This implementation has been moved to {@link HealthApiController}. Since the path of
1134
- * {@link HealthApiController} is more granular, it will override this implementation
1135
- */
1136
1139
@ Override
1137
1140
public WebBackendConnectionRead webBackendUpdateConnection (final WebBackendConnectionUpdate webBackendConnectionUpdate ) {
1138
- throw new NotImplementedException ( );
1141
+ return execute (() -> webBackendConnectionsHandler . webBackendUpdateConnection ( webBackendConnectionUpdate ) );
1139
1142
}
1140
1143
1141
- /**
1142
- * This implementation has been moved to {@link HealthApiController}. Since the path of
1143
- * {@link HealthApiController} is more granular, it will override this implementation
1144
- */
1145
1144
@ Override
1146
1145
public ConnectionStateType getStateType (final ConnectionIdRequestBody connectionIdRequestBody ) {
1147
- throw new NotImplementedException ( );
1146
+ return ConfigurationApi . execute (() -> webBackendConnectionsHandler . getStateType ( connectionIdRequestBody ) );
1148
1147
}
1149
1148
1150
- /**
1151
- * This implementation has been moved to {@link HealthApiController}. Since the path of
1152
- * {@link HealthApiController} is more granular, it will override this implementation
1153
- */
1154
1149
@ Override
1155
1150
public WebBackendWorkspaceStateResult webBackendGetWorkspaceState (final WebBackendWorkspaceState webBackendWorkspaceState ) {
1156
- throw new NotImplementedException ( );
1151
+ return execute (() -> webBackendConnectionsHandler . getWorkspaceState ( webBackendWorkspaceState ) );
1157
1152
}
1158
1153
1159
1154
// TODO: Move to common when all the api are moved
0 commit comments