Class Route

  • All Implemented Interfaces:
    Uniform
    Direct Known Subclasses:
    TemplateRoute

    public abstract class Route
    extends Filter
    Filter scoring the affinity of calls with the attached Restlet. The score is used by an associated Router in order to determine the most appropriate Restlet for a given call.

    Concurrency note: instances of this class or its subclasses can be invoked by several threads at the same time and therefore must be thread-safe. You should be especially careful when storing state in member variables.
    Author:
    Jerome Louvel
    See Also:
    Template
    • Constructor Detail

      • Route

        public Route​(Restlet next)
        Constructor behaving as a simple extractor filter.
        Parameters:
        next - The next Restlet.
      • Route

        public Route​(Router router,
                     Restlet next)
        Constructor.
        Parameters:
        router - The parent router.
        next - The next Restlet.
    • Method Detail

      • getRouter

        public Router getRouter()
        Returns the parent router.
        Returns:
        The parent router.
      • score

        public abstract float score​(Request request,
                                    Response response)
        Returns the score for a given call (between 0 and 1.0).
        Parameters:
        request - The request to score.
        response - The response to score.
        Returns:
        The score for a given call (between 0 and 1.0).
      • setRouter

        public void setRouter​(Router router)
        Sets the parent router.
        Parameters:
        router - The parent router.