Search in sources :

Example 1 with RequestScope

use of org.springframework.web.context.annotation.RequestScope in project workbench by all-of-us.

the class NotebooksConfig method notebooksApi.

@Bean
@RequestScope(proxyMode = ScopedProxyMode.DEFAULT)
public NotebooksApi notebooksApi(@Qualifier(NOTEBOOKS_CLIENT) ApiClient apiClient) {
    NotebooksApi api = new NotebooksApi();
    api.setApiClient(apiClient);
    return api;
}
Also used : NotebooksApi(org.pmiops.workbench.notebooks.api.NotebooksApi) RequestScope(org.springframework.web.context.annotation.RequestScope) Bean(org.springframework.context.annotation.Bean)

Example 2 with RequestScope

use of org.springframework.web.context.annotation.RequestScope in project workbench by all-of-us.

the class NotebooksConfig method clusterApi.

@Bean
@RequestScope(proxyMode = ScopedProxyMode.DEFAULT)
public ClusterApi clusterApi(@Qualifier(NOTEBOOKS_CLIENT) ApiClient apiClient) {
    ClusterApi api = new ClusterApi();
    api.setApiClient(apiClient);
    return api;
}
Also used : ClusterApi(org.pmiops.workbench.notebooks.api.ClusterApi) RequestScope(org.springframework.web.context.annotation.RequestScope) Bean(org.springframework.context.annotation.Bean)

Example 3 with RequestScope

use of org.springframework.web.context.annotation.RequestScope in project workbench by all-of-us.

the class FireCloudConfig method billingApi.

@Bean
@RequestScope(proxyMode = ScopedProxyMode.DEFAULT)
public BillingApi billingApi(@Qualifier(ALL_OF_US_API_CLIENT) ApiClient apiClient) {
    // Billing calls are made by the AllOfUs service account, rather than using the end user's
    // credentials.
    BillingApi api = new BillingApi();
    api.setApiClient(apiClient);
    return api;
}
Also used : BillingApi(org.pmiops.workbench.firecloud.api.BillingApi) RequestScope(org.springframework.web.context.annotation.RequestScope) Bean(org.springframework.context.annotation.Bean)

Example 4 with RequestScope

use of org.springframework.web.context.annotation.RequestScope in project workbench by all-of-us.

the class FireCloudConfig method allOfUsApiClient.

@Bean(name = ALL_OF_US_API_CLIENT)
@RequestScope(proxyMode = ScopedProxyMode.DEFAULT)
public ApiClient allOfUsApiClient(WorkbenchEnvironment workbenchEnvironment, WorkbenchConfig workbenchConfig) {
    ApiClient apiClient = new ApiClient();
    try {
        apiClient.setAccessToken(getWorkbenchServiceAccountAccessToken(workbenchEnvironment));
        apiClient.setDebugging(workbenchConfig.firecloud.debugEndpoints);
    } catch (IOException e) {
        throw new ServerErrorException(e);
    }
    return apiClient;
}
Also used : IOException(java.io.IOException) ServerErrorException(org.pmiops.workbench.exceptions.ServerErrorException) RequestScope(org.springframework.web.context.annotation.RequestScope) Bean(org.springframework.context.annotation.Bean)

Example 5 with RequestScope

use of org.springframework.web.context.annotation.RequestScope in project workbench by all-of-us.

the class FireCloudConfig method profileApi.

@Bean
@RequestScope(proxyMode = ScopedProxyMode.DEFAULT)
public ProfileApi profileApi(@Qualifier(END_USER_API_CLIENT) ApiClient apiClient) {
    ProfileApi api = new ProfileApi();
    api.setApiClient(apiClient);
    return api;
}
Also used : ProfileApi(org.pmiops.workbench.firecloud.api.ProfileApi) RequestScope(org.springframework.web.context.annotation.RequestScope) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)7 RequestScope (org.springframework.web.context.annotation.RequestScope)7 IOException (java.io.IOException)1 ServerErrorException (org.pmiops.workbench.exceptions.ServerErrorException)1 BillingApi (org.pmiops.workbench.firecloud.api.BillingApi)1 GroupsApi (org.pmiops.workbench.firecloud.api.GroupsApi)1 ProfileApi (org.pmiops.workbench.firecloud.api.ProfileApi)1 WorkspacesApi (org.pmiops.workbench.firecloud.api.WorkspacesApi)1 ClusterApi (org.pmiops.workbench.notebooks.api.ClusterApi)1 NotebooksApi (org.pmiops.workbench.notebooks.api.NotebooksApi)1