@OnEvent(component = "UpdateClusterParamsForm", value = "submit") @Secured("ROLE_ADMIN") Object onUpdateClusterParamsForm() { String info = "Update: Ok<br/>"; info += dataSource.updateParams(cluster); Cache.refreshClusterParams(); if (!cluster.isLocal()) { try { Connection conn = PublicKeyAuthentication.connect( cluster.getUsername(), cluster.getHostname(), cluster.getPrivateKeyPath(), cluster.getPassphrase()); if (conn != null) { conn.close(); } } catch (Exception e) { info = e.getMessage(); e.printStackTrace(); } } infoPage.setUp(info, "Updating cluster params:"); return infoPage; }
public void onActivate() { cluster = Cache.getClusterParams(); }