@Test public void assertPersistOnlineForDisabledServer() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); serverService.persistOnline(false); verify(jobNodeStorage).fillJobNode("servers/127.0.0.1", ServerStatus.DISABLED.name()); JobRegistry.getInstance().shutdown("test_job"); }
public void persistOnline(final boolean enabled) { if (!JobRegistry.getInstance().isShutdown(jobName)) { jobNodeStorage.fillJobNode(serverNode.getServerNode(JobRegistry.getInstance().getJobInstance(jobName).getIp()), enabled ? ServerStatus.ENABLED.name() : ServerStatus.DISABLED.name()); } }
ServerService { public void persistOnline(final boolean enabled) { if (!JobRegistry.getInstance().isShutdown(jobName)) { jobNodeStorage.fillJobNode(serverNode.getServerNode(JobRegistry.getInstance().getJobInstance(jobName).getIp()), enabled ? ServerStatus.ENABLED.name() : ServerStatus.DISABLED.name()); } } }
ServerService { public void persistOnline(final boolean enabled) { if (!JobRegistry.getInstance().isShutdown(jobName)) { jobNodeStorage.fillJobNode(serverNode.getServerNode(JobRegistry.getInstance().getJobInstance(jobName).getIp()), enabled ? ServerStatus.ENABLED.name() : ServerStatus.DISABLED.name()); } } ServerService(final CoordinatorRegistryCenter regCenter, final String jobName); }
ServerService { public void persistOnline(final boolean enabled) { if (!JobRegistry.getInstance().isShutdown(jobName)) { jobNodeStorage.fillJobNode(serverNode.getServerNode(JobRegistry.getInstance().getJobInstance(jobName).getIp()), enabled ? ServerStatus.ENABLED.name() : ServerStatus.DISABLED.name()); } } ServerService(final CoordinatorRegistryCenter regCenter, final String jobName); void persistOnline(final boolean enabled); boolean hasAvailableServers(); boolean isAvailableServer(final String ip); boolean isEnableServer(final String ip); }
ServerService { public void persistOnline(final boolean enabled) { if (!JobRegistry.getInstance().isShutdown(jobName)) { jobNodeStorage.fillJobNode(serverNode.getServerNode(JobRegistry.getInstance().getJobInstance(jobName).getIp()), enabled ? ServerStatus.ENABLED.name() : ServerStatus.DISABLED.name()); } } ServerService(final CoordinatorRegistryCenter regCenter, final String jobName); void persistOnline(final boolean enabled); boolean hasAvailableServers(); boolean isAvailableServer(final String ip); boolean isEnableServer(final String ip);  }