private void index( final Container container, final ContainerCardPresenter cardPresenter ) { if ( !index.containsKey( container.getServerInstanceKey().getServerInstanceId() ) ) { index.put( container.getServerInstanceKey().getServerInstanceId(), new HashMap<String, ContainerCardPresenter>() ); } index.get( container.getServerInstanceKey().getServerInstanceId() ).put( container.getContainerSpecId(), cardPresenter ); }
private Container makeContainer(final String seed) { final Container container = mock(Container.class); doReturn(seed).when(container).getContainerSpecId(); doReturn(mock(ServerInstanceKey.class)).when(container).getServerInstanceKey(); return container; }
index.put( updatedServerInstanceKey, newIndexIndex ); for ( final Container container : serverInstanceUpdated.getServerInstance().getContainers() ) { ContainerCardPresenter presenter = oldIndex.remove( container.getContainerSpecId() ); if ( !container.getStatus().equals( KieContainerStatus.STOPPED ) ) { if ( presenter != null ) { for ( final Container container : serverInstanceUpdated.getServerInstance().getContainers() ) { if ( container.getServerTemplateId().equals( containerSpec.getServerTemplateKey().getId() ) && container.getContainerSpecId().equals( containerSpec.getId() ) ) { buildAndIndexContainer( container );
private ContainerSpecKey buildContainerSpecKey( final Container container ) { return new ContainerSpecKey( container.getContainerSpecId(), container.getContainerName(), new ServerTemplateKey( container.getServerInstanceKey().getServerTemplateId(), "" ) ); } }
@Override public synchronized void updateContainerConfig(final String serverTemplateId, final String containerSpecId, final Capability capability, final ContainerConfig containerConfig) { final ServerTemplate serverTemplate = templateStorage.load(serverTemplateId); if (serverTemplate == null) { throw new KieServerControllerIllegalArgumentException("No server template found for id " + serverTemplateId); } final ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecId); if (containerSpec == null) { throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecId + " within server template with id " + serverTemplateId); } final List<Container> affectedContainers = updateContainerConfig(capability, containerConfig, serverTemplate, containerSpec); if (affectedContainers.isEmpty()) { logInfo("Update of container configuration resulted in no changes to containers running on kie-servers"); } affectedContainers.forEach(ac -> { logDebug("Container {} on server {} was affected by a change in the scanner", ac.getContainerSpecId(), ac.getServerInstanceKey()); }); containerSpec.getConfigs().put(capability, containerConfig); templateStorage.update(serverTemplate); notificationService.notify(new ServerTemplateUpdated(serverTemplate)); }
container1.getContainerSpecId(), container1.getServerInstanceKey()); verify(specManagementService).logDebug("Container {} on server {} was affected by a change in the scanner", container2.getContainerSpecId(), container2.getServerInstanceKey()); verify(specManagementService, never()).logInfo(any());
linkTitlePresenter.onSelect(); final ContainerSpecKey containerSpecKey = new ContainerSpecKey( container.getContainerSpecId(), container.getContainerName(), new ServerTemplateKey( container.getServerInstanceKey().getServerTemplateId(), "" ) );