actionResponse.setRenderParameter("server_id", server_id);
try {
userTransaction.begin();
try {
Node node = entityManager.find(Node.class, server_id);
node.setName(actionRequest.getParameter("name"));
node.setHost(actionRequest.getParameter("ip"));
node.setUserName(actionRequest.getParameter("username"));
String password = actionRequest.getParameter("password");
if (password != null && !password.equals("")) {
password = EncryptionManager.encrypt(password);
node.setPassword(password);
}
node.setPort(Integer.parseInt(actionRequest.getParameter("port")));
node.setProtocol(actionRequest.getParameter("protocol"));
//TODO retention??
String snapshot = actionRequest.getParameter("snapshot");
String retention = actionRequest.getParameter("retention");
if (snapshot != null && retention != null) {
MRCConnector connector = new MRCConnector(node);