overview.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. .. _rest_services_overview:
  2. Overview
  3. ========
  4. GeoServer uses a library known as `Restlet <http://www.restlet.org/>`_ for all
  5. REST related functionality. Restlet is a lightweight rest framework written
  6. in Java that integrates nicely with existing servlet based applications.
  7. REST dispatching
  8. ----------------
  9. In GeoServer, all requests under the path ``/rest`` are considered a call to
  10. a restful service. Every call of this nature is handled by a *rest
  11. dispatcher*. The job of the dispatcher is to route the request to the
  12. appropriate end point. This end point is known as a *restlet*.
  13. .. image:: rest-dispatch.png
  14. Restlets are loaded from the spring context, and therefore are pluggable.
  15. Restlets
  16. --------
  17. A *restlet* is the generic entity which handles calls routed by the
  18. dispatcher, and corresponds to the class ``org.restlet.Restlet``. One
  19. can extend this class directly to implement a service endpoint. Alternatively
  20. one can extend a subclass for a specialized purpose. Namely a *finder*, which
  21. is described in the next section.
  22. Finders and resources
  23. ---------------------
  24. Restful services are often implemented around the concept of *resources*. A
  25. *finder* is a special kind of restlet whose job is to find the correct
  26. resource for a particular request. The resource then serves as the final
  27. end point and handles the request. The appropriate classes from the restlet
  28. library are ``org.restlet.Finder`` and ``org.restlet.resource.Resource``.
  29. Representations
  30. ---------------
  31. A *representation*, commonly referred to as a format, is the state of a
  32. particular state or encoding of a resource. For instance, when a request for
  33. a particular resource comes in, a representation of that resource is returned
  34. to the client.