com.google.sitebricks.routing
Class ServiceAction

java.lang.Object
  extended by com.google.sitebricks.routing.ServiceAction
All Implemented Interfaces:
Action

public abstract class ServiceAction
extends Object
implements Action

A simple action that takes a request and returns a Reply which a subclass needs to provide.

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

Constructor Summary
ServiceAction()
           
 
Method Summary
protected abstract  Reply<?> call(Request request, Map<String,String> pathFragments)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceAction

public ServiceAction()
Method Detail

shouldCall

public boolean shouldCall(Request request)
Description copied from interface: Action
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.).

Specified by:
shouldCall in interface Action

call

public final Object call(Request request,
                         Object page,
                         Map<String,String> map)
Description copied from interface: Action
Invoke this action!

Specified by:
call in interface Action
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.

call

protected abstract Reply<?> call(Request request,
                                 Map<String,String> pathFragments)


Copyright © 2014. All rights reserved.