com.acsinet_solutions.cetia4.controller.rest
Interface RestController

All Known Implementing Classes:
PingController

public interface RestController

Base classes for REST-based controllers. Controllers are helpers to which a front-REST-servlet dispatches requests. Controller logic may be implemented as methods in the REST-servlet for simple cases, or as nested objects for REST-hierarchies.

Derechos Reservados

Author:
Santiago Arriaga

Method Summary
 void checkAccess(RequestContext context)
          Check access to the current controller, and throw an exception if access to the given request is forbidden.
 java.lang.String execute(RequestContext context)
          Execute the logic previous to a view display or to an action, using the given context as input.
 java.lang.String getMethodName()
          Get the java method name, for the current controller.
 java.lang.String getName()
          Get the name of the current controller; for navigation purposes.
 NavigationStage getNavigationStage(RenderContext context, Link link)
          Get the navigation stage according to the current controller and context value.
 int getPathInfoParamSize()
          Return the number of path-info params for this method.
 java.lang.String[] getRequestTypes()
          Get the types of requests that the current controller may answer; this will return a non-empty array if the controller is restricted to some request types; null if it is unrestricted.
 java.lang.String getResourcePath()
          Get the path to resources related to the current controller.
 java.lang.String getRootModuleName()
          Get the base root module name upon which this controller is based.
 boolean needsLogIn()
          Check if action to the current controller needs log in or not.
 

Method Detail

getName

java.lang.String getName()
Get the name of the current controller; for navigation purposes.


getMethodName

java.lang.String getMethodName()
Get the java method name, for the current controller. Used for indexing purposes.

See Also:
ResourceMethodHolder

getRequestTypes

java.lang.String[] getRequestTypes()
Get the types of requests that the current controller may answer; this will return a non-empty array if the controller is restricted to some request types; null if it is unrestricted.


getRootModuleName

java.lang.String getRootModuleName()
Get the base root module name upon which this controller is based. This is used to know the name of the servlet to which a controller belongs, and also for default navigation purposes.


getResourcePath

java.lang.String getResourcePath()
Get the path to resources related to the current controller. This path allows to create paths to JSP pages and other resources needed by the views of this controller. Paths start with / and separations between nested controllers are alaso marked with /, for example: /agenda/weeks/days .


getPathInfoParamSize

int getPathInfoParamSize()
Return the number of path-info params for this method.


needsLogIn

boolean needsLogIn()
Check if action to the current controller needs log in or not.


checkAccess

void checkAccess(RequestContext context)
                 throws AccessException
Check access to the current controller, and throw an exception if access to the given request is forbidden.

Throws:
AccessException

execute

java.lang.String execute(RequestContext context)
                         throws ValidationException,
                                SystemException
Execute the logic previous to a view display or to an action, using the given context as input.

Nested non-leaf controllers may throw an exception if this method is called upon them, because themselves they don't process requests

Returns:
The view to which proceed; may be an absolute value, a relative view-independent value, or null if explicit view rendering was performed within the method.
Throws:
ValidationException
SystemException

getNavigationStage

NavigationStage getNavigationStage(RenderContext context,
                                   Link link)
Get the navigation stage according to the current controller and context value. This class is used as a factory of navigation stages because it contains the meta-information of attributes, and also knows the unique name of the current controller.

Nested non-leaf controllers may throw an exception if this method is called upon them, because themselves they don't process requests