@Test public void registerMemberAndChangeSecurityServerOwner() throws Exception { assertEquals(OWNER_MEMBER.toString(), serverConfService.getSecurityServerOwnerId().toString()); ClientType clientType = clientService.addLocalClient(NEW_OWNER_MEMBER.getMemberClass(), NEW_OWNER_MEMBER.getMemberCode(), NEW_OWNER_MEMBER.getSubsystemCode(), IsAuthentication.SSLAUTH, false); assertEquals(ClientType.STATUS_SAVED, clientType.getClientStatus()); clientService.registerClient(NEW_OWNER_MEMBER); assertEquals(ClientType.STATUS_REGINPROG, clientType.getClientStatus()); when(globalConfFacade.isSecurityServerClient(any(), any())).thenReturn(true); globalConfChecker.updateServerConf(); assertEquals(ClientType.STATUS_REGISTERED, clientType.getClientStatus()); assertEquals(OWNER_MEMBER.toString(), serverConfService.getSecurityServerOwnerId().toString()); when(globalConfFacade.getServerOwner(SS_ID)).thenReturn(null); when(globalConfFacade.getServerOwner(NEW_SS_ID)).thenReturn(NEW_OWNER_MEMBER); when(globalConfFacade.getServerId(any())).thenReturn(NEW_SS_ID); globalConfChecker.updateServerConf(); assertEquals(NEW_OWNER_MEMBER.toString(), serverConfService.getSecurityServerOwnerId().toString()); }
@Scheduled(fixedRate = JOB_REPEAT_INTERVAL_MS, initialDelay = INITIAL_DELAY_MS) @Transactional public void updateServerConf() { if (SLAVE.equals(SystemProperties.getServerNodeType())) { log.debug("This is a slave node - skip globalconf updates"); return; } if (restoreInProgress) { log.debug("Backup restore in progress - skipping globalconf update"); return; } try { log.debug("Check globalconf for updates"); checkGlobalConf(); } catch (Exception e) { log.error("Checking globalconf for updates failed", e); throw e; } }
GlobalConfChecker { @Scheduled(fixedRate = JOB_REPEAT_INTERVAL_MS, initialDelay = INITIAL_DELAY_MS) @Transactional public void updateServerConf() { if (SLAVE.equals(SystemProperties.getServerNodeType())) { log.debug("This is a slave node - skip globalconf updates"); return; } if (restoreInProgress) { log.debug("Backup restore in progress - skipping globalconf update"); return; } try { log.debug("Check globalconf for updates"); checkGlobalConf(); } catch (Exception e) { log.error("Checking globalconf for updates failed", e); throw e; } } }
GlobalConfChecker { @Scheduled(fixedRate = JOB_REPEAT_INTERVAL_MS, initialDelay = INITIAL_DELAY_MS) @Transactional public void updateServerConf() { if (SLAVE.equals(SystemProperties.getServerNodeType())) { log.debug("This is a slave node - skip globalconf updates"); return; } if (restoreInProgress) { log.debug("Backup restore in progress - skipping globalconf update"); return; } try { log.debug("Check globalconf for updates"); checkGlobalConf(); } catch (Exception e) { log.error("Checking globalconf for updates failed", e); throw e; } } @Autowired  GlobalConfChecker(GlobalConfCheckerHelper globalConfCheckerHelper, GlobalConfFacade globalConfFacade,
            SignerProxyFacade signerProxyFacade); }
GlobalConfChecker { @Scheduled(fixedRate = JOB_REPEAT_INTERVAL_MS, initialDelay = INITIAL_DELAY_MS) @Transactional public void updateServerConf() { if (SLAVE.equals(SystemProperties.getServerNodeType())) { log.debug("This is a slave node - skip globalconf updates"); return; } if (restoreInProgress) { log.debug("Backup restore in progress - skipping globalconf update"); return; } try { log.debug("Check globalconf for updates"); checkGlobalConf(); } catch (Exception e) { log.error("Checking globalconf for updates failed", e); throw e; } } @Autowired  GlobalConfChecker(GlobalConfCheckerHelper globalConfCheckerHelper, GlobalConfFacade globalConfFacade,
            SignerProxyFacade signerProxyFacade); @Scheduled(fixedRate = JOB_REPEAT_INTERVAL_MS, initialDelay = INITIAL_DELAY_MS) @Transactional void updateServerConf(); }
GlobalConfChecker { @Scheduled(fixedRate = JOB_REPEAT_INTERVAL_MS, initialDelay = INITIAL_DELAY_MS) @Transactional public void updateServerConf() { if (SLAVE.equals(SystemProperties.getServerNodeType())) { log.debug("This is a slave node - skip globalconf updates"); return; } if (restoreInProgress) { log.debug("Backup restore in progress - skipping globalconf update"); return; } try { log.debug("Check globalconf for updates"); checkGlobalConf(); } catch (Exception e) { log.error("Checking globalconf for updates failed", e); throw e; } } @Autowired  GlobalConfChecker(GlobalConfCheckerHelper globalConfCheckerHelper, GlobalConfFacade globalConfFacade,
            SignerProxyFacade signerProxyFacade); @Scheduled(fixedRate = JOB_REPEAT_INTERVAL_MS, initialDelay = INITIAL_DELAY_MS) @Transactional void updateServerConf(); static final int JOB_REPEAT_INTERVAL_MS; static final int INITIAL_DELAY_MS; }