Class BasicHttpServletRequestParametersValidator
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.servlet.impl.BasicHttpServletRequestParametersValidator
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,HttpServletRequestValidator
public class BasicHttpServletRequestParametersValidator
extends AbstractInitializableComponent
implements HttpServletRequestValidator
Component that validates HTTP request parameters for required presence, uniqueness and mutual exclusivity.
-
Field Summary
FieldsModifier and TypeFieldDescriptionAllowed parameters.private booleanFlag indicating whether to enforce the allowed parameters.private org.slf4j.LoggerLogger.Mutually exclusive parameters.Required parameters.Unique parameters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the allowed parameters.Get the mutually exclusive parameters.Get the required parameters.Get the unique parameters.booleanGet flag indicating whether to enforce the allowed parameters.voidsetAllowedParameters(Set<String> params) Set the allowed parameters.voidsetEnforceAllowedParameters(boolean flag) Set flag indicating whether to enforce the allowed parameters.voidsetMutuallyExclusiveParameters(Set<Set<String>> params) Set the mutually exclusive parameters.voidsetRequiredParameters(Set<String> params) Set the required parameters.voidsetUniqueParameters(Set<String> params) Set the unique parameters.voidvalidate(HttpServletRequest request) Validate the request.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private org.slf4j.Logger logLogger. -
enforceAllowedParameters
private boolean enforceAllowedParametersFlag indicating whether to enforce the allowed parameters. -
allowedParameters
Allowed parameters. -
requiredParameters
Required parameters. -
uniqueParameters
Unique parameters. -
mutuallyExclusiveParameters
Mutually exclusive parameters.
-
-
Constructor Details
-
BasicHttpServletRequestParametersValidator
public BasicHttpServletRequestParametersValidator()
-
-
Method Details
-
isEnforceAllowedParameters
public boolean isEnforceAllowedParameters()Get flag indicating whether to enforce the allowed parameters.Defaults to
false.- Returns:
- flag indicating enforcement of allowed parameters
-
setEnforceAllowedParameters
public void setEnforceAllowedParameters(boolean flag) Set flag indicating whether to enforce the allowed parameters.Defaults to
false.- Parameters:
flag- indicating enforcement of allowed parameters
-
getAllowedParameters
Get the allowed parameters.When enforced, a request parameter not in the allowed set will be considered invalid.
- Returns:
- the allowed parameters
-
setAllowedParameters
Set the allowed parameters.When enforced, a request parameter not in the allowed set will be considered invalid.
- Parameters:
params- the allowed parameters
-
getRequiredParameters
Get the required parameters.A required parameter must be present in the request.
- Returns:
- the required parameters
-
setRequiredParameters
Set the required parameters.A required parameter must be present in the request.
- Parameters:
params- the required parameters
-
getUniqueParameters
Get the unique parameters.A unique parameter must have at most 1 value.
- Returns:
- the unique parameters
-
setUniqueParameters
Set the unique parameters.A unique parameter must have at most 1 value.
- Parameters:
params- the unique parameters
-
getMutuallyExclusiveParameters
Get the mutually exclusive parameters.A request may not contain more then 1 parameter from an exclusivity set (the "inner" set(s) configured). Multiple exclusivity sets may be specified.
- Returns:
- the mutually exclusive parameters
-
setMutuallyExclusiveParameters
Set the mutually exclusive parameters.A request may not contain more then 1 parameter from an exclusivity set (the "inner" set(s) configured). Multiple exclusivity sets may be specified.
- Parameters:
params- the mutually exclusive parameters
-
validate
Validate the request.- Specified by:
validatein interfaceHttpServletRequestValidator- Parameters:
request- the request to validate- Throws:
ServletException- if the request is determined to be invalid
-