Class ExactMatch

  • All Implemented Interfaces:
    StatusEvaluator

    public class ExactMatch
    extends StatusEvaluatorImpl
    Implementation of StatusEvaluator for use with BranchingHttpRequestService.

    Matches a service id against an exact http response code. e.g. statusCode=200 to match HTTP OK. It's an exact match; you probably don't want to use it, as you'll have to specify one for 202 Accepted, one for 201 Created etc. even though they're all would logically point to the same success ervice id.

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

    • Constructor Detail

      • ExactMatch

        public ExactMatch()
      • ExactMatch

        public ExactMatch​(int code,
                          java.lang.String serviceId)
    • Method Detail

      • matches

        public boolean matches​(int responseCode)
        Description copied from interface: StatusEvaluator
        Do we match the http status
        Parameters:
        responseCode - the HTTP server response code (e.g. 500)
        Returns:
        true/false.
      • getStatusCode

        public int getStatusCode()
        Returns:
        the responseCode
      • setStatusCode

        public void setStatusCode​(int s)
        Parameters:
        s - the responseCode to set