Class ClientRoute

  • All Implemented Interfaces:
    org.restlet.Uniform

    public class ClientRoute
    extends org.restlet.routing.Route
    Router scorer based on a target client connector. 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
    • Field Summary

      • Fields inherited from class org.restlet.routing.Filter

        CONTINUE, SKIP, STOP
    • Constructor Summary

      Constructors 
      Constructor Description
      ClientRoute​(org.restlet.routing.Router router, org.restlet.Client target)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.restlet.Client getClient()
      Returns the target client.
      float score​(org.restlet.Request request, org.restlet.Response response)
      Returns the score for a given call (between 0 and 1.0).
      void setNext​(org.restlet.Client next)
      Sets the next client.
      • Methods inherited from class org.restlet.routing.Route

        getRouter, setRouter
      • Methods inherited from class org.restlet.routing.Filter

        afterHandle, beforeHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
      • Methods inherited from class org.restlet.Restlet

        createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClientRoute

        public ClientRoute​(org.restlet.routing.Router router,
                           org.restlet.Client target)
        Constructor.
        Parameters:
        router - The parent router.
        target - The target client.
    • Method Detail

      • getClient

        public org.restlet.Client getClient()
        Returns the target client.
        Returns:
        The target client.
      • score

        public float score​(org.restlet.Request request,
                           org.restlet.Response response)
        Returns the score for a given call (between 0 and 1.0).
        Specified by:
        score in class org.restlet.routing.Route
        Parameters:
        request - The request to score.
        response - The response to score.
        Returns:
        The score for a given call (between 0 and 1.0).
      • setNext

        public void setNext​(org.restlet.Client next)
        Sets the next client.
        Parameters:
        next - The next client.