コード例 #1
0
  @RequestMapping(
      value = "/updateBrokerConfig.do",
      method = {RequestMethod.GET, RequestMethod.POST})
  public String updateBrokerConfig(
      ModelMap map,
      HttpServletRequest request,
      @RequestParam(required = false) String brokerAddr,
      @RequestParam(required = false) String clusterName,
      @RequestParam(required = false) String key,
      @RequestParam(required = false) String value) {
    Collection<Option> options = brokerService.getOptionsForUpdateBrokerConfig();
    putPublicAttribute(map, "updateBrokerConfig", options, request);
    try {
      if (request.getMethod().equals(GET)) {

      } else if (request.getMethod().equals(POST)) {
        checkOptions(options);
        brokerService.updateBrokerConfig(brokerAddr, clusterName, key, value);
        putAlertTrue(map);
      } else {
        throwUnknowRequestMethodException(request);
      }
    } catch (Throwable t) {
      putAlertMsg(t, map);
    }
    return TEMPLATE;
  }
コード例 #2
0
  @RequestMapping(
      value = "/brokerStats.do",
      method = {RequestMethod.GET, RequestMethod.POST})
  public String brokerStats(
      ModelMap map, HttpServletRequest request, @RequestParam(required = false) String brokerAddr) {
    Collection<Option> options = brokerService.getOptionsForBrokerStats();
    putPublicAttribute(map, "brokerStats", options, request);
    try {
      if (request.getMethod().equals(GET)) {

      } else if (request.getMethod().equals(POST)) {
        checkOptions(options);
        Table table = brokerService.brokerStats(brokerAddr);
        putTable(map, table);
      } else {
        throwUnknowRequestMethodException(request);
      }
    } catch (Throwable t) {
      putAlertMsg(t, map);
    }
    return TEMPLATE;
  }