public WSResult<BiopolisModel> describeModel() throws SQLException, BiopolisInactiveException { try (ResultSet rs = this.pl.getConnNeo4j().executeQuery("MATCH (a:DESIGN_NODE) RETURN a.desci", null)) { if (rs.next()) { String jsonbytes = rs.getString(1); rs.close(); String json = new String(Base64.decodeBase64(jsonbytes)); BiopolisModel model = (new Gson()).fromJson(json, BiopolisModel.class); WSResult<BiopolisModel> result = new WSResult<BiopolisModel>(model); return result; } else { throw new BiopolisInactiveException(); } } }
public boolean isInitialized() throws SQLException { String queryString = "MATCH (n:DESIGN_NODE) return ID(n)"; try (ResultSet resultSet = this.pl.getConnNeo4j().createStatement().executeQuery(queryString)) { return resultSet.next(); } }