class DbHostAuth extends AbstractDbDataDao<Host> {

  public static String getJson(final DbPreparedStatement preparedStatement,
                               final int limit)
      throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException {
    final ArrayNode arrayNode = JsonHandler.createArrayNode();
    try {
      preparedStatement.executeQuery();
      int nb = 0;
      while (preparedStatement.getNext()) {
        final DbHostAuth host = getFromStatement(preparedStatement);
        final ObjectNode node = host.getInternalJson();
        arrayNode.add(node);
        nb++;
        if (nb >= limit) {
          break;
        }
      }
    } finally {
      preparedStatement.realClose();
    }
    return JsonHandler.writeAsString(arrayNode);
  }

  public  DbHostAuth(final String hostid, final String address, final int port,
                    final boolean isSSL, final byte[] hostkey,
                    final boolean adminrole, final boolean isClient);
  private  DbHostAuth(final Host host);
  public  DbHostAuth(final ObjectNode source);
  public  DbHostAuth(final String hostid);
  private  DbHostAuth();

}