RuleConfig makeRuleConfig() { return new RuleConfig(null, KieScannerStatus.STOPPED); }
capabilityContainerConfig.put( Capability.RULE, new RuleConfig( null, KieScannerStatus.STOPPED ) );
@Override public void complete() { final Map<Capability, ContainerConfig> mapConfig = new HashMap<Capability, ContainerConfig>(); if ( getPages().size() == 2 ) { mapConfig.put( Capability.PROCESS, processConfigPagePresenter.buildProcessConfig() ); } mapConfig.put( Capability.RULE, new RuleConfig( null, KieScannerStatus.STOPPED ) ); final ContainerSpec newContainer = newContainerFormPresenter.buildContainerSpec( newContainerFormPresenter.getServerTemplate().getId(), mapConfig ); specManagementService.call( new RemoteCallback<Void>() { @Override public void callback( final Void o ) { notification.fire( new NotificationEvent( newContainerFormPresenter.getView().getNewContainerWizardSaveSuccess(), NotificationEvent.NotificationType.SUCCESS ) ); clear(); NewContainerWizard.super.complete(); serverTemplateSelectedEvent.fire( new ServerTemplateSelected( serverTemplate, newContainer.getId() ) ); } }, new ErrorCallback<Object>() { @Override public boolean error( final Object o, final Throwable throwable ) { notification.fire( new NotificationEvent( newContainerFormPresenter.getView().getNewContainerWizardSaveError(), NotificationEvent.NotificationType.ERROR ) ); NewContainerWizard.this.pageSelected( 0 ); NewContainerWizard.this.start(); return false; } } ).saveContainerSpec( newContainerFormPresenter.getServerTemplate().getId(), newContainer ); }
private ContainerConfig copy(final ContainerConfig _value) { if (_value instanceof RuleConfig) { final RuleConfig value = (RuleConfig) _value; return new RuleConfig(value.getPollInterval(), value.getScannerStatus()); } else if (_value instanceof ProcessConfig) { final ProcessConfig value = (ProcessConfig) _value; return new ProcessConfig(value.getRuntimeStrategy(), value.getKBase(), value.getKSession(), value.getMergeMode()); } return null; }
@Test public void testOnConfigUpdateNoUpdate() { final RuleConfigUpdated ruleConfigUpdated = new RuleConfigUpdated(); ruleConfigUpdated.setContainerSpecKey(new ContainerSpecKey()); ruleConfigUpdated.setRuleConfig(new RuleConfig()); presenter.setup(containerSpec, ruleConfig); presenter.onConfigUpdate(ruleConfigUpdated); verify(view).setContent(anyString(), anyString(), any(State.class), any(State.class), any(State.class), any(State.class)); }
new ProcessConfig()); containerSpec.addConfig(Capability.RULE, new RuleConfig()); containers = new ArrayList<Container>(); containerSpecData = new ContainerSpecData(containerSpec,
@Override public void startScanner(final ContainerSpecKey containerSpecKey, final Long interval) { ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId()); if (serverTemplate == null) { throw new KieServerControllerIllegalArgumentException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId()); } ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId()); if (containerSpec == null) { throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecKey.getId()); } ContainerConfig containerConfig = containerSpec.getConfigs().get(Capability.RULE); if (containerConfig == null) { containerConfig = new RuleConfig(); containerSpec.getConfigs().put(Capability.RULE, containerConfig); } ((RuleConfig) containerConfig).setPollInterval(interval); ((RuleConfig) containerConfig).setScannerStatus(KieScannerStatus.STARTED); templateStorage.update(serverTemplate); List<Container> containers = kieServerInstanceManager.startScanner(serverTemplate, containerSpec, interval); notificationService.notify(serverTemplate, containerSpec, containers); }
@Override public void stopScanner(final ContainerSpecKey containerSpecKey) { ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId()); if (serverTemplate == null) { throw new KieServerControllerIllegalArgumentException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId()); } ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId()); if (containerSpec == null) { throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecKey.getId()); } ContainerConfig containerConfig = containerSpec.getConfigs().get(Capability.RULE); if (containerConfig == null) { containerConfig = new RuleConfig(); containerSpec.getConfigs().put(Capability.RULE, containerConfig); } if(((RuleConfig) containerConfig).getScannerStatus() == KieScannerStatus.STOPPED){ return; } ((RuleConfig) containerConfig).setPollInterval(null); ((RuleConfig) containerConfig).setScannerStatus(KieScannerStatus.STOPPED); templateStorage.update(serverTemplate); List<Container> containers = kieServerInstanceManager.stopScanner(serverTemplate, containerSpec); notificationService.notify(serverTemplate, containerSpec, containers); }
"kSession", "mergeMode"); final RuleConfig ruleConfig = new RuleConfig(1l, KieScannerStatus.SCANNING); KieServerControllerDescriptorCommand command = new KieServerControllerDescriptorCommand(SpecManagementService.class.getName(),
ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(1000l); ruleConfig.setScannerStatus(KieScannerStatus.STARTED);
spec.addConfig(Capability.PROCESS, processConfig); final RuleConfig ruleConfig = new RuleConfig(1L, KieScannerStatus.SCANNING); spec.addConfig(Capability.RULE,
RuleConfig ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(1000l); ruleConfig.setScannerStatus(KieScannerStatus.STARTED);
RuleConfig ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(1000l); ruleConfig.setScannerStatus(KieScannerStatus.STARTED);
RuleConfig ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(1000l); ruleConfig.setScannerStatus(KieScannerStatus.STARTED);
RuleConfig ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(1000l); ruleConfig.setScannerStatus(KieScannerStatus.STARTED);
RuleConfig ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(1000l); ruleConfig.setScannerStatus(KieScannerStatus.STARTED);
RuleConfig ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(1000l); ruleConfig.setScannerStatus(KieScannerStatus.STARTED); assertEquals(ruleConfig.getScannerStatus(), ((org.kie.server.controller.api.model.spec.RuleConfig) ruleConfigCurrent).getScannerStatus()); ContainerConfig containerConfig = new RuleConfig(); ((RuleConfig) containerConfig).setScannerStatus(KieScannerStatus.SCANNING); ((RuleConfig) containerConfig).setPollInterval(10l);
spec.addConfig(Capability.PROCESS, processConfig); final RuleConfig ruleConfig = new RuleConfig(1L, KieScannerStatus.SCANNING); spec.addConfig(Capability.RULE,
spec.addConfig(Capability.PROCESS, processConfig); final RuleConfig ruleConfig = new RuleConfig(1L, KieScannerStatus.SCANNING); spec.addConfig(Capability.RULE,