Package org.restlet.routing
Class Route
- java.lang.Object
-
- org.restlet.Restlet
-
- org.restlet.routing.Filter
-
- org.restlet.routing.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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Router
getRouter()
Returns the parent router.abstract float
score(Request request, Response response)
Returns the score for a given call (between 0 and 1.0).void
setRouter(Router router)
Sets the parent router.-
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
-
-
-
-
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.
-
-