|
Revision 2091, 1.0 kB
(checked in by agjendem, 1 year ago)
|
- Changed all the GET/SET/UPDATE/DELETE fields to an enum and applied that in that change in the necessary files.
- Removed some warnings about use of static fields that should be referenced in a static way ( e.g. HttpServletResponse.SC_FORBIDDEN)
|
| Line | |
|---|
| 1 |
package org.openmrs.module.restmodule.web; |
|---|
| 2 |
|
|---|
| 3 |
import java.io.IOException; |
|---|
| 4 |
|
|---|
| 5 |
import javax.servlet.ServletException; |
|---|
| 6 |
import javax.servlet.http.HttpServletRequest; |
|---|
| 7 |
import javax.servlet.http.HttpServletResponse; |
|---|
| 8 |
|
|---|
| 9 |
/** |
|---|
| 10 |
* Represents a RESTful resource (e.g., patient) that can be accessed through |
|---|
| 11 |
* RESTful calls |
|---|
| 12 |
* |
|---|
| 13 |
* @author Burke Mamlin |
|---|
| 14 |
* @version 1.0 |
|---|
| 15 |
*/ |
|---|
| 16 |
public interface RestResource { |
|---|
| 17 |
|
|---|
| 18 |
// Rest Operations |
|---|
| 19 |
public enum Operation {GET, POST, PUT, DELETE}; |
|---|
| 20 |
|
|---|
| 21 |
/** |
|---|
| 22 |
* Used to pass request to the given resource |
|---|
| 23 |
* |
|---|
| 24 |
* @param operation |
|---|
| 25 |
* REST operation (e.g., GET, POST, PUT, DELETE) |
|---|
| 26 |
* @param restRequest |
|---|
| 27 |
* fragment of request URL beyond resource reference |
|---|
| 28 |
* @param request |
|---|
| 29 |
* HTTP request |
|---|
| 30 |
* @param response |
|---|
| 31 |
* HTTP response |
|---|
| 32 |
* @throws ServletException |
|---|
| 33 |
* @throws IOException |
|---|
| 34 |
*/ |
|---|
| 35 |
public void handleRequest(Operation operation, String restRequest, |
|---|
| 36 |
HttpServletRequest request, HttpServletResponse response) |
|---|
| 37 |
throws ServletException, IOException; |
|---|
| 38 |
|
|---|
| 39 |
} |
|---|