use of org.guvnor.ala.openshift.model.OpenShiftProvider in project kie-wb-common by kiegroup.
the class OpenShiftProviderConfigExecutor method apply.
@Override
public Optional<OpenShiftProvider> apply(final OpenShiftProviderConfig openshiftProviderConfig) {
if (openshiftProviderConfig.getName() == null || openshiftProviderConfig.getName().isEmpty()) {
throw new ProvisioningException("No name was provided for the OpenShiftProviderConfig.getName() " + "configuration parameter. You might probably have to properly set " + "the pipeline input parameter: " + ProviderConfig.PROVIDER_NAME);
}
Provider provider = runtimeRegistry.getProvider(openshiftProviderConfig.getName());
OpenShiftProvider openshiftProvider;
if (provider != null) {
if (!(provider instanceof OpenShiftProvider)) {
throw new ProvisioningException("The provider: " + openshiftProviderConfig.getName() + " must be an instance of " + OpenShiftProviderConfig.class + " but is: " + provider.getClass());
} else {
openshiftProvider = (OpenShiftProvider) provider;
}
} else {
openshiftProvider = new OpenShiftProviderImpl(openshiftProviderConfig.getName(), openshiftProviderConfig);
runtimeRegistry.registerProvider(openshiftProvider);
}
return Optional.of(openshiftProvider);
}
use of org.guvnor.ala.openshift.model.OpenShiftProvider in project kie-wb-common by kiegroup.
the class OpenShiftRuntimeMarshallerTest method getValue.
@Override
public OpenShiftRuntime getValue() {
OpenShiftProvider providerId = createOpenShiftProvider();
OpenShiftRuntimeConfig runtimeConfig = new ContextAwareOpenShiftRuntimeExecConfig(RUNTIME_NAME, providerId, APPLICATION_NAME, KIE_SERVER_CONTAINER_DEPLOYMENT, PROJECT_NAME, RESOURCE_SECRETS_URI, RESOURCE_STREAMS_URI, RESOURCE_TEMPLATE_NAME, RESOURCE_TEMPLATE_PARAM_DELIMITER, RESOURCE_TEMPLATE_PARAM_ASSIGNER, RESOURCE_TEMPLATE_PARAM_VALUES, RESOURCE_TEMPLATE_URI, SERVICE_NAME);
return new OpenShiftRuntime(RUNTIME_ID, RUNTIME_NAME, runtimeConfig, providerId, new OpenShiftRuntimeEndpoint(PROTOCOL, HOST, PORT, CONTEXT), new OpenShiftRuntimeInfo(runtimeConfig), new OpenShiftRuntimeState(STATE, STARTED_AT));
}
Aggregations