Beispiel #1
0
 @POST("/backend/config/alerts/add")
 String addAlert(String content) throws Exception {
   AlertConfigDto alertConfigDto = mapper.readValue(content, ImmutableAlertConfigDto.class);
   AlertConfig alertConfig = alertConfigDto.toConfig();
   try {
     configRepository.insertAlertConfig(alertConfig);
   } catch (DuplicateMBeanObjectNameException e) {
     // log exception at debug level
     logger.debug(e.getMessage(), e);
     throw new JsonServiceException(CONFLICT, "mbeanObjectName");
   }
   return mapper.writeValueAsString(AlertConfigDto.fromConfig(alertConfig));
 }