Class AccessRulesService
- java.lang.Object
-
- fr.paris.lutece.plugins.myluteceaccessrules.service.AccessRulesService
-
public final class AccessRulesService extends Object
This class provides an Access Rules Service
-
-
Field Summary
Fields Modifier and Type Field Description static StringI18N_DEFAULT_MESSAGE_UNAUTHORIZEDSession attribute that stores the LuteceUser object attached to the session.static StringI18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZEDThe Constant I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED.static StringMARK_PORTAL_AUTHENTICATION_REQUIREDThe Constant MARK_PORTAL_AUTHENTICATION_REQUIRED.static StringMARK_PUBLIC_LIST_URLThe Constant MARK_PUBLIC_LIST_URL.static StringPARAMETER_NB_REDIRECTParameter NB REDIRECTstatic StringPROPERTY_MAX_REDIRECTParameter NB REDIRECTstatic StringPUBLIC_URL_PREFIXThe Constant PUBLIC_URL_PREFIX.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbuildRedirectUrl(Rule rule, javax.servlet.http.HttpServletRequest request, int nbRedirect)Builds the redirect url depending to the rule specificationRulegeFirstRuleTriggered(javax.servlet.http.HttpServletRequest request)Ge the first rule triggered.AccessRulesCacheServicegetCache()Gets the cache.static AccessRulesServicegetInstance()Get the unique instance of the AccessRulesServiceList<Rule>getRulesEnabled()Gets the list of enabled rulesbooleanisAccessRulesEnabled()Checks if is access rules enabled.booleanisRuleMatchingRequest(Rule rule, javax.servlet.http.HttpServletRequest request)Checks if this rule match the request.booleanmatchUrl(javax.servlet.http.HttpServletRequest request, String strUrlPatern)method to test if the URL matches the pattern.
-
-
-
Field Detail
-
PARAMETER_NB_REDIRECT
public static final String PARAMETER_NB_REDIRECT
Parameter NB REDIRECT- See Also:
- Constant Field Values
-
I18N_DEFAULT_MESSAGE_UNAUTHORIZED
public static final String I18N_DEFAULT_MESSAGE_UNAUTHORIZED
Session attribute that stores the LuteceUser object attached to the session.- See Also:
- Constant Field Values
-
I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED
public static final String I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED
The Constant I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED.- See Also:
- Constant Field Values
-
MARK_PUBLIC_LIST_URL
public static final String MARK_PUBLIC_LIST_URL
The Constant MARK_PUBLIC_LIST_URL.- See Also:
- Constant Field Values
-
PUBLIC_URL_PREFIX
public static final String PUBLIC_URL_PREFIX
The Constant PUBLIC_URL_PREFIX.- See Also:
- Constant Field Values
-
MARK_PORTAL_AUTHENTICATION_REQUIRED
public static final String MARK_PORTAL_AUTHENTICATION_REQUIRED
The Constant MARK_PORTAL_AUTHENTICATION_REQUIRED.- See Also:
- Constant Field Values
-
PROPERTY_MAX_REDIRECT
public static final String PROPERTY_MAX_REDIRECT
Parameter NB REDIRECT- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static AccessRulesService getInstance()
Get the unique instance of the AccessRulesService- Returns:
- The instance
-
isAccessRulesEnabled
public boolean isAccessRulesEnabled()
Checks if is access rules enabled.- Returns:
- true, if is access rules enabled
-
getCache
public AccessRulesCacheService getCache()
Gets the cache.- Returns:
- the cache
-
getRulesEnabled
public List<Rule> getRulesEnabled()
Gets the list of enabled rules- Returns:
- the list of enabled rules
-
geFirstRuleTriggered
public Rule geFirstRuleTriggered(javax.servlet.http.HttpServletRequest request)
Ge the first rule triggered.- Parameters:
request- the request- Returns:
- the first Rule triggered
-
isRuleMatchingRequest
public boolean isRuleMatchingRequest(Rule rule, javax.servlet.http.HttpServletRequest request)
Checks if this rule match the request.- Parameters:
rule- the rulerequest- the request- Returns:
- if this rule match the request
-
matchUrl
public boolean matchUrl(javax.servlet.http.HttpServletRequest request, String strUrlPatern)method to test if the URL matches the pattern.- Parameters:
request- the requeststrUrlPatern- the pattern- Returns:
- true if the URL matches the pattern
-
-