org.exoplatform.social.common.router
Class ExoRouter

java.lang.Object
  extended by org.exoplatform.social.common.router.ExoRouter
All Implemented Interfaces:
org.picocontainer.Startable

public class ExoRouter
extends Object
implements org.picocontainer.Startable


Nested Class Summary
static class ExoRouter.ActionBuilder
           
static class ExoRouter.Route
          Route class which contains path, action & argument list.
 
Field Summary
static List<ExoRouter.Route> routes
          All the loaded routes.
 
Constructor Summary
ExoRouter()
           
 
Method Summary
static void addRoute(String path, String action)
          Add new route which loaded from route configuration file.
static void addRoute(String path, String action, String params)
          Add new route which loaded from route configuration file.
 void addRoutes(ExoRouterConfig routeConfig)
           
static void appendRoute(String path, String action, String params)
           
static ExoRouter.Route getRoute(String path, String action)
           
static ExoRouter.Route getRoute(String path, String action, String params)
           
static ExoRouter.Route getRoute(String path, String action, String params, String sourceFile, int line)
           
static void prependRoute(String path, String action)
          Add a new route at the beginning of the route list
static void prependRoute(String path, String action, String params)
          Add a new route at the beginning of the route list
static void reset()
           
static ExoRouter.ActionBuilder reverse(String action, Map<String,Object> args)
          Generates ActionBuilder base on the action name and arguments list.
static ExoRouter.Route route(String path)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

routes

public static List<ExoRouter.Route> routes
All the loaded routes.

Constructor Detail

ExoRouter

public ExoRouter()
Method Detail

reset

public static void reset()

addRoutes

public void addRoutes(ExoRouterConfig routeConfig)

addRoute

public static void addRoute(String path,
                            String action)
Add new route which loaded from route configuration file.

Parameters:
path - /{pageID}/ForumService
action - the action which appends to patch after "ForumService" string.

addRoute

public static void addRoute(String path,
                            String action,
                            String params)
Add new route which loaded from route configuration file.

Parameters:
path - /{pageID}/ForumService
action - /{pageID}/ForumService
params - the action which appends to patch after "ForumService" string ex: /{pageID}/{ForumService|}/{action} =>/{pageID}/ForumService/{}

appendRoute

public static void appendRoute(String path,
                               String action,
                               String params)

getRoute

public static ExoRouter.Route getRoute(String path,
                                       String action,
                                       String params)

getRoute

public static ExoRouter.Route getRoute(String path,
                                       String action)

getRoute

public static ExoRouter.Route getRoute(String path,
                                       String action,
                                       String params,
                                       String sourceFile,
                                       int line)

prependRoute

public static void prependRoute(String path,
                                String action,
                                String params)
Add a new route at the beginning of the route list


prependRoute

public static void prependRoute(String path,
                                String action)
Add a new route at the beginning of the route list


route

public static ExoRouter.Route route(String path)

reverse

public static ExoRouter.ActionBuilder reverse(String action,
                                              Map<String,Object> args)
Generates ActionBuilder base on the action name and arguments list. Example: invokes reverse("show.topic", new HashMap{topicId, "topicId321"}) method.

Parameters:
action -
args -
Returns:

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.