Package org.silverpeas.core.web.rs
Class RESTWebService.WebProcess<R>
- java.lang.Object
-
- org.silverpeas.core.web.rs.RESTWebService.WebProcess<R>
-
- Type Parameters:
R
- the type of the value returned by the web treatment.
- Enclosing class:
- RESTWebService
protected final class RESTWebService.WebProcess<R> extends Object
This class handles the execution of aRESTWebService.WebTreatment
. It provides the centralization of exception catches and handles the lowest role access that must the user verify.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
execute()
This method calls the execute method of a.WebTreatment
instance.RESTWebService.WebProcess<R>
lowestAccessRole(SilverpeasRole lowestRoleAccess)
Sets the lowest role access that the user behind the service call must verify.
-
-
-
Method Detail
-
lowestAccessRole
public RESTWebService.WebProcess<R> lowestAccessRole(SilverpeasRole lowestRoleAccess)
Sets the lowest role access that the user behind the service call must verify.- Parameters:
lowestRoleAccess
- the lowest role allowed to process a given web treatment.- Returns:
- itself.
-
execute
public R execute()
This method calls the execute method of a.WebTreatment
instance. One of the aim of this mechanism is to centralize the exception catching and also to avoid redundant coding around web exceptions. If the lowest role access is defined, the user must verify it. If the user isn't authenticated, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.- Returns:
- the value computed by the specified web treatment.
-
-