Search in sources :

Example 1 with ServerConfig

use of org.kie.server.controller.api.model.spec.ServerConfig in project kie-wb-common by kiegroup.

the class NewServerTemplateWizard method buildServerTemplate.

private ServerTemplate buildServerTemplate() {
    final Collection<String> capabilities = new ArrayList<String>();
    final Map<Capability, ServerConfig> capabilityConfig = new HashMap<Capability, ServerConfig>();
    final Map<Capability, ContainerConfig> capabilityContainerConfig = new HashMap<Capability, ContainerConfig>();
    final Collection<ContainerSpec> containersSpec = new ArrayList<ContainerSpec>();
    if (newTemplatePresenter.isProcessCapabilityChecked()) {
        capabilities.add(Capability.PROCESS.toString());
        if (!newContainerFormPresenter.isEmpty()) {
            capabilityContainerConfig.put(Capability.PROCESS, processConfigPagePresenter.buildProcessConfig());
        }
    }
    capabilityContainerConfig.put(Capability.RULE, new RuleConfig(null, KieScannerStatus.STOPPED));
    if (newTemplatePresenter.isRuleCapabilityChecked()) {
        capabilities.add(Capability.RULE.toString());
    }
    if (newTemplatePresenter.isPlanningCapabilityChecked()) {
        capabilities.add(Capability.PLANNING.toString());
    }
    if (!newContainerFormPresenter.isEmpty()) {
        containersSpec.add(newContainerFormPresenter.buildContainerSpec(newTemplatePresenter.getTemplateName(), capabilityContainerConfig));
    }
    return new ServerTemplate(newTemplatePresenter.getTemplateName(), newTemplatePresenter.getTemplateName(), capabilities, capabilityConfig, containersSpec);
}
Also used : Capability(org.kie.server.controller.api.model.spec.Capability) HashMap(java.util.HashMap) ContainerSpec(org.kie.server.controller.api.model.spec.ContainerSpec) ArrayList(java.util.ArrayList) ContainerConfig(org.kie.server.controller.api.model.spec.ContainerConfig) ServerConfig(org.kie.server.controller.api.model.spec.ServerConfig) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) RuleConfig(org.kie.server.controller.api.model.spec.RuleConfig)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Capability (org.kie.server.controller.api.model.spec.Capability)1 ContainerConfig (org.kie.server.controller.api.model.spec.ContainerConfig)1 ContainerSpec (org.kie.server.controller.api.model.spec.ContainerSpec)1 RuleConfig (org.kie.server.controller.api.model.spec.RuleConfig)1 ServerConfig (org.kie.server.controller.api.model.spec.ServerConfig)1 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)1