net.sf.ooweb.objectmapping
Interface Registry


public interface Registry

Registry is the URL -> object mapper. It manages controllers (any dynamic object you like so long as it has the correct annotation). It watches and tracks special objects such as login form providers, authenticators and error handlers.

Since:
0.7
Author:
Darren Davison

Method Summary
 Authenticator getAuthenticator()
           
 long getCacheTimeout(ObjectAndMethod oam)
          returns the timeout limit for any cached content generated by this particular object and method.
 java.lang.Object getController(ObjectAndMethod oam)
           
 ErrorHandler getErrorHandler()
           
 LoginForm getLoginForm()
           
 java.lang.reflect.Method getMethod(ObjectAndMethod oam)
           
 java.lang.String[] getRolesFor(ObjectAndMethod oam)
          Return the roles which a User must have to access the method specified in the oam.
 boolean hasAuthenticator()
           
 boolean hasController(ObjectAndMethod oam)
          Checks to see if a controller exists that can handle the path supplied.
 boolean hasErrorHandler()
           
 boolean hasLoginForm()
           
 boolean hasMethod(ObjectAndMethod oam)
           
 boolean isCacheable(ObjectAndMethod oam)
          lets a client know whether the method was explicitly (or implicitly at class level) marked as being safe to cache.
 

Method Detail

hasAuthenticator

boolean hasAuthenticator()
Returns:
true if we hold a valid Authenticator, false otherwise

hasLoginForm

boolean hasLoginForm()
Returns:
true if we hold a valid LoginForm, false otherwise

hasErrorHandler

boolean hasErrorHandler()
Returns:
true if a custom ErrorHandler has been registered, false otherwise

hasController

boolean hasController(ObjectAndMethod oam)
Checks to see if a controller exists that can handle the path supplied.

Parameters:
oam -
Returns:
true if a controller exists that may be able to handle this mapping, false otherwise.

hasMethod

boolean hasMethod(ObjectAndMethod oam)
Parameters:
oam - the ObjectAndMethod that will be checked
Returns:
true if the method is in the registry, false otherwise

getAuthenticator

Authenticator getAuthenticator()
Returns:
the Authenticator (if any) associated with this Registry

getLoginForm

LoginForm getLoginForm()
Returns:
the LoginForm (if any) associated with this Registry

getErrorHandler

ErrorHandler getErrorHandler()
Returns:
the ErrorHandler (if any) associated with this Registry

getController

java.lang.Object getController(ObjectAndMethod oam)
Parameters:
oam - the path to check against
Returns:
the controller mapped against the path supplied

getMethod

java.lang.reflect.Method getMethod(ObjectAndMethod oam)
Parameters:
oam - the path to check against
Returns:
Method that matches the name. Searches for a Method that accepts a RequestState fist, then one with no args, then returns null

getRolesFor

java.lang.String[] getRolesFor(ObjectAndMethod oam)
Return the roles which a User must have to access the method specified in the oam. Null if there's no such object/method or if the method is not secured

Parameters:
oam -
Returns:
an array of roles or null

isCacheable

boolean isCacheable(ObjectAndMethod oam)
lets a client know whether the method was explicitly (or implicitly at class level) marked as being safe to cache.

Parameters:
oam -
Returns:
true if the method/object is cacheable, false otherwise

getCacheTimeout

long getCacheTimeout(ObjectAndMethod oam)
returns the timeout limit for any cached content generated by this particular object and method.

Parameters:
oam -
Returns:
the cache timeout (0 for unlimited) or -1 for "not cacheable"


Copyright (C) 2005-2007 OOWeb Authors.