public class FrequencyRestrictedContext extends AbstractControlledContext
| Modifier and Type | Class and Description |
|---|---|
static class |
FrequencyRestrictedContext.Keys |
GenericContext.ForwardResultServletModule.RequestListener| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
keyPrefix |
private static java.lang.String |
postfixCurrentTime |
private static java.lang.String |
postfixCurrentValue |
private java.lang.String |
requiredRole |
authenticatorauthenticationErrorMessage, checkActions, contextPath, exceptionHandler, exceptionOnAuthentication, requestListeners, servlet, urlPrefixautoStart, isInitialized, isRunning, logging, loggingModule, moduleManager| Constructor and Description |
|---|
FrequencyRestrictedContext() |
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
_access(User user,
long time,
boolean update,
java.lang.String prefix) |
static boolean |
access(User user,
long time,
java.lang.String prefix) |
static boolean |
access(User user,
java.lang.String prefix) |
protected GenericContext.ForwardResult |
doForwardRequest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
ModulesServlet.HttpMethod method)
Checks if a request should be forwarded to the registered listeners.
|
private static long[] |
getCurrent(User user,
FrequencyRestrictedContext.Keys key,
long time,
java.lang.String prefix) |
void |
init(ModuleManager manager,
java.util.HashMap<java.lang.String,java.lang.Object> settings)
Initialises the module.
|
static boolean |
isAccessAllowed(User user,
long time,
java.lang.String prefix) |
static boolean |
isAccessAllowed(User user,
java.lang.String prefix) |
authenticate, getDependencies, start, stopaddRequestListener, getContextPath, getHandlingAction, getServletURL, handleRequest, isHandleAction, removeRequestListenerisInitialized, isRunning, requireLogging, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisInitialized, isRunningprivate java.lang.String keyPrefix
private static java.lang.String postfixCurrentTime
private static java.lang.String postfixCurrentValue
private java.lang.String requiredRole
public void init(ModuleManager manager, java.util.HashMap<java.lang.String,java.lang.Object> settings) throws ModuleException
ModuleInitialises the module. After constructor, this is the first method called in the life cycle of a module. It should not perform anything time consuming or anything with notable outside side effects. It should only read the parameters and initialise the module so that it can later be started. Note that a module being initialised doesn't mean that it necessarily will ever be started.
A ModuleException may be thrown if something vital is missing from the parameters or they are not sensible. In some cases you may not want to throw an exception even if vital initialisation information is missing. If, for example, it is possible that the module is initialised in some other way between the init and the start method calls. A ModuleException may also be thrown at the start method if the module is still not initialised.
init in interface Moduleinit in class GenericContextmanager - The module manager handling this module. You may keep a
reference to it if needed.ModuleExceptionprotected GenericContext.ForwardResult doForwardRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, ModulesServlet.HttpMethod method) throws javax.servlet.ServletException, java.io.IOException, ActionException
GenericContextChecks if a request should be forwarded to the registered listeners. The return value is in the form of a ForwardResult object. This combines multiple things about how the request can be handled. See its documentation for more detail.
The default implementation simply returns new ForwardResult(true, false, null), thus forwarding all requests without any additional handling.
doForwardRequest in class GenericContextreq - The HTTP request.resp - The HTTP response.method - The HTTP method.javax.servlet.ServletExceptionjava.io.IOExceptionActionExceptionprivate static long[] getCurrent(User user, FrequencyRestrictedContext.Keys key, long time, java.lang.String prefix)
private static boolean _access(User user, long time, boolean update, java.lang.String prefix) throws UserStoreException
UserStoreExceptionpublic static boolean isAccessAllowed(User user, java.lang.String prefix) throws UserStoreException
UserStoreExceptionpublic static boolean isAccessAllowed(User user, long time, java.lang.String prefix) throws UserStoreException
UserStoreExceptionpublic static boolean access(User user, java.lang.String prefix) throws UserStoreException
UserStoreExceptionpublic static boolean access(User user, long time, java.lang.String prefix) throws UserStoreException
UserStoreExceptionCopyright 2004-2015 Wandora Team