org.loom.mapping
Interface ActionMappingRepository

All Known Implementing Classes:
DefaultActionMappingRepository, GuiceActionMappingRepository, ReloadableActionMappingRepository

public interface ActionMappingRepository

Repository of all configured ActionMapping instances.


Method Summary
 void addActionMapping(ActionMapping mapping)
           
 ActionMapping getActionMappingByClass(java.lang.Class<? extends Action> actionClass)
           
 ActionMapping getActionMappingByName(java.lang.String actionClassName)
           
 Event getEvent(java.lang.String uri, LoomServletRequest request)
           
 java.lang.String getHandle(java.lang.String uri)
           
 java.util.Collection<java.lang.String> getMappings()
           
 ActionMapping removeActionMapping(java.lang.Class<? extends Action> actionClass)
          Remove the action mapping for one action class
 void validateActionMappings()
          Validate the registered ActionMappings to check that there are no two overlapping events that may produce the same URL
 

Method Detail

getMappings

java.util.Collection<java.lang.String> getMappings()

getHandle

java.lang.String getHandle(java.lang.String uri)

addActionMapping

void addActionMapping(ActionMapping mapping)

getActionMappingByClass

ActionMapping getActionMappingByClass(java.lang.Class<? extends Action> actionClass)
Parameters:
actionClass - the action class
Returns:
the required actionMapping
Throws:
java.lang.IllegalArgumentException - if there is no action registered with that class name

getActionMappingByName

ActionMapping getActionMappingByName(java.lang.String actionClassName)
Parameters:
actionClassName - the class name OR the unqualified class name (without the package path)
Returns:
the actionMapping
Throws:
java.lang.IllegalArgumentException - if there is no action registered with that class name

getEvent

Event getEvent(java.lang.String uri,
               LoomServletRequest request)
Parameters:
uri - the uri as returned by request.getServletPath()
request - the current request object
Returns:
the ActionMapping corresponding to this request, null if no Action was a match

removeActionMapping

ActionMapping removeActionMapping(java.lang.Class<? extends Action> actionClass)
Remove the action mapping for one action class

Parameters:
actionClass - the action class to be removed
Returns:
the removed ActionMapping instance, null if not found

validateActionMappings

void validateActionMappings()
Validate the registered ActionMappings to check that there are no two overlapping events that may produce the same URL