// requires synchronization between host platform and db. public List<Host> loadFromPlatform() { List<Host> hosts = adapter.getHosts(); List<Engine> engines = adapter.bindEngineAndHost(engineService.getAllEngines(), hosts); _pm.beginTransaction(); engines.stream().forEach(e -> _pm.exec(e, HibernateEngine.DB_UPDATE)); hosts.stream().forEach(h -> _pm.exec(h, HibernateEngine.DB_UPDATE)); _pm.commit(); return hosts; }
public void reloadHosts() { adapter.getHosts(); }