com.acsinet_solutions.cetia4.controller.rest
Class PingController

java.lang.Object
  extended by com.acsinet_solutions.cetia4.controller.rest.PingController
All Implemented Interfaces:
RestController

public class PingController
extends java.lang.Object
implements RestController

Simple controller that answers PING requests on web service stateless GET requests - not designed for traditional web requests.

Author:
Santiago Arriaga

Constructor Summary
PingController()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PingController

public PingController()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: RestController
Get the name of the current controller; for navigation purposes.

Specified by:
getName in interface RestController

getMethodName

public java.lang.String getMethodName()
Description copied from interface: RestController
Get the java method name, for the current controller. Used for indexing purposes.

Specified by:
getMethodName in interface RestController
See Also:
ResourceMethodHolder

getRequestTypes

public java.lang.String[] getRequestTypes()
Description copied from interface: RestController
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.

Specified by:
getRequestTypes in interface RestController

getRootModuleName

public java.lang.String getRootModuleName()
Description copied from interface: RestController
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.

Specified by:
getRootModuleName in interface RestController

getResourcePath

public java.lang.String getResourcePath()
Description copied from interface: RestController
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 .

Specified by:
getResourcePath in interface RestController

getPathInfoParamSize

public int getPathInfoParamSize()
Description copied from interface: RestController
Return the number of path-info params for this method.

Specified by:
getPathInfoParamSize in interface RestController

needsLogIn

public boolean needsLogIn()
Description copied from interface: RestController
Check if action to the current controller needs log in or not.

Specified by:
needsLogIn in interface RestController

checkAccess

public void checkAccess(RequestContext context)
                 throws AccessException
Description copied from interface: RestController
Check access to the current controller, and throw an exception if access to the given request is forbidden.

Specified by:
checkAccess in interface RestController
Throws:
AccessException

execute

public java.lang.String execute(RequestContext context)
                         throws ValidationException
Description copied from interface: RestController
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

Specified by:
execute in interface RestController
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

getNavigationStage

public NavigationStage getNavigationStage(RenderContext context,
                                          Link link)
Description copied from interface: RestController
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

Specified by:
getNavigationStage in interface RestController