Class RuleRouter<T>

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<java.lang.String> getMethodsForValidRules​(com.spotify.apollo.Request message)
      Returns a collection of valid methods (such as GET and POST) for the URI of the provided request.
      java.util.List<T> getRuleTargets()
      Return a list of all target objects that this router handles.
      java.util.Optional<RuleMatch<T>> match​(com.spotify.apollo.Request message)
      Match a request to a configured entity.
      static <T> RuleRouter<T> of​(java.lang.Iterable<Rule<T>> rules)
      Create a router from a list of rules.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • match

        public java.util.Optional<RuleMatch<T>> match​(com.spotify.apollo.Request message)
                                               throws InvalidUriException
        Description copied from interface: ApplicationRouter
        Match a request to a configured entity. Throws InvalidUriException if the URI of the request is badly formated. Returns absence if there is no match.
        Specified by:
        match in interface ApplicationRouter<T>
        Parameters:
        message - The message to find the entity for
        Throws:
        InvalidUriException
      • getMethodsForValidRules

        public java.util.Collection<java.lang.String> getMethodsForValidRules​(com.spotify.apollo.Request message)
        Description copied from interface: ApplicationRouter
        Returns a collection of valid methods (such as GET and POST) for the URI of the provided request. Will return an empty collection if nothing match the URI.
        Specified by:
        getMethodsForValidRules in interface ApplicationRouter<T>
        Parameters:
        message - The message to find the methods for
      • getRuleTargets

        public java.util.List<T> getRuleTargets()
        Description copied from interface: ApplicationRouter
        Return a list of all target objects that this router handles.
        Specified by:
        getRuleTargets in interface ApplicationRouter<T>
        Returns:
        A list of all targets
      • of

        public static <T> RuleRouter<T> of​(java.lang.Iterable<Rule<T>> rules)
        Create a router from a list of rules.