Class RawStatusProvider

  • All Implemented Interfaces:
    HttpStatusProvider

    public class RawStatusProvider
    extends java.lang.Object
    implements HttpStatusProvider
    Static implementation of HttpStatusProvider that allows a numeric status code.

    In the adapter configuration file this class is aliased as http-raw-status which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • RawStatusProvider

        public RawStatusProvider()
      • RawStatusProvider

        public RawStatusProvider​(int status)
    • Method Detail

      • getCode

        public int getCode()
      • setCode

        public void setCode​(int status)
        Set the HTTP Status to use.
        Parameters:
        status - the status, which defaults to 500
      • getText

        public java.lang.String getText()
      • setText

        public void setText​(java.lang.String txt)
        Set the optional response text that will be sent with the response code.

        Note that for StandardResponseProducer any values configured here will be ignored as that will use HttpServletResponse.setStatus(int) method only. This field is included only for completeness, a sensible default will be made available based on the HttpStatusProvider.HttpStatus selected.

        Parameters:
        txt - the text to be sent (e.g. OK, if the status code is 200).