Search in sources :

Example 1 with ProviderConfig

use of org.guvnor.ala.config.ProviderConfig in project kie-wb-common by kiegroup.

the class ProviderServiceImplTest method prepareConfigurationForCreate.

private void prepareConfigurationForCreate() {
    providerConfiguration = mock(ProviderConfiguration.class);
    Map values = mock(Map.class);
    when(values.size()).thenReturn(5);
    when(providerConfiguration.getValues()).thenReturn(values);
    providerConfig = mock(ProviderConfig.class);
    when(providerConfigConverter.toDomain(providerConfiguration)).thenReturn(providerConfig);
}
Also used : ProviderConfig(org.guvnor.ala.config.ProviderConfig) Map(java.util.Map) ProviderConfiguration(org.guvnor.ala.ui.model.ProviderConfiguration)

Example 2 with ProviderConfig

use of org.guvnor.ala.config.ProviderConfig in project kie-wb-common by kiegroup.

the class OpenShiftAccessInterfaceImpl method getOpenShiftClient.

@Override
public OpenShiftClient getOpenShiftClient(final ProviderId providerId) {
    if (!clientMap.containsKey(providerId.getId())) {
        checkInstanceOf("providerId", providerId, OpenShiftProvider.class);
        ProviderConfig providerConfig = ((OpenShiftProvider) providerId).getConfig();
        OpenShiftClient client = newOpenShiftClient(providerConfig);
        clientMap.put(providerId.getId(), client);
    }
    return clientMap.get(providerId.getId());
}
Also used : ProviderConfig(org.guvnor.ala.config.ProviderConfig) OpenShiftProviderConfig(org.guvnor.ala.openshift.config.OpenShiftProviderConfig) OpenShiftClient(org.guvnor.ala.openshift.access.OpenShiftClient) DefaultOpenShiftClient(io.fabric8.openshift.client.DefaultOpenShiftClient) OpenShiftProvider(org.guvnor.ala.openshift.model.OpenShiftProvider)

Example 3 with ProviderConfig

use of org.guvnor.ala.config.ProviderConfig in project kie-wb-common by kiegroup.

the class RuntimeProvisioningServiceBackendImplTest method testRegisterProvider.

@Test
public void testRegisterProvider() {
    ProviderConfig providerConfig = mock(ProviderConfig.class);
    runtimeProvisioningServiceBackend.registerProvider(providerConfig);
    verify(runtimeProvisioningService, times(1)).registerProvider(providerConfig);
}
Also used : ProviderConfig(org.guvnor.ala.config.ProviderConfig) Test(org.junit.Test)

Example 4 with ProviderConfig

use of org.guvnor.ala.config.ProviderConfig in project kie-wb-common by kiegroup.

the class ProviderServiceImpl method createProvider.

@Override
public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) {
    checkNotNull("providerType", providerType);
    checkNotNull("providerType.providerTypeKey", providerType.getKey());
    checkNotNull("configuration", configuration);
    checkNotEmpty("configuration.values", configuration.getValues());
    validateForCreateProvider(configuration);
    @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration);
    runtimeProvisioningService.registerProvider(providerConfig);
}
Also used : ProviderConfig(org.guvnor.ala.config.ProviderConfig)

Aggregations

ProviderConfig (org.guvnor.ala.config.ProviderConfig)4 DefaultOpenShiftClient (io.fabric8.openshift.client.DefaultOpenShiftClient)1 Map (java.util.Map)1 OpenShiftClient (org.guvnor.ala.openshift.access.OpenShiftClient)1 OpenShiftProviderConfig (org.guvnor.ala.openshift.config.OpenShiftProviderConfig)1 OpenShiftProvider (org.guvnor.ala.openshift.model.OpenShiftProvider)1 ProviderConfiguration (org.guvnor.ala.ui.model.ProviderConfiguration)1 Test (org.junit.Test)1