com.google.sitebricks.routing
Interface Action

All Known Implementing Classes:
ServiceAction, SpiAction

public interface Action

An abstract representation of the service code called when a request is processed. Typically maps to a method annotated with @Get or something like that. Can be replaced with a SPI to create dynamic behavior.

Author:
dhanji@gmail.com (Dhanji R. Prasanna)

Method Summary
 Object call(Request request, Object page, Map<String,String> map)
          Invoke this action!
 boolean shouldCall(Request request)
          Returns true if this action should be called on this request.
 

Method Detail

shouldCall

boolean shouldCall(Request request)
Returns true if this action should be called on this request. All dispatch rules have succeeded and this is a last-resort gate (for example, to handle special headers or gate IPs etc.).


call

Object call(Request request,
            Object page,
            Map<String,String> map)
Invoke this action!

Parameters:
page - The page object on which to call this action. Aka: the 'resource'.
map - A map of path variables (fragments) to their values.
Returns:
an instance of Reply, Redirect or null to trigger a 500 error.


Copyright © 2014. All rights reserved.