@@ -240,57 +240,16 @@ private <T> void validate(final String configId, final List<ConfigWithMetadata<T
240240 }
241241 }
242242
243- private <T > ConfigWithMetadata <T > validateAndReturn (final String configId ,
244- final List <ConfigWithMetadata <T >> result ,
245- final AirbyteConfig airbyteConfig )
246- throws ConfigNotFoundException {
247- validate (configId , result , airbyteConfig );
248- return result .get (0 );
249- }
250-
251243 @ Override
252244 public <T > List <T > listConfigs (final AirbyteConfig configType , final Class <T > clazz ) throws JsonValidationException , IOException {
253245 final List <T > config = new ArrayList <>();
254246 listConfigsWithMetadata (configType , clazz ).forEach (c -> config .add (c .getConfig ()));
255247 return config ;
256248 }
257249
258- @ Override
259- public <T > ConfigWithMetadata <T > getConfigWithMetadata (final AirbyteConfig configType , final String configId , final Class <T > clazz )
260- throws ConfigNotFoundException , JsonValidationException , IOException {
261- final Optional <UUID > configIdOpt = Optional .of (UUID .fromString (configId ));
262- if (configType == ConfigSchema .STANDARD_WORKSPACE ) {
263- return (ConfigWithMetadata <T >) validateAndReturn (configId , listStandardWorkspaceWithMetadata (configIdOpt ), configType );
264- } else if (configType == ConfigSchema .STANDARD_SOURCE_DEFINITION ) {
265- return (ConfigWithMetadata <T >) validateAndReturn (configId , listStandardSourceDefinitionWithMetadata (configIdOpt ), configType );
266- } else if (configType == ConfigSchema .STANDARD_DESTINATION_DEFINITION ) {
267- return (ConfigWithMetadata <T >) validateAndReturn (configId , listStandardDestinationDefinitionWithMetadata (configIdOpt ), configType );
268- } else if (configType == ConfigSchema .SOURCE_CONNECTION ) {
269- return (ConfigWithMetadata <T >) validateAndReturn (configId , listSourceConnectionWithMetadata (configIdOpt ), configType );
270- } else if (configType == ConfigSchema .DESTINATION_CONNECTION ) {
271- return (ConfigWithMetadata <T >) validateAndReturn (configId , listDestinationConnectionWithMetadata (configIdOpt ), configType );
272- } else if (configType == ConfigSchema .SOURCE_OAUTH_PARAM ) {
273- return (ConfigWithMetadata <T >) validateAndReturn (configId , listSourceOauthParamWithMetadata (configIdOpt ), configType );
274- } else if (configType == ConfigSchema .DESTINATION_OAUTH_PARAM ) {
275- return (ConfigWithMetadata <T >) validateAndReturn (configId , listDestinationOauthParamWithMetadata (configIdOpt ), configType );
276- } else if (configType == ConfigSchema .STANDARD_SYNC_OPERATION ) {
277- return (ConfigWithMetadata <T >) validateAndReturn (configId , listStandardSyncOperationWithMetadata (configIdOpt ), configType );
278- } else if (configType == ConfigSchema .STANDARD_SYNC ) {
279- return (ConfigWithMetadata <T >) validateAndReturn (configId , listStandardSyncWithMetadata (configIdOpt ), configType );
280- } else if (configType == ConfigSchema .STANDARD_SYNC_STATE ) {
281- return (ConfigWithMetadata <T >) validateAndReturn (configId , listStandardSyncStateWithMetadata (configIdOpt ), configType );
282- } else if (configType == ConfigSchema .ACTOR_CATALOG ) {
283- return (ConfigWithMetadata <T >) validateAndReturn (configId , listActorCatalogWithMetadata (configIdOpt ), configType );
284- } else if (configType == ConfigSchema .ACTOR_CATALOG_FETCH_EVENT ) {
285- return (ConfigWithMetadata <T >) validateAndReturn (configId , listActorCatalogFetchEventWithMetadata (configIdOpt ), configType );
286- } else if (configType == ConfigSchema .WORKSPACE_SERVICE_ACCOUNT ) {
287- return (ConfigWithMetadata <T >) validateAndReturn (configId , listWorkspaceServiceAccountWithMetadata (configIdOpt ), configType );
288- } else {
289- throw new IllegalArgumentException (UNKNOWN_CONFIG_TYPE + configType );
290- }
291- }
292-
293- @ Override
250+ // listConfigWithMetadata seems to be unused at this point.
251+ // It is only called by listConfigs and it only reads the config. The "metadata" part seems to be
252+ // unused.
294253 public <T > List <ConfigWithMetadata <T >> listConfigsWithMetadata (final AirbyteConfig configType , final Class <T > clazz ) throws IOException {
295254 final List <ConfigWithMetadata <T >> configWithMetadata = new ArrayList <>();
296255 if (configType == ConfigSchema .STANDARD_WORKSPACE ) {
0 commit comments