All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generator.server.springboot.webflux.web.main.HeaderUtil.mustache Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package {{packageName}}.shared.error.infrastructure.primary;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;

/**
 * Utility class for HTTP headers creation.
 */
public final class HeaderUtil {

  private static final Logger log = LoggerFactory.getLogger(HeaderUtil.class);

  private HeaderUtil() {}

   /**
   * 

createFailureAlert.

* * @param applicationName a {@link String} object. * @param entityName a {@link String} object. * @param errorKey a {@link String} object. * @return a {@link HttpHeaders} object. */ public static HttpHeaders createFailureAlert( String applicationName, String entityName, String errorKey ) { String message = "error." + errorKey; log.error("Entity processing failed, {}", message); HttpHeaders headers = new HttpHeaders(); headers.add("X-" + applicationName + "-error", message); headers.add("X-" + applicationName + "-params", entityName); return headers; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy