Overview
An Operation is a method or component of a service. It can be thought of as a remote procedure call in a sense. In GeoServer, operations form the basis of the Request-Response subsystem depicted below.

The following sequence diagram depicts a more precise description of the interaction between the components of the request response system.

The major players of the request-resoonse system include:
| Dispatcher | Handles all incoming requests, and routes the request to the correct operation. |
| AbstractService | The operation itself. Its role is to create a RequestReader which will be used to read information from the incoming request and configure the operation. |
| RequestReader | Reads a request. Requests can be executed via http "GET" or "POST". This interface abstracts away the specifics of either from the operation by creating a single Request object. |
| Request | A normal java bean containg information about the incoming request. |
| Response | Executes the operation being requested. A response is paramterized by the Request bean. |
WFS GetCapabilities Example
As an example, consider a Web Feature Service Get Capabilities operation:

Extension
Extending the request response system boils down to providing an instance of org.vfny.geoserver.servlets.AbstractService . The following is a snippet of class:
public abstract class AbstractService extends HttpServlet { ... /** * @return Returns the "service group" that this service falls into. */ public String getService() { return service; } /** * @return Returns the "request" this service maps to. */ public String getRequest() { return request; } ... }
The above shows that an operation has a "service" property, and a "request" property. The service property is the identifer of service the operation belongs to. Examples include "WFS","WMS", "WCS", etc.. The "request" property identifies the operation itself. Examples include "GetCapabilities,GetMap,GetFeature,etc...
The two together form a unique identifier for the operation. This identifier is used by the dispatcher to route requests to the operation. For instance from the url: "http://localhost:8080/geoserver/wfs?request=GetCapabilities", the dispatcher can infer that the service being requested is "wfs", and the request being performed is "GetCapabilities". The dispatch system is capable of parsing urls of the following forms:
| HTTP Method | Request Form | Example |
|---|---|---|
| GET | <protocol>://<host>:[GEOSDEV:port]/geoserver/<service>?request=<request> | http://localhost/geoserver/wfs?request=GetCapabilties |
| GET | <protocol>://<host>:[GEOSDEV:port]/geoserver/<service>/<request> | http://localhost/geoserver/wfs/GetCapabilties |
| GET | <protocol>://<host>:[GEOSDEV:port]/geoserver/ows?service<service>&request=<request> | http://localhost/geoserver/ows?service=wfs&request=GetCapabilities |
| POST | <protocol>://<host>:[GEOSDEV:port]/geoserver/service | http://localhost:8080/geoserver/wfs |
Note: In the POST example above, the request is specified in the body of the request (usually as XML). Example:
<GetCapabilities service="WFS" .../>
Operations are declared in a spring context as follows:
<bean id="someOperation" class="org.xyz.SomeOperation">
<property name="service" value="someService"/>
<property name="request" value="someRequest"/>
</bean>
A complete example of creating a new operation is supplied here.