ServletContext servletContext = ServletActionContext
.getServletContext();
HBaseConnectionPool pool = (HBaseConnectionPool) servletContext
.getAttribute(CruxConstants.HBASE_POOL);
Connection connectionToTest = new Connection();
ConnectionProperty property = new ConnectionProperty();
property.setProperty(CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
property.setValue(hbaseRestServerPropertyValue);
connectionToTest.addProperty(property);
try {
HBaseFacade hbaseFacade = getHBaseFacade();
boolean isValidConnection = hbaseFacade
.isValidConnection(connectionToTest);
logger.debug("isValidConnection : " + isValidConnection);
if (isValidConnection) {
connection = connectionDAO.findById(connection.getId());
Connection connectionToUpdate = connection;
connection.setName(connectionName);
hbaseRestServerProperty = connection.getProperties().get(
CruxConstants.HBASE_ZOOKEEPER_PROPERTY);
hbaseRestServerProperty.setValue(hbaseRestServerPropertyValue);